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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cb7148e3f4e6c1d15082f5b76e5cc46fa90b2a56 | package.json | package.json | {
"name": "fec-loader",
"version": "0.1.0",
"description": "Loads FEC data into a database",
"license": "MIT",
"dependencies": {
"fec-parse": "^0.2.1-beta.2",
"moment": "^2.13.0",
"readdir-recursive": "0.0.4",
"sequelize": "^3.23.2"
}
}
| {
"name": "fec-loader",
"version": "0.1.0",
"description": "Loads FEC data into a database",
"license": "MIT",
"dependencies": {
"fec-parse": "^0.2.1-beta.2",
"moment": "^2.13.0",
"pg": "^4.5.5",
"readdir-recursive": "0.0.4",
"sequelize": "^3.23.2"
}
}
| Add pg as a dep | Add pg as a dep
| JSON | mit | chriszs/fec-loader | json | ## Code Before:
{
"name": "fec-loader",
"version": "0.1.0",
"description": "Loads FEC data into a database",
"license": "MIT",
"dependencies": {
"fec-parse": "^0.2.1-beta.2",
"moment": "^2.13.0",
"readdir-recursive": "0.0.4",
"sequelize": "^3.23.2"
}
}
## Instruction:
Add pg as a dep
## Code After:
{
"name": "fec-loader",
"version": "0.1.0",
"description": "Loads FEC data into a database",
"license": "MIT",
"dependencies": {
"fec-parse": "^0.2.1-beta.2",
"moment": "^2.13.0",
"pg": "^4.5.5",
"readdir-recursive": "0.0.4",
"sequelize": "^3.23.2"
}
}
| {
"name": "fec-loader",
"version": "0.1.0",
"description": "Loads FEC data into a database",
"license": "MIT",
"dependencies": {
"fec-parse": "^0.2.1-beta.2",
"moment": "^2.13.0",
+ "pg": "^4.5.5",
"readdir-recursive": "0.0.4",
"sequelize": "^3.23.2"
}
} | 1 | 0.083333 | 1 | 0 |
a008261e15c8e48e127e99067f1116b825d75d3c | preview/xml-converter/test/org/jetbrains/kotlin/android/xmlconverter/BaseXmlConverterTest.java | preview/xml-converter/test/org/jetbrains/kotlin/android/xmlconverter/BaseXmlConverterTest.java | package org.jetbrains.kotlin.android.xmlconverter;
import org.junit.Rule;
import org.junit.rules.TestName;
import sun.plugin.dom.exception.InvalidStateException;
import java.io.File;
import static kotlin.collections.SetsKt.*;
import static kotlin.io.FilesKt.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class BaseXmlConverterTest {
@Rule
public TestName name = new TestName();
protected void doLayoutTest() {
File testDataDir = new File("xml-converter/testData");
String testName = name.getMethodName();
if (!testName.startsWith("test")) {
throw new InvalidStateException("Test name must start with a 'test' preffix");
}
File testDir = new File(testDataDir, decapitalize(testName.substring("test".length())));
File inputFile = new File(testDir, "layout.xml");
File outputFile = new File(testDir, "layout.kt");
assertTrue(inputFile + " does not exist", inputFile.exists());
assertTrue(outputFile + " does not exist", outputFile.exists());
String actual = XmlConverter.INSTANCE.convert(readText(inputFile, "UTF-8"), setOf("raw"));
String expected = readText(outputFile, "UTF-8");
assertEquals(expected, actual);
}
private String decapitalize(String original) {
if (original.isEmpty()) return original;
return Character.toLowerCase(original.charAt(0)) + original.substring(1);
}
}
| package org.jetbrains.kotlin.android.xmlconverter;
import kotlin.text.Charsets;
import org.junit.Rule;
import org.junit.rules.TestName;
import sun.plugin.dom.exception.InvalidStateException;
import java.io.File;
import static kotlin.collections.SetsKt.*;
import static kotlin.io.FilesKt.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class BaseXmlConverterTest {
@Rule
public TestName name = new TestName();
protected void doLayoutTest() {
File testDataDir = new File("xml-converter/testData");
String testName = name.getMethodName();
if (!testName.startsWith("test")) {
throw new InvalidStateException("Test name must start with a 'test' preffix");
}
File testDir = new File(testDataDir, decapitalize(testName.substring("test".length())));
File inputFile = new File(testDir, "layout.xml");
File outputFile = new File(testDir, "layout.kt");
assertTrue(inputFile + " does not exist", inputFile.exists());
assertTrue(outputFile + " does not exist", outputFile.exists());
String actual = XmlConverter.INSTANCE.convert(readText(inputFile, Charsets.UTF_8), setOf("raw"));
String expected = readText(outputFile, Charsets.UTF_8);
assertEquals(expected, actual);
}
private String decapitalize(String original) {
if (original.isEmpty()) return original;
return Character.toLowerCase(original.charAt(0)) + original.substring(1);
}
}
| Fix compilation error with Kotlin 1.0 | Fix compilation error with Kotlin 1.0
| Java | apache-2.0 | fboldog/anko,Kotlin/anko,deva666/anko,Kotlin/anko,deva666/anko,JetBrains/anko,Kotlin/anko,fboldog/anko,deva666/anko,JetBrains/anko,JetBrains/anko,fboldog/anko | java | ## Code Before:
package org.jetbrains.kotlin.android.xmlconverter;
import org.junit.Rule;
import org.junit.rules.TestName;
import sun.plugin.dom.exception.InvalidStateException;
import java.io.File;
import static kotlin.collections.SetsKt.*;
import static kotlin.io.FilesKt.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class BaseXmlConverterTest {
@Rule
public TestName name = new TestName();
protected void doLayoutTest() {
File testDataDir = new File("xml-converter/testData");
String testName = name.getMethodName();
if (!testName.startsWith("test")) {
throw new InvalidStateException("Test name must start with a 'test' preffix");
}
File testDir = new File(testDataDir, decapitalize(testName.substring("test".length())));
File inputFile = new File(testDir, "layout.xml");
File outputFile = new File(testDir, "layout.kt");
assertTrue(inputFile + " does not exist", inputFile.exists());
assertTrue(outputFile + " does not exist", outputFile.exists());
String actual = XmlConverter.INSTANCE.convert(readText(inputFile, "UTF-8"), setOf("raw"));
String expected = readText(outputFile, "UTF-8");
assertEquals(expected, actual);
}
private String decapitalize(String original) {
if (original.isEmpty()) return original;
return Character.toLowerCase(original.charAt(0)) + original.substring(1);
}
}
## Instruction:
Fix compilation error with Kotlin 1.0
## Code After:
package org.jetbrains.kotlin.android.xmlconverter;
import kotlin.text.Charsets;
import org.junit.Rule;
import org.junit.rules.TestName;
import sun.plugin.dom.exception.InvalidStateException;
import java.io.File;
import static kotlin.collections.SetsKt.*;
import static kotlin.io.FilesKt.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class BaseXmlConverterTest {
@Rule
public TestName name = new TestName();
protected void doLayoutTest() {
File testDataDir = new File("xml-converter/testData");
String testName = name.getMethodName();
if (!testName.startsWith("test")) {
throw new InvalidStateException("Test name must start with a 'test' preffix");
}
File testDir = new File(testDataDir, decapitalize(testName.substring("test".length())));
File inputFile = new File(testDir, "layout.xml");
File outputFile = new File(testDir, "layout.kt");
assertTrue(inputFile + " does not exist", inputFile.exists());
assertTrue(outputFile + " does not exist", outputFile.exists());
String actual = XmlConverter.INSTANCE.convert(readText(inputFile, Charsets.UTF_8), setOf("raw"));
String expected = readText(outputFile, Charsets.UTF_8);
assertEquals(expected, actual);
}
private String decapitalize(String original) {
if (original.isEmpty()) return original;
return Character.toLowerCase(original.charAt(0)) + original.substring(1);
}
}
| package org.jetbrains.kotlin.android.xmlconverter;
+ import kotlin.text.Charsets;
import org.junit.Rule;
import org.junit.rules.TestName;
import sun.plugin.dom.exception.InvalidStateException;
import java.io.File;
import static kotlin.collections.SetsKt.*;
import static kotlin.io.FilesKt.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class BaseXmlConverterTest {
@Rule
public TestName name = new TestName();
protected void doLayoutTest() {
File testDataDir = new File("xml-converter/testData");
String testName = name.getMethodName();
if (!testName.startsWith("test")) {
throw new InvalidStateException("Test name must start with a 'test' preffix");
}
File testDir = new File(testDataDir, decapitalize(testName.substring("test".length())));
File inputFile = new File(testDir, "layout.xml");
File outputFile = new File(testDir, "layout.kt");
assertTrue(inputFile + " does not exist", inputFile.exists());
assertTrue(outputFile + " does not exist", outputFile.exists());
- String actual = XmlConverter.INSTANCE.convert(readText(inputFile, "UTF-8"), setOf("raw"));
? ^ ^ -
+ String actual = XmlConverter.INSTANCE.convert(readText(inputFile, Charsets.UTF_8), setOf("raw"));
? ^^^^^^^^^ ^
- String expected = readText(outputFile, "UTF-8");
? ^ ^ -
+ String expected = readText(outputFile, Charsets.UTF_8);
? ^^^^^^^^^ ^
assertEquals(expected, actual);
}
private String decapitalize(String original) {
if (original.isEmpty()) return original;
return Character.toLowerCase(original.charAt(0)) + original.substring(1);
}
} | 5 | 0.116279 | 3 | 2 |
49f0544148f3ce461d08418bde346a0dc1c951b0 | ui/src/components/common/Screen.scss | ui/src/components/common/Screen.scss | @import "src/app/variables.scss";
.Screen {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
.main-homepage {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
background-color: $aleph-content-background;
align-items: stretch;
}
.main {
@extend .main;
padding-bottom: ($aleph-grid-size*4 - 1);
}
} | @import "src/app/variables.scss";
.Screen {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
.main-homepage {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
background-color: $aleph-content-background;
align-items: stretch;
}
.main {
@extend .main;
padding-bottom: ($aleph-grid-size*4 - 1);
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
}
} | Fix for content not growing to full height | Fix for content not growing to full height
With main now inside the screen component (which should probably be called Layout now, if we can be bothered to refactor it; though it’s not pressing) we need to make sure that it uses flex box and grows to full height so that content within it displays correctly.
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
| SCSS | mit | alephdata/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,pudo/aleph,pudo/aleph,pudo/aleph | scss | ## Code Before:
@import "src/app/variables.scss";
.Screen {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
.main-homepage {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
background-color: $aleph-content-background;
align-items: stretch;
}
.main {
@extend .main;
padding-bottom: ($aleph-grid-size*4 - 1);
}
}
## Instruction:
Fix for content not growing to full height
With main now inside the screen component (which should probably be called Layout now, if we can be bothered to refactor it; though it’s not pressing) we need to make sure that it uses flex box and grows to full height so that content within it displays correctly.
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
## Code After:
@import "src/app/variables.scss";
.Screen {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
.main-homepage {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
background-color: $aleph-content-background;
align-items: stretch;
}
.main {
@extend .main;
padding-bottom: ($aleph-grid-size*4 - 1);
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
}
} | @import "src/app/variables.scss";
.Screen {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
.main-homepage {
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
background-color: $aleph-content-background;
align-items: stretch;
}
.main {
@extend .main;
padding-bottom: ($aleph-grid-size*4 - 1);
+ flex-grow: 1;
+ display: flex;
+ flex-flow: column nowrap;
}
} | 3 | 0.157895 | 3 | 0 |
196fedffc8237afe3dbb604868c9e1791010c8cf | .travis.yml | .travis.yml | language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
env:
- DJANGO_VERSION=1.5.8
- DJANGO_VERSION=1.6.5
install:
- pip install -q Django==$DJANGO_VERSION
- pip install -r requirements.txt
script: python setup.py test
notifications:
email: false
irc:
channels: "chat.freenode.net#platal"
on_success: always
on_failure: always
template:
- "%{repository} : %{message} ( %{build_url} )"
| language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
env:
- DJANGO_VERSION=1.5.8
- DJANGO_VERSION=1.6.7
- DJANGO_VERSION=1.7
matrix:
exclude:
- python: "2.6"
env: DJANGO_VERSION=1.7
install:
- pip install -q Django==$DJANGO_VERSION
- pip install -r requirements.txt
script: python setup.py test
notifications:
email: false
irc:
channels: "chat.freenode.net#platal"
on_success: always
on_failure: always
template:
- "%{repository} : %{message} ( %{build_url} )"
| Update Django version for Travis | Update Django version for Travis
https://www.djangoproject.com/download/ says:
* latest = 1.7
* previous = 1.6.5
Django >=1.7 is no longer compatible with Python 2.6.
| YAML | bsd-2-clause | Polytechnique-org/django-authgroupex | yaml | ## Code Before:
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
env:
- DJANGO_VERSION=1.5.8
- DJANGO_VERSION=1.6.5
install:
- pip install -q Django==$DJANGO_VERSION
- pip install -r requirements.txt
script: python setup.py test
notifications:
email: false
irc:
channels: "chat.freenode.net#platal"
on_success: always
on_failure: always
template:
- "%{repository} : %{message} ( %{build_url} )"
## Instruction:
Update Django version for Travis
https://www.djangoproject.com/download/ says:
* latest = 1.7
* previous = 1.6.5
Django >=1.7 is no longer compatible with Python 2.6.
## Code After:
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
env:
- DJANGO_VERSION=1.5.8
- DJANGO_VERSION=1.6.7
- DJANGO_VERSION=1.7
matrix:
exclude:
- python: "2.6"
env: DJANGO_VERSION=1.7
install:
- pip install -q Django==$DJANGO_VERSION
- pip install -r requirements.txt
script: python setup.py test
notifications:
email: false
irc:
channels: "chat.freenode.net#platal"
on_success: always
on_failure: always
template:
- "%{repository} : %{message} ( %{build_url} )"
| language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
env:
- DJANGO_VERSION=1.5.8
- - DJANGO_VERSION=1.6.5
? ^
+ - DJANGO_VERSION=1.6.7
? ^
+ - DJANGO_VERSION=1.7
+ matrix:
+ exclude:
+ - python: "2.6"
+ env: DJANGO_VERSION=1.7
install:
- pip install -q Django==$DJANGO_VERSION
- pip install -r requirements.txt
script: python setup.py test
notifications:
email: false
irc:
channels: "chat.freenode.net#platal"
on_success: always
on_failure: always
template:
- "%{repository} : %{message} ( %{build_url} )" | 7 | 0.333333 | 6 | 1 |
be72ed3c00a8c14257cac4bfc2ee4beb14663219 | upd.inp.1 | upd.inp.1 | 0040 KILO #include <time.h>
#include >fcntl.h>
#include <unistd.h>
0066 KILO
$I struct timespec tim, tim2;
$I
$I int cha;
$I int return_value;
$I int ignore;
$I static struct termios temp_termios;
$I
$I int nucat( const char infil[] )
$I {
$I FILE *fPtr;
$I fPtr=fopen(infil, "r");
$I int ch;
$I
$I while
$I ((ch = fgetc(fPtr)) != EOF)
$I putchar(ch);
$I
$I int newLine = 10; putchar(newLine);
$I int carriageReturn=13; putchar(carriageReturn);
$I return 0;
$I }
$I
1259 KILO
$I tim.tv_sec = 0;
$I tim.tv_nsec = 500000000L; /* 1/2 of a second */
| 0040 KILO #include <time.h>
#include >fcntl.h>
#include <unistd.h>
0066 KILO
$I struct timespec tim, tim2;
$I
$I int cha;
$I int return_value;
$I int ignore;
$I static struct termios temp_termios;
$I
$I int nucat( const char infil[] )
$I {
$I FILE *fPtr;
$I fPtr=fopen(infil, "r");
$I int ch;
$I
$I while
$I ((ch = fgetc(fPtr)) != EOF)
$I putchar(ch);
$I
$I int newLine = 10; putchar(newLine);
$I int carriageReturn=13; putchar(carriageReturn);
$I return 0;
$I }
$I
1184 KILO exit(0); /* The sole no-error return from kilo */
1259 KILO
$I tim.tv_sec = 0;
$I tim.tv_nsec = 500000000L; /* 1/2 of a second */
| Add comment flagging the no-error exit statement | Add comment flagging the no-error exit statement
| Groff | bsd-2-clause | eingaeph/pip.imbue.hood,eingaeph/pip.imbue.hood | groff | ## Code Before:
0040 KILO #include <time.h>
#include >fcntl.h>
#include <unistd.h>
0066 KILO
$I struct timespec tim, tim2;
$I
$I int cha;
$I int return_value;
$I int ignore;
$I static struct termios temp_termios;
$I
$I int nucat( const char infil[] )
$I {
$I FILE *fPtr;
$I fPtr=fopen(infil, "r");
$I int ch;
$I
$I while
$I ((ch = fgetc(fPtr)) != EOF)
$I putchar(ch);
$I
$I int newLine = 10; putchar(newLine);
$I int carriageReturn=13; putchar(carriageReturn);
$I return 0;
$I }
$I
1259 KILO
$I tim.tv_sec = 0;
$I tim.tv_nsec = 500000000L; /* 1/2 of a second */
## Instruction:
Add comment flagging the no-error exit statement
## Code After:
0040 KILO #include <time.h>
#include >fcntl.h>
#include <unistd.h>
0066 KILO
$I struct timespec tim, tim2;
$I
$I int cha;
$I int return_value;
$I int ignore;
$I static struct termios temp_termios;
$I
$I int nucat( const char infil[] )
$I {
$I FILE *fPtr;
$I fPtr=fopen(infil, "r");
$I int ch;
$I
$I while
$I ((ch = fgetc(fPtr)) != EOF)
$I putchar(ch);
$I
$I int newLine = 10; putchar(newLine);
$I int carriageReturn=13; putchar(carriageReturn);
$I return 0;
$I }
$I
1184 KILO exit(0); /* The sole no-error return from kilo */
1259 KILO
$I tim.tv_sec = 0;
$I tim.tv_nsec = 500000000L; /* 1/2 of a second */
| 0040 KILO #include <time.h>
#include >fcntl.h>
#include <unistd.h>
0066 KILO
$I struct timespec tim, tim2;
$I
$I int cha;
$I int return_value;
$I int ignore;
$I static struct termios temp_termios;
$I
$I int nucat( const char infil[] )
$I {
$I FILE *fPtr;
$I fPtr=fopen(infil, "r");
$I int ch;
$I
$I while
$I ((ch = fgetc(fPtr)) != EOF)
$I putchar(ch);
$I
$I int newLine = 10; putchar(newLine);
$I int carriageReturn=13; putchar(carriageReturn);
$I return 0;
$I }
$I
+ 1184 KILO exit(0); /* The sole no-error return from kilo */
1259 KILO
- $I tim.tv_sec = 0;
? -
+ $I tim.tv_sec = 0;
- $I tim.tv_nsec = 500000000L; /* 1/2 of a second */
? -
+ $I tim.tv_nsec = 500000000L; /* 1/2 of a second */
| 5 | 0.15625 | 3 | 2 |
86bbae35b0a23113e7f4251ecb0f63ec4c3fec41 | cloudmesh_spark/ansible/spark.yaml | cloudmesh_spark/ansible/spark.yaml | ---
- hosts: spark-cluster
remote_user: ubuntu
sudo: yes
tasks:
- name: Add Java repository
apt_repository: repo=ppa:webupd8team/java state=present
- name: Automatically select the Oracle License
shell: echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
- name: Install JRE
apt: pkg=oracle-java6-installer state=latest update-cache=yes force=yes
- name: Set Java environment variable
shell: echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >> /etc/environment
- name: Install Scala
apt: name=scala update_cache=yes
- name: Set Scala environment variable
shell: echo "SCALA_HOME=/usr/share/java" >> /etc/environment
- name: Source environment variables
shell: . /etc/environment
- name: Install Spark
shell: wget http://d3kbcqa49mib13.cloudfront.net/spark-1.3.1-bin-hadoop2.6.tgz
- name: Unarchive Spark install package
command: tar -xzvf spark-1.3.1-bin-hadoop2.6.tgz
- name: Edit hosts file
shell: echo "127.0.0.1 localhost $(hostname)" >> /etc/hosts
- name: Add hosts file to each node
shell: cat ~/hosts.txt >> /etc/hosts
| ---
- hosts: spark-cluster
remote_user: ubuntu
sudo: yes
tasks:
- name: Add Java repository
apt_repository: repo=ppa:webupd8team/java state=present
- name: Automatically select the Oracle License
shell: echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
- name: Install JRE
apt: pkg=oracle-java6-installer state=latest update-cache=yes force=yes
- name: Set Java environment variable
shell: echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >> /etc/environment
- name: Install Scala
apt: name=scala update_cache=yes
- name: Set Scala environment variable
shell: echo "SCALA_HOME=/usr/share/java" >> /etc/environment
- name: Source environment variables
shell: . /etc/environment
- name: Install Spark
shell: wget http://d3kbcqa49mib13.cloudfront.net/spark-1.3.1-bin-hadoop2.6.tgz
- name: Unarchive Spark install package
command: tar -xzvf spark-1.3.1-bin-hadoop2.6.tgz
- name: Edit hosts file
shell: echo "127.0.0.1 localhost $(hostname)" >> /etc/hosts
- name: Add hosts file to each node
shell: cat /home/ubuntu/hosts.txt >> /etc/hosts
| Change to full path for hosts. | Change to full path for hosts.
| YAML | apache-2.0 | futuresystems/465-project-mckibbenc-rebecca-appelbaum-imthinhvu,futuresystems-courses/465-project-mckibbenc-rebecca-appelbaum-imthinhvu,futuresystems/465-project-mckibbenc-rebecca-appelbaum-imthinhvu,futuresystems-courses/465-project-mckibbenc-rebecca-appelbaum-imthinhvu | yaml | ## Code Before:
---
- hosts: spark-cluster
remote_user: ubuntu
sudo: yes
tasks:
- name: Add Java repository
apt_repository: repo=ppa:webupd8team/java state=present
- name: Automatically select the Oracle License
shell: echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
- name: Install JRE
apt: pkg=oracle-java6-installer state=latest update-cache=yes force=yes
- name: Set Java environment variable
shell: echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >> /etc/environment
- name: Install Scala
apt: name=scala update_cache=yes
- name: Set Scala environment variable
shell: echo "SCALA_HOME=/usr/share/java" >> /etc/environment
- name: Source environment variables
shell: . /etc/environment
- name: Install Spark
shell: wget http://d3kbcqa49mib13.cloudfront.net/spark-1.3.1-bin-hadoop2.6.tgz
- name: Unarchive Spark install package
command: tar -xzvf spark-1.3.1-bin-hadoop2.6.tgz
- name: Edit hosts file
shell: echo "127.0.0.1 localhost $(hostname)" >> /etc/hosts
- name: Add hosts file to each node
shell: cat ~/hosts.txt >> /etc/hosts
## Instruction:
Change to full path for hosts.
## Code After:
---
- hosts: spark-cluster
remote_user: ubuntu
sudo: yes
tasks:
- name: Add Java repository
apt_repository: repo=ppa:webupd8team/java state=present
- name: Automatically select the Oracle License
shell: echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
- name: Install JRE
apt: pkg=oracle-java6-installer state=latest update-cache=yes force=yes
- name: Set Java environment variable
shell: echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >> /etc/environment
- name: Install Scala
apt: name=scala update_cache=yes
- name: Set Scala environment variable
shell: echo "SCALA_HOME=/usr/share/java" >> /etc/environment
- name: Source environment variables
shell: . /etc/environment
- name: Install Spark
shell: wget http://d3kbcqa49mib13.cloudfront.net/spark-1.3.1-bin-hadoop2.6.tgz
- name: Unarchive Spark install package
command: tar -xzvf spark-1.3.1-bin-hadoop2.6.tgz
- name: Edit hosts file
shell: echo "127.0.0.1 localhost $(hostname)" >> /etc/hosts
- name: Add hosts file to each node
shell: cat /home/ubuntu/hosts.txt >> /etc/hosts
| ---
- hosts: spark-cluster
remote_user: ubuntu
sudo: yes
tasks:
- name: Add Java repository
apt_repository: repo=ppa:webupd8team/java state=present
- name: Automatically select the Oracle License
shell: echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
- name: Install JRE
apt: pkg=oracle-java6-installer state=latest update-cache=yes force=yes
- name: Set Java environment variable
shell: echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >> /etc/environment
- name: Install Scala
apt: name=scala update_cache=yes
- name: Set Scala environment variable
shell: echo "SCALA_HOME=/usr/share/java" >> /etc/environment
- name: Source environment variables
shell: . /etc/environment
- name: Install Spark
shell: wget http://d3kbcqa49mib13.cloudfront.net/spark-1.3.1-bin-hadoop2.6.tgz
- name: Unarchive Spark install package
command: tar -xzvf spark-1.3.1-bin-hadoop2.6.tgz
- name: Edit hosts file
shell: echo "127.0.0.1 localhost $(hostname)" >> /etc/hosts
- name: Add hosts file to each node
- shell: cat ~/hosts.txt >> /etc/hosts
? ^
+ shell: cat /home/ubuntu/hosts.txt >> /etc/hosts
? ^^^^^^^^^^^^
| 2 | 0.074074 | 1 | 1 |
4dc8629a984460baa523e356e15a98911f1715be | dev/www/templates/home.html | dev/www/templates/home.html | <ion-view title="Sign In" ng-controller="loginController">
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content padding="true">
<!--
<button class="button button-block button-assertive" ng-click="validateUser('facebook')">Facebook</button>
<button class="button button-block button-assertive" ng-click="validateUser('google')">Google</button>-->
<div class="card">
<div class="item item-text-wrap">
<h2>Thanks for using FastPass!</h2>
<p>
You must be in the park and allow FastPass Exchange to use your current location.
</p>
</div>
</div>
</ion-content>
<ion-footer-bar class="signin">
<div class="row">
<div class="col">
<button class="button button-outline button-block button-positive icon-left ion-social-facebook" ng-click="validateUser('facebook')">Facebook</button>
</div>
<div class="col">
<button class="button button-outline button-block button-assertive icon-left ion-social-google" ng-click="validateUser('google')">Google</button>
</div>
</div>
</ion-footer-bar>
</ion-view>
| <ion-view title="Sign In" ng-controller="loginController" hide-back-button="true">
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content padding="true">
<!--
<button class="button button-block button-assertive" ng-click="validateUser('facebook')">Facebook</button>
<button class="button button-block button-assertive" ng-click="validateUser('google')">Google</button>-->
<div class="card">
<div class="item item-text-wrap">
<h2>Thanks for using FastPass!</h2>
<p>
You must be in the park and allow FastPass Exchange to use your current location.
</p>
</div>
</div>
</ion-content>
<ion-footer-bar class="signin">
<div class="row">
<div class="col">
<button class="button button-outline button-block button-positive icon-left ion-social-facebook" ng-click="validateUser('facebook')">Facebook</button>
</div>
<div class="col">
<button class="button button-outline button-block button-assertive icon-left ion-social-google" ng-click="validateUser('google')">Google</button>
</div>
</div>
</ion-footer-bar>
</ion-view>
| Hide back button on splash page | Hide back button on splash page
| HTML | mit | fastpassexchange/fastpass,fastpassexchange/fastpass,fastpassexchange/fastpass,fastpassexchange/fastpass,fastpassexchange/fastpass,fastpassexchange/fastpass | html | ## Code Before:
<ion-view title="Sign In" ng-controller="loginController">
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content padding="true">
<!--
<button class="button button-block button-assertive" ng-click="validateUser('facebook')">Facebook</button>
<button class="button button-block button-assertive" ng-click="validateUser('google')">Google</button>-->
<div class="card">
<div class="item item-text-wrap">
<h2>Thanks for using FastPass!</h2>
<p>
You must be in the park and allow FastPass Exchange to use your current location.
</p>
</div>
</div>
</ion-content>
<ion-footer-bar class="signin">
<div class="row">
<div class="col">
<button class="button button-outline button-block button-positive icon-left ion-social-facebook" ng-click="validateUser('facebook')">Facebook</button>
</div>
<div class="col">
<button class="button button-outline button-block button-assertive icon-left ion-social-google" ng-click="validateUser('google')">Google</button>
</div>
</div>
</ion-footer-bar>
</ion-view>
## Instruction:
Hide back button on splash page
## Code After:
<ion-view title="Sign In" ng-controller="loginController" hide-back-button="true">
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content padding="true">
<!--
<button class="button button-block button-assertive" ng-click="validateUser('facebook')">Facebook</button>
<button class="button button-block button-assertive" ng-click="validateUser('google')">Google</button>-->
<div class="card">
<div class="item item-text-wrap">
<h2>Thanks for using FastPass!</h2>
<p>
You must be in the park and allow FastPass Exchange to use your current location.
</p>
</div>
</div>
</ion-content>
<ion-footer-bar class="signin">
<div class="row">
<div class="col">
<button class="button button-outline button-block button-positive icon-left ion-social-facebook" ng-click="validateUser('facebook')">Facebook</button>
</div>
<div class="col">
<button class="button button-outline button-block button-assertive icon-left ion-social-google" ng-click="validateUser('google')">Google</button>
</div>
</div>
</ion-footer-bar>
</ion-view>
| - <ion-view title="Sign In" ng-controller="loginController">
+ <ion-view title="Sign In" ng-controller="loginController" hide-back-button="true">
? ++++++++++++++++++++++++
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content padding="true">
<!--
<button class="button button-block button-assertive" ng-click="validateUser('facebook')">Facebook</button>
<button class="button button-block button-assertive" ng-click="validateUser('google')">Google</button>-->
<div class="card">
<div class="item item-text-wrap">
<h2>Thanks for using FastPass!</h2>
<p>
You must be in the park and allow FastPass Exchange to use your current location.
</p>
</div>
</div>
</ion-content>
<ion-footer-bar class="signin">
<div class="row">
<div class="col">
<button class="button button-outline button-block button-positive icon-left ion-social-facebook" ng-click="validateUser('facebook')">Facebook</button>
</div>
<div class="col">
<button class="button button-outline button-block button-assertive icon-left ion-social-google" ng-click="validateUser('google')">Google</button>
</div>
</div>
</ion-footer-bar>
</ion-view> | 2 | 0.068966 | 1 | 1 |
7738997ed31ede24e0da8658265bef3150f6db50 | md-to-pdf.sh | md-to-pdf.sh | if [[ $# -eq 0 ]] ; then
echo 'Usage: `topdf somefile.md`'
exit 0
fi
INFILE=$1
NAME=${1%.md}
PDFNAME=${NAME}.pdf
# PROCESSING
sed -e 's/––/---/g' ${INFILE} | # Add any other operations after this...
pandoc --from=markdown --latex-engine=xelatex -o ${PDFNAME} # ...and before this.
# CONVENIENCE
echo "Done: created" $PDFNAME
open $PDFNAME
| if [[ $# -eq 0 ]] ; then
echo 'Usage: `topdf somefile.md`'
exit 0
fi
INFILE=$1
NAME=${1%.md}
PDFNAME=${NAME}.pdf
# PROCESSING
sed -e 's/––/---/g' ${INFILE} | # Better em-dashes
sed -e 's/<br>/\\\newline /g' | # Support <br> for line breaks. Add any other operations after this...
pandoc --from=markdown --latex-engine=xelatex -o ${PDFNAME} --variable urlcolor=NavyBlue # ...and before this.
# CONVENIENCE
echo "Done: created" $PDFNAME
open $PDFNAME
| Add support for <br> for newlines in lists | Add support for <br> for newlines in lists
| Shell | mit | lukasschwab/code-golf,lukasschwab/code-golf,lukasschwab/code-golf,lukasschwab/code-golf | shell | ## Code Before:
if [[ $# -eq 0 ]] ; then
echo 'Usage: `topdf somefile.md`'
exit 0
fi
INFILE=$1
NAME=${1%.md}
PDFNAME=${NAME}.pdf
# PROCESSING
sed -e 's/––/---/g' ${INFILE} | # Add any other operations after this...
pandoc --from=markdown --latex-engine=xelatex -o ${PDFNAME} # ...and before this.
# CONVENIENCE
echo "Done: created" $PDFNAME
open $PDFNAME
## Instruction:
Add support for <br> for newlines in lists
## Code After:
if [[ $# -eq 0 ]] ; then
echo 'Usage: `topdf somefile.md`'
exit 0
fi
INFILE=$1
NAME=${1%.md}
PDFNAME=${NAME}.pdf
# PROCESSING
sed -e 's/––/---/g' ${INFILE} | # Better em-dashes
sed -e 's/<br>/\\\newline /g' | # Support <br> for line breaks. Add any other operations after this...
pandoc --from=markdown --latex-engine=xelatex -o ${PDFNAME} --variable urlcolor=NavyBlue # ...and before this.
# CONVENIENCE
echo "Done: created" $PDFNAME
open $PDFNAME
| if [[ $# -eq 0 ]] ; then
echo 'Usage: `topdf somefile.md`'
exit 0
fi
INFILE=$1
NAME=${1%.md}
PDFNAME=${NAME}.pdf
# PROCESSING
- sed -e 's/––/---/g' ${INFILE} | # Add any other operations after this...
+ sed -e 's/––/---/g' ${INFILE} | # Better em-dashes
+ sed -e 's/<br>/\\\newline /g' | # Support <br> for line breaks. Add any other operations after this...
- pandoc --from=markdown --latex-engine=xelatex -o ${PDFNAME} # ...and before this.
+ pandoc --from=markdown --latex-engine=xelatex -o ${PDFNAME} --variable urlcolor=NavyBlue # ...and before this.
? +++++++++++++++++++++++++++++
# CONVENIENCE
echo "Done: created" $PDFNAME
open $PDFNAME | 5 | 0.384615 | 3 | 2 |
3108c1ee97578fc147da8f613e59d066de05628b | app/controllers/exam_authorization_requests_controller.rb | app/controllers/exam_authorization_requests_controller.rb | class ExamAuthorizationRequestsController < ApplicationController
before_action :set_registration!
before_action :verify_registration_opened!
def create
authorization_request = @registration.authorization_requests.find_or_create_by! user: current_user do |it|
it.assign_attributes authorization_request_params
end
current_user.read_notification! @registration
flash.notice = I18n.t :exam_authorization_request_created
redirect_to root_path
end
def update
@registration.authorization_requests.update params[:id], authorization_request_params
flash.notice = I18n.t :exam_authorization_request_saved
redirect_to root_path
end
private
def authorization_request_params
params
.require(:exam_authorization_request).permit(:exam_id, :exam_registration_id)
.merge(user: current_user, organization: Organization.current)
end
def set_registration!
@registration = ExamRegistration.find(authorization_request_params[:exam_registration_id])
end
def verify_registration_opened!
raise Mumuki::Domain::GoneError if @registration.ended?
end
end
| class ExamAuthorizationRequestsController < ApplicationController
before_action :set_registration!
before_action :verify_registration_opened!
before_action :verify_registration_in_current_organization!
def create
authorization_request = @registration.authorization_requests.find_or_create_by! user: current_user do |it|
it.assign_attributes authorization_request_params
end
current_user.read_notification! @registration
flash.notice = I18n.t :exam_authorization_request_created
redirect_to root_path
end
def update
@registration.authorization_requests.update params[:id], authorization_request_params
flash.notice = I18n.t :exam_authorization_request_saved
redirect_to root_path
end
private
def authorization_request_params
params
.require(:exam_authorization_request).permit(:exam_id, :exam_registration_id)
.merge(user: current_user, organization: Organization.current)
end
def set_registration!
@registration = ExamRegistration.find(authorization_request_params[:exam_registration_id])
end
def verify_registration_in_current_organization!
raise Mumuki::Domain::NotFoundError unless @registration.organization == Organization.current
end
def verify_registration_opened!
raise Mumuki::Domain::GoneError if @registration.ended?
end
end
| Fix issue with invalid organization | Fix issue with invalid organization
| Ruby | agpl-3.0 | mumuki/mumuki-laboratory,mumuki/mumuki-laboratory,mumuki/mumuki-laboratory,mumuki/mumuki-laboratory | ruby | ## Code Before:
class ExamAuthorizationRequestsController < ApplicationController
before_action :set_registration!
before_action :verify_registration_opened!
def create
authorization_request = @registration.authorization_requests.find_or_create_by! user: current_user do |it|
it.assign_attributes authorization_request_params
end
current_user.read_notification! @registration
flash.notice = I18n.t :exam_authorization_request_created
redirect_to root_path
end
def update
@registration.authorization_requests.update params[:id], authorization_request_params
flash.notice = I18n.t :exam_authorization_request_saved
redirect_to root_path
end
private
def authorization_request_params
params
.require(:exam_authorization_request).permit(:exam_id, :exam_registration_id)
.merge(user: current_user, organization: Organization.current)
end
def set_registration!
@registration = ExamRegistration.find(authorization_request_params[:exam_registration_id])
end
def verify_registration_opened!
raise Mumuki::Domain::GoneError if @registration.ended?
end
end
## Instruction:
Fix issue with invalid organization
## Code After:
class ExamAuthorizationRequestsController < ApplicationController
before_action :set_registration!
before_action :verify_registration_opened!
before_action :verify_registration_in_current_organization!
def create
authorization_request = @registration.authorization_requests.find_or_create_by! user: current_user do |it|
it.assign_attributes authorization_request_params
end
current_user.read_notification! @registration
flash.notice = I18n.t :exam_authorization_request_created
redirect_to root_path
end
def update
@registration.authorization_requests.update params[:id], authorization_request_params
flash.notice = I18n.t :exam_authorization_request_saved
redirect_to root_path
end
private
def authorization_request_params
params
.require(:exam_authorization_request).permit(:exam_id, :exam_registration_id)
.merge(user: current_user, organization: Organization.current)
end
def set_registration!
@registration = ExamRegistration.find(authorization_request_params[:exam_registration_id])
end
def verify_registration_in_current_organization!
raise Mumuki::Domain::NotFoundError unless @registration.organization == Organization.current
end
def verify_registration_opened!
raise Mumuki::Domain::GoneError if @registration.ended?
end
end
| class ExamAuthorizationRequestsController < ApplicationController
before_action :set_registration!
before_action :verify_registration_opened!
+ before_action :verify_registration_in_current_organization!
def create
authorization_request = @registration.authorization_requests.find_or_create_by! user: current_user do |it|
it.assign_attributes authorization_request_params
end
current_user.read_notification! @registration
flash.notice = I18n.t :exam_authorization_request_created
redirect_to root_path
end
def update
@registration.authorization_requests.update params[:id], authorization_request_params
flash.notice = I18n.t :exam_authorization_request_saved
redirect_to root_path
end
private
def authorization_request_params
params
.require(:exam_authorization_request).permit(:exam_id, :exam_registration_id)
.merge(user: current_user, organization: Organization.current)
end
def set_registration!
@registration = ExamRegistration.find(authorization_request_params[:exam_registration_id])
end
+ def verify_registration_in_current_organization!
+ raise Mumuki::Domain::NotFoundError unless @registration.organization == Organization.current
+ end
+
def verify_registration_opened!
raise Mumuki::Domain::GoneError if @registration.ended?
end
end | 5 | 0.138889 | 5 | 0 |
b25f4e43eaecc53d60414514c7bf5ab9ae8eb3dc | src/app/styles/components/media/_media-checklist.scss | src/app/styles/components/media/_media-checklist.scss | .media-checklist {
font-size: 13px;
display: flex;
color: $black-87;
margin: 16px auto 0;
width: 100%;
padding: 32px 2% 80px;
background-color: $black-02;
max-width: 1000px;
aside {
padding: 0 32px 0 0;
width: 260px;
h3 {
@extend .media__notes-heading;
text-align: right;
margin-top: 8px;
}
p {
margin: 0 auto;
text-align: right;
}
}
ul {
padding: 0;
border-left: 1px solid $black-16;
}
li {
padding: 8px 8px 8px 32px;
margin: 0;
list-style-position: outside;
}
h4 {
background-color: transparent;
font-weight: 700;
color: $black-87;
margin: 0;
display: inline-block;
text-transform: uppercase;
font-size: 12px;
}
& > span {
margin-left: 0;
display: inline-block;
&::before {
content: ' – ';
}
}
em {
font-style: normal;
font-family: Courier, Monaco, mono;
}
}
| .media-checklist {
font-size: 13px;
display: flex;
color: $black-87;
margin: 16px auto 0;
width: 100%;
padding: 32px 2% 80px;
background-color: $black-02;
max-width: 1000px;
@media all and (max-width: 400px) {
display: none;
}
aside {
padding: 0 32px 0 0;
width: 260px;
h3 {
@extend .media__notes-heading;
text-align: right;
margin-top: 8px;
}
p {
margin: 0 auto;
text-align: right;
}
}
ul {
padding: 0;
border-left: 1px solid $black-16;
}
li {
padding: 8px 8px 8px 32px;
margin: 0;
list-style-position: outside;
}
h4 {
background-color: transparent;
font-weight: 700;
color: $black-87;
margin: 0;
display: inline-block;
text-transform: uppercase;
font-size: 12px;
}
& > span {
margin-left: 0;
display: inline-block;
&::before {
content: ' – ';
}
}
em {
font-style: normal;
font-family: Courier, Monaco, mono;
}
}
| Hide the checklist on small screens | Hide the checklist on small screens
| SCSS | mit | meedan/check-web,meedan/check-web,meedan/check-web | scss | ## Code Before:
.media-checklist {
font-size: 13px;
display: flex;
color: $black-87;
margin: 16px auto 0;
width: 100%;
padding: 32px 2% 80px;
background-color: $black-02;
max-width: 1000px;
aside {
padding: 0 32px 0 0;
width: 260px;
h3 {
@extend .media__notes-heading;
text-align: right;
margin-top: 8px;
}
p {
margin: 0 auto;
text-align: right;
}
}
ul {
padding: 0;
border-left: 1px solid $black-16;
}
li {
padding: 8px 8px 8px 32px;
margin: 0;
list-style-position: outside;
}
h4 {
background-color: transparent;
font-weight: 700;
color: $black-87;
margin: 0;
display: inline-block;
text-transform: uppercase;
font-size: 12px;
}
& > span {
margin-left: 0;
display: inline-block;
&::before {
content: ' – ';
}
}
em {
font-style: normal;
font-family: Courier, Monaco, mono;
}
}
## Instruction:
Hide the checklist on small screens
## Code After:
.media-checklist {
font-size: 13px;
display: flex;
color: $black-87;
margin: 16px auto 0;
width: 100%;
padding: 32px 2% 80px;
background-color: $black-02;
max-width: 1000px;
@media all and (max-width: 400px) {
display: none;
}
aside {
padding: 0 32px 0 0;
width: 260px;
h3 {
@extend .media__notes-heading;
text-align: right;
margin-top: 8px;
}
p {
margin: 0 auto;
text-align: right;
}
}
ul {
padding: 0;
border-left: 1px solid $black-16;
}
li {
padding: 8px 8px 8px 32px;
margin: 0;
list-style-position: outside;
}
h4 {
background-color: transparent;
font-weight: 700;
color: $black-87;
margin: 0;
display: inline-block;
text-transform: uppercase;
font-size: 12px;
}
& > span {
margin-left: 0;
display: inline-block;
&::before {
content: ' – ';
}
}
em {
font-style: normal;
font-family: Courier, Monaco, mono;
}
}
| .media-checklist {
font-size: 13px;
display: flex;
color: $black-87;
margin: 16px auto 0;
width: 100%;
padding: 32px 2% 80px;
background-color: $black-02;
max-width: 1000px;
+
+ @media all and (max-width: 400px) {
+ display: none;
+ }
aside {
padding: 0 32px 0 0;
width: 260px;
h3 {
@extend .media__notes-heading;
text-align: right;
margin-top: 8px;
}
p {
margin: 0 auto;
text-align: right;
}
}
ul {
padding: 0;
border-left: 1px solid $black-16;
}
li {
padding: 8px 8px 8px 32px;
margin: 0;
list-style-position: outside;
}
h4 {
background-color: transparent;
font-weight: 700;
color: $black-87;
margin: 0;
display: inline-block;
text-transform: uppercase;
font-size: 12px;
}
& > span {
margin-left: 0;
display: inline-block;
&::before {
content: ' – ';
}
}
em {
font-style: normal;
font-family: Courier, Monaco, mono;
}
} | 4 | 0.065574 | 4 | 0 |
4bd7ad6e17701a84e30e4ef3c494b032e15f673f | model/actual_group.yaml | model/actual_group.yaml |
- group_def: actual_group
- obj_ref: interface
- obj_ref: interface_array
- obj_ref: modport
- class_ref: nets
- class_ref: variables
- obj_ref: named_event
- obj_ref: named_event_array
- obj_ref: part_select
|
- group_def: actual_group
- obj_ref: interface
- obj_ref: interface_array
- obj_ref: modport
- class_ref: nets
- class_ref: variables
- obj_ref: named_event
- obj_ref: named_event_array
- obj_ref: part_select
- obj_ref: parameter
| Add parameter to actual group | Add parameter to actual group
| YAML | apache-2.0 | chipsalliance/UHDM,chipsalliance/UHDM,chipsalliance/UHDM | yaml | ## Code Before:
- group_def: actual_group
- obj_ref: interface
- obj_ref: interface_array
- obj_ref: modport
- class_ref: nets
- class_ref: variables
- obj_ref: named_event
- obj_ref: named_event_array
- obj_ref: part_select
## Instruction:
Add parameter to actual group
## Code After:
- group_def: actual_group
- obj_ref: interface
- obj_ref: interface_array
- obj_ref: modport
- class_ref: nets
- class_ref: variables
- obj_ref: named_event
- obj_ref: named_event_array
- obj_ref: part_select
- obj_ref: parameter
|
- group_def: actual_group
- obj_ref: interface
- obj_ref: interface_array
- obj_ref: modport
- class_ref: nets
- class_ref: variables
- obj_ref: named_event
- obj_ref: named_event_array
- obj_ref: part_select
+ - obj_ref: parameter
| 1 | 0.076923 | 1 | 0 |
07e61dbe552fa6b2fa07939fabb530a33fbabbf2 | README.md | README.md | wfcache-mruby allows using the Wordfence Falcon Cache with the h2o web server using mruby.
| wfcache-mruby allows using the Wordfence Falcon Cache with the h2o web server using mruby.
wfcache-mruby is based on the nginx configuration for the Falcon Cache (https://www.wordfence.com/txt/nginxConf.txt)
and also on Wordfence's .htaccess for the Falcon Cache (https://github.com/wp-plugins/wordfence/blob/master/lib/wfCache.php)
The X-Wfcache-Hit headers were inspired by Maxime Jobin's Rocket-Nginx (https://github.com/maximejobin/rocket-nginx)
To use this wfache-mruby as an mruby-handler in h2o, add something like this to your path in h2o.conf
```
paths:
"/":
reproxy: ON
mruby.handler-file: /usr/local/www/data/mgj/tmp/wfcache.rb
file.dir: "/usr/local/www/data/mgj/wordpress" # serve static files if found
redirect: # if not found, internally redirect to /index.php/<path>
url: /index.php/
internal: YES
status: 307
```
# License
wfacache-mruby is licensed under the 2-clause BSD license. Please feel free to contribute patches.
| Add detailed explanation including h2o.conf code | Add detailed explanation including h2o.conf code | Markdown | bsd-2-clause | utrenkner/wfcache-mruby | markdown | ## Code Before:
wfcache-mruby allows using the Wordfence Falcon Cache with the h2o web server using mruby.
## Instruction:
Add detailed explanation including h2o.conf code
## Code After:
wfcache-mruby allows using the Wordfence Falcon Cache with the h2o web server using mruby.
wfcache-mruby is based on the nginx configuration for the Falcon Cache (https://www.wordfence.com/txt/nginxConf.txt)
and also on Wordfence's .htaccess for the Falcon Cache (https://github.com/wp-plugins/wordfence/blob/master/lib/wfCache.php)
The X-Wfcache-Hit headers were inspired by Maxime Jobin's Rocket-Nginx (https://github.com/maximejobin/rocket-nginx)
To use this wfache-mruby as an mruby-handler in h2o, add something like this to your path in h2o.conf
```
paths:
"/":
reproxy: ON
mruby.handler-file: /usr/local/www/data/mgj/tmp/wfcache.rb
file.dir: "/usr/local/www/data/mgj/wordpress" # serve static files if found
redirect: # if not found, internally redirect to /index.php/<path>
url: /index.php/
internal: YES
status: 307
```
# License
wfacache-mruby is licensed under the 2-clause BSD license. Please feel free to contribute patches.
| wfcache-mruby allows using the Wordfence Falcon Cache with the h2o web server using mruby.
+
+ wfcache-mruby is based on the nginx configuration for the Falcon Cache (https://www.wordfence.com/txt/nginxConf.txt)
+ and also on Wordfence's .htaccess for the Falcon Cache (https://github.com/wp-plugins/wordfence/blob/master/lib/wfCache.php)
+
+ The X-Wfcache-Hit headers were inspired by Maxime Jobin's Rocket-Nginx (https://github.com/maximejobin/rocket-nginx)
+
+ To use this wfache-mruby as an mruby-handler in h2o, add something like this to your path in h2o.conf
+ ```
+ paths:
+ "/":
+ reproxy: ON
+ mruby.handler-file: /usr/local/www/data/mgj/tmp/wfcache.rb
+ file.dir: "/usr/local/www/data/mgj/wordpress" # serve static files if found
+ redirect: # if not found, internally redirect to /index.php/<path>
+ url: /index.php/
+ internal: YES
+ status: 307
+ ```
+
+ # License
+ wfacache-mruby is licensed under the 2-clause BSD license. Please feel free to contribute patches. | 21 | 21 | 21 | 0 |
9447d76ef09d987d37af356276a530b576a9510a | package.json | package.json | {
"name": "asm.js",
"description": "Tools for the asm.js subset of JavaScript",
"main": "lib/asm.js",
"version": "0.0.2",
"engines": {
"node": ">=0.8.2"
},
"author": "Dave Herman",
"license": "MIT",
"dependencies": {
"esprima": "1.0.4",
"dict": "1.4.0",
"array-extended": "0.0.4",
"pattern-match": "0.3.0"
},
"devDependencies": {
"nodeunit": "0.7.4"
},
"directories": {
"lib": "./lib"
},
"repository": {
"type": "git",
"url": "git://github.com/dherman/asm.js.git"
},
"keywords": [
"javascript",
"asm.js",
"validator"
]
}
| {
"name": "asm.js",
"description": "Tools for the asm.js subset of JavaScript",
"main": "lib/asm.js",
"version": "0.0.2",
"engines": {
"node": ">=0.8.2"
},
"author": {
"name": "Dave Herman"
},
"license": "MIT",
"dependencies": {
"esprima": "1.0.4",
"dict": "1.4.0",
"array-extended": "0.0.4",
"pattern-match": "0.3.0"
},
"devDependencies": {
"nodeunit": "0.7.4"
},
"directories": {
"lib": "./lib"
},
"repository": {
"type": "git",
"url": "git://github.com/dherman/asm.js.git"
},
"keywords": [
"javascript",
"asm.js",
"validator"
]
}
| Upgrade the author field to a dictionary. | Upgrade the author field to a dictionary.
| JSON | apache-2.0 | jeykigung/asm.js,shyamalschandra/asm.js,shyamalschandra/asm.js,jeykigung/asm.js,jeykigung/asm.js,dherman/asm.js,Uni-Sol/asm.js,gasman/asm.js,dherman/asm.js,Uni-Sol/asm.js,gasman/asm.js,Uni-Sol/asm.js,shyamalschandra/asm.js,gasman/asm.js,dherman/asm.js | json | ## Code Before:
{
"name": "asm.js",
"description": "Tools for the asm.js subset of JavaScript",
"main": "lib/asm.js",
"version": "0.0.2",
"engines": {
"node": ">=0.8.2"
},
"author": "Dave Herman",
"license": "MIT",
"dependencies": {
"esprima": "1.0.4",
"dict": "1.4.0",
"array-extended": "0.0.4",
"pattern-match": "0.3.0"
},
"devDependencies": {
"nodeunit": "0.7.4"
},
"directories": {
"lib": "./lib"
},
"repository": {
"type": "git",
"url": "git://github.com/dherman/asm.js.git"
},
"keywords": [
"javascript",
"asm.js",
"validator"
]
}
## Instruction:
Upgrade the author field to a dictionary.
## Code After:
{
"name": "asm.js",
"description": "Tools for the asm.js subset of JavaScript",
"main": "lib/asm.js",
"version": "0.0.2",
"engines": {
"node": ">=0.8.2"
},
"author": {
"name": "Dave Herman"
},
"license": "MIT",
"dependencies": {
"esprima": "1.0.4",
"dict": "1.4.0",
"array-extended": "0.0.4",
"pattern-match": "0.3.0"
},
"devDependencies": {
"nodeunit": "0.7.4"
},
"directories": {
"lib": "./lib"
},
"repository": {
"type": "git",
"url": "git://github.com/dherman/asm.js.git"
},
"keywords": [
"javascript",
"asm.js",
"validator"
]
}
| {
"name": "asm.js",
"description": "Tools for the asm.js subset of JavaScript",
"main": "lib/asm.js",
"version": "0.0.2",
"engines": {
"node": ">=0.8.2"
},
+ "author": {
- "author": "Dave Herman",
? ^^^^^ -
+ "name": "Dave Herman"
? ++ + ^^
+ },
"license": "MIT",
"dependencies": {
"esprima": "1.0.4",
"dict": "1.4.0",
"array-extended": "0.0.4",
"pattern-match": "0.3.0"
},
"devDependencies": {
"nodeunit": "0.7.4"
},
"directories": {
"lib": "./lib"
},
"repository": {
"type": "git",
"url": "git://github.com/dherman/asm.js.git"
},
"keywords": [
"javascript",
"asm.js",
"validator"
]
} | 4 | 0.125 | 3 | 1 |
88f4eb3f5a5026beb5490de71aa9197472268adf | src/coffee/cilantro/utils.coffee | src/coffee/cilantro/utils.coffee | define [
'jquery'
'./utils/numbers'
'./utils/url'
'./utils/version'
], ($, mods...) ->
# Convenience method for getting a value using the dot-notion for
# accessing nested structures.
getDotProp = (obj, key) ->
toks = key.split('.')
for tok in toks
if not (obj = obj[tok])?
return
return obj
# Convenience method for setting a value using the dot-notion for
# accessing nested structures.
setDotProp = (obj, key, value) ->
if typeof key is 'object'
# Second argument is a boolean to whether or not to replace
# the options
if value is true
return $.extend(true, {}, key)
return $.extend(true, obj, key)
toks = key.split('.')
last = toks.pop()
for tok in toks
if not obj[tok]?
obj[tok] = {}
obj = obj[tok]
obj[last] = value
return
$.extend { getDotProp, setDotProp }, mods...
| define [
'jquery'
'./utils/numbers'
'./utils/url'
'./utils/version'
], ($, mods...) ->
# Convenience method for getting a value using the dot-notion for
# accessing nested structures.
getDotProp = (obj, key) ->
toks = key.split('.')
for tok in toks
if not (obj = obj[tok])?
return
return obj
# Convenience method for setting a value using the dot-notion for
# accessing nested structures.
setDotProp = (obj, key, value) ->
if typeof key is 'object'
# Second argument is a boolean to whether or not to replace
# the options
if value is true
return $.extend(true, {}, key)
return $.extend(true, obj, key)
toks = key.split('.')
last = toks.pop()
for tok in toks
if not obj[tok]?
obj[tok] = {}
obj = obj[tok]
obj[last] = value
return
pprint = (obj) ->
console.log(JSON.stringify(obj, null, 4))
$.extend { getDotProp, setDotProp, pprint }, mods...
| Add pprint utility function for JSON-based structures | Add pprint utility function for JSON-based structures
| CoffeeScript | bsd-2-clause | chop-dbhi/cilantro,chop-dbhi/cilantro,chop-dbhi/cilantro | coffeescript | ## Code Before:
define [
'jquery'
'./utils/numbers'
'./utils/url'
'./utils/version'
], ($, mods...) ->
# Convenience method for getting a value using the dot-notion for
# accessing nested structures.
getDotProp = (obj, key) ->
toks = key.split('.')
for tok in toks
if not (obj = obj[tok])?
return
return obj
# Convenience method for setting a value using the dot-notion for
# accessing nested structures.
setDotProp = (obj, key, value) ->
if typeof key is 'object'
# Second argument is a boolean to whether or not to replace
# the options
if value is true
return $.extend(true, {}, key)
return $.extend(true, obj, key)
toks = key.split('.')
last = toks.pop()
for tok in toks
if not obj[tok]?
obj[tok] = {}
obj = obj[tok]
obj[last] = value
return
$.extend { getDotProp, setDotProp }, mods...
## Instruction:
Add pprint utility function for JSON-based structures
## Code After:
define [
'jquery'
'./utils/numbers'
'./utils/url'
'./utils/version'
], ($, mods...) ->
# Convenience method for getting a value using the dot-notion for
# accessing nested structures.
getDotProp = (obj, key) ->
toks = key.split('.')
for tok in toks
if not (obj = obj[tok])?
return
return obj
# Convenience method for setting a value using the dot-notion for
# accessing nested structures.
setDotProp = (obj, key, value) ->
if typeof key is 'object'
# Second argument is a boolean to whether or not to replace
# the options
if value is true
return $.extend(true, {}, key)
return $.extend(true, obj, key)
toks = key.split('.')
last = toks.pop()
for tok in toks
if not obj[tok]?
obj[tok] = {}
obj = obj[tok]
obj[last] = value
return
pprint = (obj) ->
console.log(JSON.stringify(obj, null, 4))
$.extend { getDotProp, setDotProp, pprint }, mods...
| define [
'jquery'
'./utils/numbers'
'./utils/url'
'./utils/version'
], ($, mods...) ->
# Convenience method for getting a value using the dot-notion for
# accessing nested structures.
getDotProp = (obj, key) ->
toks = key.split('.')
for tok in toks
if not (obj = obj[tok])?
return
return obj
# Convenience method for setting a value using the dot-notion for
# accessing nested structures.
setDotProp = (obj, key, value) ->
if typeof key is 'object'
# Second argument is a boolean to whether or not to replace
# the options
if value is true
return $.extend(true, {}, key)
return $.extend(true, obj, key)
toks = key.split('.')
last = toks.pop()
for tok in toks
if not obj[tok]?
obj[tok] = {}
obj = obj[tok]
obj[last] = value
return
+ pprint = (obj) ->
+ console.log(JSON.stringify(obj, null, 4))
+
- $.extend { getDotProp, setDotProp }, mods...
+ $.extend { getDotProp, setDotProp, pprint }, mods...
? ++++++++
| 5 | 0.138889 | 4 | 1 |
154179dbd63acdf71f27527e802eecf7675c93bf | apps/native-component-list/screens/FontScreen.js | apps/native-component-list/screens/FontScreen.js | import React from 'react';
import { Platform, ScrollView, Text, View } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
export default class FontScreen extends React.Component {
static navigationOptions = {
title: 'Font',
};
render() {
const fontFamily = Platform.OS === 'ios' ? 'Menlo' : 'monospace';
return (
<ScrollView style={{ flex: 1 }}>
<View
style={{
paddingVertical: 10,
paddingHorizontal: 15,
flexDirection: 'row',
justifyContent: 'space-between',
flex: 1,
}}>
<MaterialIcons name="airplay" size={25} />
<MaterialIcons name="airport-shuttle" size={25} />
<MaterialIcons name="alarm" size={25} />
<MaterialIcons name="alarm-add" size={25} />
<MaterialIcons name="alarm-off" size={25} />
<MaterialIcons name="all-inclusive" size={25} />
</View>
<View style={{ paddingVertical: 10, paddingHorizontal: 15 }}>
<Text style={{ fontFamily, fontSize: 16 }}>
Font icons sets and other custom fonts can be loaded from the web
</Text>
{Platform.OS === 'ios' ? (
<Text
adjustsFontSizeToFit
style={{
flex: 1,
height: 32,
fontFamily,
fontSize: 420,
}}>
Custom font with `adjustsFontSizeToFit` on iOS
</Text>
) : null}
</View>
</ScrollView>
);
}
}
| import React from 'react';
import { Platform, ScrollView, Text, View } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
export default class FontScreen extends React.Component {
static navigationOptions = {
title: 'Font',
};
render() {
return (
<ScrollView style={{ flex: 1 }}>
<View
style={{
paddingVertical: 10,
paddingHorizontal: 15,
flexDirection: 'row',
justifyContent: 'space-between',
flex: 1,
}}>
<MaterialIcons name="airplay" size={25} />
<MaterialIcons name="airport-shuttle" size={25} />
<MaterialIcons name="alarm" size={25} />
<MaterialIcons name="alarm-add" size={25} />
<MaterialIcons name="alarm-off" size={25} />
<MaterialIcons name="all-inclusive" size={25} />
</View>
<View style={{ paddingVertical: 10, paddingHorizontal: 15 }}>
<Text style={{ fontFamily: 'space-mono', fontSize: 16 }}>
Font icons sets and other custom fonts can be loaded from the web
</Text>
{Platform.OS === 'ios' ? (
<Text
adjustsFontSizeToFit
style={{
flex: 1,
height: 32,
fontFamily: 'space-mono',
fontSize: 420,
}}>
Custom font with `adjustsFontSizeToFit` on iOS
</Text>
) : null}
</View>
</ScrollView>
);
}
}
| Revert "[ncl] fix Font examples" | Revert "[ncl] fix Font examples"
This reverts commit 7af688afaac71c74de68b5ab42aed38f0196fd0d.
fbshipit-source-id: b91e873
| JavaScript | bsd-3-clause | exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent | javascript | ## Code Before:
import React from 'react';
import { Platform, ScrollView, Text, View } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
export default class FontScreen extends React.Component {
static navigationOptions = {
title: 'Font',
};
render() {
const fontFamily = Platform.OS === 'ios' ? 'Menlo' : 'monospace';
return (
<ScrollView style={{ flex: 1 }}>
<View
style={{
paddingVertical: 10,
paddingHorizontal: 15,
flexDirection: 'row',
justifyContent: 'space-between',
flex: 1,
}}>
<MaterialIcons name="airplay" size={25} />
<MaterialIcons name="airport-shuttle" size={25} />
<MaterialIcons name="alarm" size={25} />
<MaterialIcons name="alarm-add" size={25} />
<MaterialIcons name="alarm-off" size={25} />
<MaterialIcons name="all-inclusive" size={25} />
</View>
<View style={{ paddingVertical: 10, paddingHorizontal: 15 }}>
<Text style={{ fontFamily, fontSize: 16 }}>
Font icons sets and other custom fonts can be loaded from the web
</Text>
{Platform.OS === 'ios' ? (
<Text
adjustsFontSizeToFit
style={{
flex: 1,
height: 32,
fontFamily,
fontSize: 420,
}}>
Custom font with `adjustsFontSizeToFit` on iOS
</Text>
) : null}
</View>
</ScrollView>
);
}
}
## Instruction:
Revert "[ncl] fix Font examples"
This reverts commit 7af688afaac71c74de68b5ab42aed38f0196fd0d.
fbshipit-source-id: b91e873
## Code After:
import React from 'react';
import { Platform, ScrollView, Text, View } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
export default class FontScreen extends React.Component {
static navigationOptions = {
title: 'Font',
};
render() {
return (
<ScrollView style={{ flex: 1 }}>
<View
style={{
paddingVertical: 10,
paddingHorizontal: 15,
flexDirection: 'row',
justifyContent: 'space-between',
flex: 1,
}}>
<MaterialIcons name="airplay" size={25} />
<MaterialIcons name="airport-shuttle" size={25} />
<MaterialIcons name="alarm" size={25} />
<MaterialIcons name="alarm-add" size={25} />
<MaterialIcons name="alarm-off" size={25} />
<MaterialIcons name="all-inclusive" size={25} />
</View>
<View style={{ paddingVertical: 10, paddingHorizontal: 15 }}>
<Text style={{ fontFamily: 'space-mono', fontSize: 16 }}>
Font icons sets and other custom fonts can be loaded from the web
</Text>
{Platform.OS === 'ios' ? (
<Text
adjustsFontSizeToFit
style={{
flex: 1,
height: 32,
fontFamily: 'space-mono',
fontSize: 420,
}}>
Custom font with `adjustsFontSizeToFit` on iOS
</Text>
) : null}
</View>
</ScrollView>
);
}
}
| import React from 'react';
import { Platform, ScrollView, Text, View } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
export default class FontScreen extends React.Component {
static navigationOptions = {
title: 'Font',
};
render() {
- const fontFamily = Platform.OS === 'ios' ? 'Menlo' : 'monospace';
-
return (
<ScrollView style={{ flex: 1 }}>
<View
style={{
paddingVertical: 10,
paddingHorizontal: 15,
flexDirection: 'row',
justifyContent: 'space-between',
flex: 1,
}}>
<MaterialIcons name="airplay" size={25} />
<MaterialIcons name="airport-shuttle" size={25} />
<MaterialIcons name="alarm" size={25} />
<MaterialIcons name="alarm-add" size={25} />
<MaterialIcons name="alarm-off" size={25} />
<MaterialIcons name="all-inclusive" size={25} />
</View>
<View style={{ paddingVertical: 10, paddingHorizontal: 15 }}>
- <Text style={{ fontFamily, fontSize: 16 }}>
+ <Text style={{ fontFamily: 'space-mono', fontSize: 16 }}>
? ++++++++++++++
Font icons sets and other custom fonts can be loaded from the web
</Text>
{Platform.OS === 'ios' ? (
<Text
adjustsFontSizeToFit
style={{
flex: 1,
height: 32,
- fontFamily,
+ fontFamily: 'space-mono',
? ++++++++++++++
fontSize: 420,
}}>
Custom font with `adjustsFontSizeToFit` on iOS
</Text>
) : null}
</View>
</ScrollView>
);
}
} | 6 | 0.117647 | 2 | 4 |
6a35065cf09001d5853e0a88d4c2a7219e037539 | app/views/layouts/mailer.html.erb | app/views/layouts/mailer.html.erb | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<%= Rails.env == "production" ? File.read(Rails.root.join("public" + ActionController::Base.helpers.asset_path("hackathon_manager/mailer.css"))).html_safe : Rails.application.assets["hackathon_manager/mailer"].to_s.html_safe %>
</style>
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<div id="content">
<!--head-->
<%= image_tag 'email_banner.jpg', class: 'banner' %>
<!--content-->
<div id="main-content">
<%= yield %>
</div>
<!--footer-->
<div class="email-footer">
<table border="0" >
<tr>
<td>
<span>
<%= link_to Rails.configuration.hackathon['name'], 'https://brickhack.io' %>
</span>
<span>
<%= link_to 'Facebook', 'https://www.facebook.com/brickhackrit' %>
</span>
<span>
<%= link_to 'Twitter', 'https://twitter.com/brickhackrit' %>
</span>
</td>
<td>
<span>
<%= link_to 'http://coderit.org', class: 'nodecor' do %>
Student run by <img class="coderit-logo" src="<%= image_url('coderit_logo.png') %>" />
<% end %>
</span>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<%= Rails.env == "production" ? File.read(Rails.root.join("public" + ActionController::Base.helpers.asset_path("hackathon_manager/mailer.css"))).html_safe : Rails.application.assets["hackathon_manager/mailer"].to_s.html_safe %>
</style>
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<div id="content">
<!--head-->
<%= image_tag 'email_banner.jpg', class: 'banner' %>
<!--content-->
<div id="main-content">
<%= yield %>
</div>
</div>
</body>
</html>
| Remove codeRIT footer from default email template | Remove codeRIT footer from default email template
| HTML+ERB | mit | codeRIT/hackathon_manager,codeRIT/hackathon_manager,codeRIT/hackathon_manager | html+erb | ## Code Before:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<%= Rails.env == "production" ? File.read(Rails.root.join("public" + ActionController::Base.helpers.asset_path("hackathon_manager/mailer.css"))).html_safe : Rails.application.assets["hackathon_manager/mailer"].to_s.html_safe %>
</style>
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<div id="content">
<!--head-->
<%= image_tag 'email_banner.jpg', class: 'banner' %>
<!--content-->
<div id="main-content">
<%= yield %>
</div>
<!--footer-->
<div class="email-footer">
<table border="0" >
<tr>
<td>
<span>
<%= link_to Rails.configuration.hackathon['name'], 'https://brickhack.io' %>
</span>
<span>
<%= link_to 'Facebook', 'https://www.facebook.com/brickhackrit' %>
</span>
<span>
<%= link_to 'Twitter', 'https://twitter.com/brickhackrit' %>
</span>
</td>
<td>
<span>
<%= link_to 'http://coderit.org', class: 'nodecor' do %>
Student run by <img class="coderit-logo" src="<%= image_url('coderit_logo.png') %>" />
<% end %>
</span>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
## Instruction:
Remove codeRIT footer from default email template
## Code After:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<%= Rails.env == "production" ? File.read(Rails.root.join("public" + ActionController::Base.helpers.asset_path("hackathon_manager/mailer.css"))).html_safe : Rails.application.assets["hackathon_manager/mailer"].to_s.html_safe %>
</style>
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<div id="content">
<!--head-->
<%= image_tag 'email_banner.jpg', class: 'banner' %>
<!--content-->
<div id="main-content">
<%= yield %>
</div>
</div>
</body>
</html>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<%= Rails.env == "production" ? File.read(Rails.root.join("public" + ActionController::Base.helpers.asset_path("hackathon_manager/mailer.css"))).html_safe : Rails.application.assets["hackathon_manager/mailer"].to_s.html_safe %>
</style>
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<div id="content">
<!--head-->
<%= image_tag 'email_banner.jpg', class: 'banner' %>
<!--content-->
<div id="main-content">
<%= yield %>
</div>
-
- <!--footer-->
- <div class="email-footer">
- <table border="0" >
- <tr>
- <td>
- <span>
- <%= link_to Rails.configuration.hackathon['name'], 'https://brickhack.io' %>
- </span>
- <span>
- <%= link_to 'Facebook', 'https://www.facebook.com/brickhackrit' %>
- </span>
- <span>
- <%= link_to 'Twitter', 'https://twitter.com/brickhackrit' %>
- </span>
- </td>
- <td>
- <span>
- <%= link_to 'http://coderit.org', class: 'nodecor' do %>
- Student run by <img class="coderit-logo" src="<%= image_url('coderit_logo.png') %>" />
- <% end %>
- </span>
- </td>
- </tr>
- </table>
- </div>
</div>
</body>
</html> | 26 | 0.509804 | 0 | 26 |
9b89c1514404711342d1ddbb9181007f0a69d534 | lib/pausescreen.rb | lib/pausescreen.rb | class PauseScreen
def initialize(window, window_width, window_height)
@pause_button = Gosu::Image.new(window, 'media/pause_button.png', true)
@window_width, @window_height = window_width, window_height
@window = window
end
end
| class PauseScreen
def initialize(window, window_width, window_height)
@pause_button = Gosu::Image.new(window, 'media/pause_button.png', true)
@window_width, @window_height = window_width, window_height
@window = window
end
def draw
draw_rect(@window_width, @window_height, Pokeconstants::Trans_black,
ZOrder::Pause_background)
end
def draw_rect(width, height, color, z_order)
# Draws a rectangle by coordinates clockwise from top-left
@window.draw_quad(0, 0, color, width, 0, color,
width, height, color, 0, height, color,
z_order, :default)
end
end
| Add draw_rect method and use it in PauseScreen.draw | Add draw_rect method and use it in PauseScreen.draw
| Ruby | mit | mybuddymichael/poke | ruby | ## Code Before:
class PauseScreen
def initialize(window, window_width, window_height)
@pause_button = Gosu::Image.new(window, 'media/pause_button.png', true)
@window_width, @window_height = window_width, window_height
@window = window
end
end
## Instruction:
Add draw_rect method and use it in PauseScreen.draw
## Code After:
class PauseScreen
def initialize(window, window_width, window_height)
@pause_button = Gosu::Image.new(window, 'media/pause_button.png', true)
@window_width, @window_height = window_width, window_height
@window = window
end
def draw
draw_rect(@window_width, @window_height, Pokeconstants::Trans_black,
ZOrder::Pause_background)
end
def draw_rect(width, height, color, z_order)
# Draws a rectangle by coordinates clockwise from top-left
@window.draw_quad(0, 0, color, width, 0, color,
width, height, color, 0, height, color,
z_order, :default)
end
end
| class PauseScreen
def initialize(window, window_width, window_height)
@pause_button = Gosu::Image.new(window, 'media/pause_button.png', true)
@window_width, @window_height = window_width, window_height
@window = window
end
+ def draw
+ draw_rect(@window_width, @window_height, Pokeconstants::Trans_black,
+ ZOrder::Pause_background)
+ end
+
+ def draw_rect(width, height, color, z_order)
+ # Draws a rectangle by coordinates clockwise from top-left
+ @window.draw_quad(0, 0, color, width, 0, color,
+ width, height, color, 0, height, color,
+ z_order, :default)
+ end
+
end | 12 | 1.333333 | 12 | 0 |
dcbdbc9ebfacea35659fd49b18f15da975254064 | README.md | README.md |
```bindings``` is a Ruby gem that allows the bindings of calling methods to be accessed without a C extension. It does this by using ```fiddle```, Ruby's built-in support for accessing native C methods. Using this gem, you can easily access variables from calling methods, which makes it very easy to implement templating system or other utilities that need similar access.
## Usage
To access variables or other attributes of calling methods, just call ```binding.of_caller(n)``` where ```n``` is a number that represents how many callers back you are requesting.
## Example
```ruby
outer = 40
class A
def a
a = 30
B.new.b
end
end
class B
def b
b = 20
C.new.c
end
end
class C
def c
c = 10
puts binding.of_caller(0).eval('local_variables') # c
puts binding.of_caller(1).eval('local_variables') # b
puts binding.of_caller(2).eval('local_variables') # a
puts binding.of_caller(3).eval('local_variables') # outer
puts binding.of_caller(9).eval('local_variables') rescue puts($!)
end
end
A.new.a
```
## Result
```
c
b
a
outer
No such frame, gone beyond end of stack!
```
## License
This software is licensed under terms of the MIT License.
|
```bindings``` is a Ruby gem that allows the bindings of calling methods to be accessed. Using this gem, you can easily access variables from calling methods, which makes it very easy to implement templating system or other utilities that need similar access.
## Usage
To access variables or other attributes of calling methods, just call ```Binding.of_caller(n)``` where ```n``` is a number that represents how many callers back you are requesting.
## Example
```ruby
outer = 40
class A
def a
a = 30
B.new.b
end
end
class B
def b
b = 20
C.new.c
end
end
class C
def c
c = 10
puts Binding.of_caller(0).eval('local_variables') # c
puts Binding.of_caller(1).eval('local_variables') # b
puts Binding.of_caller(2).eval('local_variables') # a
puts Binding.of_caller(3).eval('local_variables') # outer
puts Binding.of_caller(9).eval('local_variables') rescue puts($!)
end
end
A.new.a
```
## Result
```
c
b
a
outer
no such frame
```
## License
This software is licensed under terms of the MIT License.
| Remove references to fiddle, since this is now C | Remove references to fiddle, since this is now C | Markdown | mit | shreeve/bindings,shreeve/bindings | markdown | ## Code Before:
```bindings``` is a Ruby gem that allows the bindings of calling methods to be accessed without a C extension. It does this by using ```fiddle```, Ruby's built-in support for accessing native C methods. Using this gem, you can easily access variables from calling methods, which makes it very easy to implement templating system or other utilities that need similar access.
## Usage
To access variables or other attributes of calling methods, just call ```binding.of_caller(n)``` where ```n``` is a number that represents how many callers back you are requesting.
## Example
```ruby
outer = 40
class A
def a
a = 30
B.new.b
end
end
class B
def b
b = 20
C.new.c
end
end
class C
def c
c = 10
puts binding.of_caller(0).eval('local_variables') # c
puts binding.of_caller(1).eval('local_variables') # b
puts binding.of_caller(2).eval('local_variables') # a
puts binding.of_caller(3).eval('local_variables') # outer
puts binding.of_caller(9).eval('local_variables') rescue puts($!)
end
end
A.new.a
```
## Result
```
c
b
a
outer
No such frame, gone beyond end of stack!
```
## License
This software is licensed under terms of the MIT License.
## Instruction:
Remove references to fiddle, since this is now C
## Code After:
```bindings``` is a Ruby gem that allows the bindings of calling methods to be accessed. Using this gem, you can easily access variables from calling methods, which makes it very easy to implement templating system or other utilities that need similar access.
## Usage
To access variables or other attributes of calling methods, just call ```Binding.of_caller(n)``` where ```n``` is a number that represents how many callers back you are requesting.
## Example
```ruby
outer = 40
class A
def a
a = 30
B.new.b
end
end
class B
def b
b = 20
C.new.c
end
end
class C
def c
c = 10
puts Binding.of_caller(0).eval('local_variables') # c
puts Binding.of_caller(1).eval('local_variables') # b
puts Binding.of_caller(2).eval('local_variables') # a
puts Binding.of_caller(3).eval('local_variables') # outer
puts Binding.of_caller(9).eval('local_variables') rescue puts($!)
end
end
A.new.a
```
## Result
```
c
b
a
outer
no such frame
```
## License
This software is licensed under terms of the MIT License.
|
- ```bindings``` is a Ruby gem that allows the bindings of calling methods to be accessed without a C extension. It does this by using ```fiddle```, Ruby's built-in support for accessing native C methods. Using this gem, you can easily access variables from calling methods, which makes it very easy to implement templating system or other utilities that need similar access.
+ ```bindings``` is a Ruby gem that allows the bindings of calling methods to be accessed. Using this gem, you can easily access variables from calling methods, which makes it very easy to implement templating system or other utilities that need similar access.
## Usage
- To access variables or other attributes of calling methods, just call ```binding.of_caller(n)``` where ```n``` is a number that represents how many callers back you are requesting.
? ^
+ To access variables or other attributes of calling methods, just call ```Binding.of_caller(n)``` where ```n``` is a number that represents how many callers back you are requesting.
? ^
## Example
```ruby
outer = 40
class A
def a
a = 30
B.new.b
end
end
class B
def b
b = 20
C.new.c
end
end
class C
def c
c = 10
- puts binding.of_caller(0).eval('local_variables') # c
? ^
+ puts Binding.of_caller(0).eval('local_variables') # c
? ^
- puts binding.of_caller(1).eval('local_variables') # b
? ^
+ puts Binding.of_caller(1).eval('local_variables') # b
? ^
- puts binding.of_caller(2).eval('local_variables') # a
? ^
+ puts Binding.of_caller(2).eval('local_variables') # a
? ^
- puts binding.of_caller(3).eval('local_variables') # outer
? ^
+ puts Binding.of_caller(3).eval('local_variables') # outer
? ^
- puts binding.of_caller(9).eval('local_variables') rescue puts($!)
? ^
+ puts Binding.of_caller(9).eval('local_variables') rescue puts($!)
? ^
end
end
A.new.a
```
## Result
```
c
b
a
outer
- No such frame, gone beyond end of stack!
+ no such frame
```
## License
This software is licensed under terms of the MIT License. | 16 | 0.301887 | 8 | 8 |
273a3770eb2085336d65a2584b5d792a3493016c | pkg/stripper/comments_example_test.go | pkg/stripper/comments_example_test.go | package stripper_test
import (
"io"
"os"
"strings"
"github.com/docker-library/go-dockerlibrary/pkg/stripper"
)
func ExampleCommentStripper() {
r := strings.NewReader(`
# opening comment
a: b
# comment!
c: d # not a comment
# another cheeky comment
e: f
`)
comStrip := stripper.NewCommentStripper(r)
io.Copy(os.Stdout, comStrip)
// Output:
// a: b
// c: d # not a comment
//
// e: f
}
| package stripper_test
import (
"io"
"os"
"strings"
"github.com/docker-library/go-dockerlibrary/pkg/stripper"
)
func ExampleCommentStripper() {
r := strings.NewReader(`
# opening comment
a: b
# comment!
c: d # not a comment
# another cheeky comment
e: f
`)
comStrip := stripper.NewCommentStripper(r)
// using CopyBuffer to force smaller Read sizes (better testing coverage that way)
io.CopyBuffer(os.Stdout, comStrip, make([]byte, 32))
// Output:
// a: b
// c: d # not a comment
//
// e: f
}
| Update "pkg/stripper" coverage to 100% with a smaller buffer size | Update "pkg/stripper" coverage to 100% with a smaller buffer size
| Go | apache-2.0 | docker-library/go-dockerlibrary | go | ## Code Before:
package stripper_test
import (
"io"
"os"
"strings"
"github.com/docker-library/go-dockerlibrary/pkg/stripper"
)
func ExampleCommentStripper() {
r := strings.NewReader(`
# opening comment
a: b
# comment!
c: d # not a comment
# another cheeky comment
e: f
`)
comStrip := stripper.NewCommentStripper(r)
io.Copy(os.Stdout, comStrip)
// Output:
// a: b
// c: d # not a comment
//
// e: f
}
## Instruction:
Update "pkg/stripper" coverage to 100% with a smaller buffer size
## Code After:
package stripper_test
import (
"io"
"os"
"strings"
"github.com/docker-library/go-dockerlibrary/pkg/stripper"
)
func ExampleCommentStripper() {
r := strings.NewReader(`
# opening comment
a: b
# comment!
c: d # not a comment
# another cheeky comment
e: f
`)
comStrip := stripper.NewCommentStripper(r)
// using CopyBuffer to force smaller Read sizes (better testing coverage that way)
io.CopyBuffer(os.Stdout, comStrip, make([]byte, 32))
// Output:
// a: b
// c: d # not a comment
//
// e: f
}
| package stripper_test
import (
"io"
"os"
"strings"
"github.com/docker-library/go-dockerlibrary/pkg/stripper"
)
func ExampleCommentStripper() {
r := strings.NewReader(`
# opening comment
a: b
# comment!
c: d # not a comment
# another cheeky comment
e: f
`)
comStrip := stripper.NewCommentStripper(r)
- io.Copy(os.Stdout, comStrip)
+ // using CopyBuffer to force smaller Read sizes (better testing coverage that way)
+ io.CopyBuffer(os.Stdout, comStrip, make([]byte, 32))
// Output:
// a: b
// c: d # not a comment
//
// e: f
} | 3 | 0.096774 | 2 | 1 |
6e6aa02907b3d156174cfe1a5f8e9c274c080778 | SegNetCMR/helpers.py | SegNetCMR/helpers.py | import tensorflow as tf
def add_output_images(images, logits, labels):
cast_labels = tf.cast(labels, tf.uint8) * 128
cast_labels = cast_labels[...,None]
tf.summary.image('input_labels', cast_labels, max_outputs=3)
classification1 = tf.nn.softmax(logits = logits, dim=-1)[...,1]
output_image_gb = images[...,0]
output_image_r = classification1 + tf.multiply(images[...,0], (1-classification1))
output_image = tf.stack([output_image_r, output_image_gb, output_image_gb], axis=3)
tf.summary.image('output_mixed', output_image, max_outputs=3)
output_image_binary = tf.argmax(logits, 3)
output_image_binary = tf.cast(output_image_binary[...,None], tf.float32) * 128/255
tf.summary.image('output_labels', output_image_binary, max_outputs=3)
return
| import tensorflow as tf
def add_output_images(images, logits, labels):
cast_labels = tf.cast(labels, tf.uint8) * 128
cast_labels = cast_labels[...,None]
tf.summary.image('input_labels', cast_labels, max_outputs=3)
classification1 = tf.nn.softmax(logits = logits, dim=-1)[...,1]
output_image_gb = images[...,0]
output_image_r = classification1 + tf.multiply(images[...,0], (1-classification1))
output_image = tf.stack([output_image_r, output_image_gb, output_image_gb], axis=3)
tf.summary.image('output_mixed', output_image, max_outputs=3)
output_image_binary = tf.argmax(logits, 3)
output_image_binary = tf.cast(output_image_binary[...,None], tf.float32) * 128/255
tf.summary.image('output_labels', output_image_binary, max_outputs=3)
output_labels_mixed_r = output_image_binary[...,0] + tf.multiply(images[...,0], (1-output_image_binary[...,0]))
output_labels_mixed = tf.stack([output_labels_mixed_r, output_image_gb, output_image_gb], axis=3)
tf.summary.image('output_labels_mixed', output_labels_mixed, max_outputs=3)
return
| Add output with images mixed with binary version of output labels | Add output with images mixed with binary version of output labels
| Python | mit | mshunshin/SegNetCMR,mshunshin/SegNetCMR | python | ## Code Before:
import tensorflow as tf
def add_output_images(images, logits, labels):
cast_labels = tf.cast(labels, tf.uint8) * 128
cast_labels = cast_labels[...,None]
tf.summary.image('input_labels', cast_labels, max_outputs=3)
classification1 = tf.nn.softmax(logits = logits, dim=-1)[...,1]
output_image_gb = images[...,0]
output_image_r = classification1 + tf.multiply(images[...,0], (1-classification1))
output_image = tf.stack([output_image_r, output_image_gb, output_image_gb], axis=3)
tf.summary.image('output_mixed', output_image, max_outputs=3)
output_image_binary = tf.argmax(logits, 3)
output_image_binary = tf.cast(output_image_binary[...,None], tf.float32) * 128/255
tf.summary.image('output_labels', output_image_binary, max_outputs=3)
return
## Instruction:
Add output with images mixed with binary version of output labels
## Code After:
import tensorflow as tf
def add_output_images(images, logits, labels):
cast_labels = tf.cast(labels, tf.uint8) * 128
cast_labels = cast_labels[...,None]
tf.summary.image('input_labels', cast_labels, max_outputs=3)
classification1 = tf.nn.softmax(logits = logits, dim=-1)[...,1]
output_image_gb = images[...,0]
output_image_r = classification1 + tf.multiply(images[...,0], (1-classification1))
output_image = tf.stack([output_image_r, output_image_gb, output_image_gb], axis=3)
tf.summary.image('output_mixed', output_image, max_outputs=3)
output_image_binary = tf.argmax(logits, 3)
output_image_binary = tf.cast(output_image_binary[...,None], tf.float32) * 128/255
tf.summary.image('output_labels', output_image_binary, max_outputs=3)
output_labels_mixed_r = output_image_binary[...,0] + tf.multiply(images[...,0], (1-output_image_binary[...,0]))
output_labels_mixed = tf.stack([output_labels_mixed_r, output_image_gb, output_image_gb], axis=3)
tf.summary.image('output_labels_mixed', output_labels_mixed, max_outputs=3)
return
| import tensorflow as tf
def add_output_images(images, logits, labels):
cast_labels = tf.cast(labels, tf.uint8) * 128
cast_labels = cast_labels[...,None]
tf.summary.image('input_labels', cast_labels, max_outputs=3)
classification1 = tf.nn.softmax(logits = logits, dim=-1)[...,1]
output_image_gb = images[...,0]
output_image_r = classification1 + tf.multiply(images[...,0], (1-classification1))
output_image = tf.stack([output_image_r, output_image_gb, output_image_gb], axis=3)
tf.summary.image('output_mixed', output_image, max_outputs=3)
output_image_binary = tf.argmax(logits, 3)
output_image_binary = tf.cast(output_image_binary[...,None], tf.float32) * 128/255
tf.summary.image('output_labels', output_image_binary, max_outputs=3)
+ output_labels_mixed_r = output_image_binary[...,0] + tf.multiply(images[...,0], (1-output_image_binary[...,0]))
+ output_labels_mixed = tf.stack([output_labels_mixed_r, output_image_gb, output_image_gb], axis=3)
+ tf.summary.image('output_labels_mixed', output_labels_mixed, max_outputs=3)
+
return
| 4 | 0.210526 | 4 | 0 |
aed2398336166de6076ab96cb57310ddf82dd934 | modules/search/client/views/search-sidebar-filters.client.view.html | modules/search/client/views/search-sidebar-filters.client.view.html | <div class="search-sidebar-section search-sidebar-filters">
<!-- Offer type filter -->
<div role="group" aria-label="Hosts or people to meet?">
<h4>Hosts or people to meet?</h4>
<div tr-types-toggle="search.filters.types"></div>
</div>
<!-- /Offer type filter -->
<br><br>
<!-- Tribes type filter -->
<div role="group" aria-label="Filter by tribes">
<div class="row">
<div class="col-xs-6">
<h4>Filter by tribes</h4>
</div>
<div class="col-xs-6 text-right">
<button type="button"
class="btn btn-default search-sidebar-filters-clear"
ng-click="search.filters.tribes = [];"
ng-disabled="!search.filters.tribes.length">
All tribes
</button>
</div>
</div>
<div tr-my-tribes-toggle="search.filters.tribes"></div>
<div tr-tribes-toggle="search.filters.tribes"></div>
</div>
<!-- Tribes type filter -->
<!-- Sidebar closing toggle for small screens -->
<button type="button"
class="btn btn-action btn-primary visible-xs-block search-sidebar-close"
ng-click="search.toggleSidebar()">
Back to map
</button>
</div>
| <div class="search-sidebar-section search-sidebar-filters">
<!-- Offer type filter -->
<div role="group" aria-label="Hosts or people to meet?">
<h4>Hosts or people to meet?</h4>
<div tr-types-toggle="search.filters.types"></div>
</div>
<!-- /Offer type filter -->
<!-- Tribes type filter -->
<div role="group" aria-label="Filter by tribes">
<div class="row">
<div class="col-xs-6">
<h4>Filter by tribes</h4>
</div>
<div class="col-xs-6 text-right">
<button type="button"
class="btn btn-default search-sidebar-filters-clear"
ng-click="search.filters.tribes = [];"
ng-disabled="!search.filters.tribes.length">
All tribes
</button>
</div>
</div>
<div tr-my-tribes-toggle="search.filters.tribes"></div>
<div tr-tribes-toggle="search.filters.tribes"></div>
</div>
<!-- Tribes type filter -->
<!-- Sidebar closing toggle for small screens -->
<button type="button"
class="btn btn-action btn-primary visible-xs-block search-sidebar-close"
ng-click="search.toggleSidebar()">
Back to map
</button>
</div>
| Remove extra space from filters sidebar | Remove extra space from filters sidebar
| HTML | agpl-3.0 | Trustroots/trustroots,Trustroots/trustroots,Trustroots/trustroots,Trustroots/trustroots | html | ## Code Before:
<div class="search-sidebar-section search-sidebar-filters">
<!-- Offer type filter -->
<div role="group" aria-label="Hosts or people to meet?">
<h4>Hosts or people to meet?</h4>
<div tr-types-toggle="search.filters.types"></div>
</div>
<!-- /Offer type filter -->
<br><br>
<!-- Tribes type filter -->
<div role="group" aria-label="Filter by tribes">
<div class="row">
<div class="col-xs-6">
<h4>Filter by tribes</h4>
</div>
<div class="col-xs-6 text-right">
<button type="button"
class="btn btn-default search-sidebar-filters-clear"
ng-click="search.filters.tribes = [];"
ng-disabled="!search.filters.tribes.length">
All tribes
</button>
</div>
</div>
<div tr-my-tribes-toggle="search.filters.tribes"></div>
<div tr-tribes-toggle="search.filters.tribes"></div>
</div>
<!-- Tribes type filter -->
<!-- Sidebar closing toggle for small screens -->
<button type="button"
class="btn btn-action btn-primary visible-xs-block search-sidebar-close"
ng-click="search.toggleSidebar()">
Back to map
</button>
</div>
## Instruction:
Remove extra space from filters sidebar
## Code After:
<div class="search-sidebar-section search-sidebar-filters">
<!-- Offer type filter -->
<div role="group" aria-label="Hosts or people to meet?">
<h4>Hosts or people to meet?</h4>
<div tr-types-toggle="search.filters.types"></div>
</div>
<!-- /Offer type filter -->
<!-- Tribes type filter -->
<div role="group" aria-label="Filter by tribes">
<div class="row">
<div class="col-xs-6">
<h4>Filter by tribes</h4>
</div>
<div class="col-xs-6 text-right">
<button type="button"
class="btn btn-default search-sidebar-filters-clear"
ng-click="search.filters.tribes = [];"
ng-disabled="!search.filters.tribes.length">
All tribes
</button>
</div>
</div>
<div tr-my-tribes-toggle="search.filters.tribes"></div>
<div tr-tribes-toggle="search.filters.tribes"></div>
</div>
<!-- Tribes type filter -->
<!-- Sidebar closing toggle for small screens -->
<button type="button"
class="btn btn-action btn-primary visible-xs-block search-sidebar-close"
ng-click="search.toggleSidebar()">
Back to map
</button>
</div>
| <div class="search-sidebar-section search-sidebar-filters">
<!-- Offer type filter -->
<div role="group" aria-label="Hosts or people to meet?">
<h4>Hosts or people to meet?</h4>
<div tr-types-toggle="search.filters.types"></div>
</div>
<!-- /Offer type filter -->
-
- <br><br>
<!-- Tribes type filter -->
<div role="group" aria-label="Filter by tribes">
<div class="row">
<div class="col-xs-6">
<h4>Filter by tribes</h4>
</div>
<div class="col-xs-6 text-right">
<button type="button"
class="btn btn-default search-sidebar-filters-clear"
ng-click="search.filters.tribes = [];"
ng-disabled="!search.filters.tribes.length">
All tribes
</button>
</div>
</div>
<div tr-my-tribes-toggle="search.filters.tribes"></div>
<div tr-tribes-toggle="search.filters.tribes"></div>
</div>
<!-- Tribes type filter -->
<!-- Sidebar closing toggle for small screens -->
<button type="button"
class="btn btn-action btn-primary visible-xs-block search-sidebar-close"
ng-click="search.toggleSidebar()">
Back to map
</button>
</div> | 2 | 0.05 | 0 | 2 |
bc77f307e5c2bd6eb23fa5c8c46f678e6fcc4888 | swig/perl/CMakeLists.txt | swig/perl/CMakeLists.txt | include(UseSWIG)
include(FindPerlLibs)
set(CMAKE_SWIG_FLAGS "-module" "openscap_pm")
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(openscap_pm perl5 ../openscap.i)
else()
swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i)
endif()
swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY})
target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH})
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w")
endif()
if (APPLE)
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl)
else()
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${PERL_VENDORLIB})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${PERL_VENDORARCH})
endif()
| include(UseSWIG)
include(FindPerlLibs)
set(CMAKE_SWIG_FLAGS "-module" "openscap_pm")
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(openscap_pm perl5 ../openscap.i)
else()
swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i)
endif()
swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY})
target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH})
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w")
endif()
if (APPLE OR (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"))
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl)
else()
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${PERL_VENDORLIB})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${PERL_VENDORARCH})
endif()
| Fix the build for FreeBSD. | Fix the build for FreeBSD.
Commit 69b9b1519 ("Changing hardcoded libperl path for FindPerlLibs
method") caused openscap to fail to build on FreeBSD with the
following errors:
CMake Error at swig/perl/CMakeLists.txt:22 (install):
install TARGETS given no LIBRARY DESTINATION for module target
"openscap_pm".
CMake Error at swig/perl/CMakeLists.txt:24 (install):
install PROGRAMS given no DESTINATION!
This is due to cmake on FreeBSD not defining PERL_VENDORLIB and
PERL_VENDORARCH. Correct this issue by including FreeBSD alongside
macOS in using the old hardcoded paths for now.
| Text | lgpl-2.1 | OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap | text | ## Code Before:
include(UseSWIG)
include(FindPerlLibs)
set(CMAKE_SWIG_FLAGS "-module" "openscap_pm")
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(openscap_pm perl5 ../openscap.i)
else()
swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i)
endif()
swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY})
target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH})
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w")
endif()
if (APPLE)
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl)
else()
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${PERL_VENDORLIB})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${PERL_VENDORARCH})
endif()
## Instruction:
Fix the build for FreeBSD.
Commit 69b9b1519 ("Changing hardcoded libperl path for FindPerlLibs
method") caused openscap to fail to build on FreeBSD with the
following errors:
CMake Error at swig/perl/CMakeLists.txt:22 (install):
install TARGETS given no LIBRARY DESTINATION for module target
"openscap_pm".
CMake Error at swig/perl/CMakeLists.txt:24 (install):
install PROGRAMS given no DESTINATION!
This is due to cmake on FreeBSD not defining PERL_VENDORLIB and
PERL_VENDORARCH. Correct this issue by including FreeBSD alongside
macOS in using the old hardcoded paths for now.
## Code After:
include(UseSWIG)
include(FindPerlLibs)
set(CMAKE_SWIG_FLAGS "-module" "openscap_pm")
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(openscap_pm perl5 ../openscap.i)
else()
swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i)
endif()
swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY})
target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH})
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w")
endif()
if (APPLE OR (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"))
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl)
else()
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${PERL_VENDORLIB})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${PERL_VENDORARCH})
endif()
| include(UseSWIG)
include(FindPerlLibs)
set(CMAKE_SWIG_FLAGS "-module" "openscap_pm")
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(openscap_pm perl5 ../openscap.i)
else()
swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i)
endif()
swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY})
target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH})
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w")
endif()
- if (APPLE)
+ if (APPLE OR (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"))
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl)
else()
install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME}
DESTINATION ${PERL_VENDORLIB})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm
DESTINATION ${PERL_VENDORARCH})
endif() | 2 | 0.076923 | 1 | 1 |
ac1fbe7c30a3439569511b875863eb7fdd2ce0c7 | package.json | package.json | {
"name": "arctic-web-map-pages",
"version": "1.0.0",
"description": "This repository contains the HTML, CSS, and JavaScript for the promotional site for Arctic Web Map.",
"main": "public/index.html",
"scripts": {
"start": "NODE_ENV=production node index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/GeoSensorWebLab/arctic-web-map-pages"
},
"author": "James Badger <jpbadger@ucalgary.ca>",
"license": "ISC",
"homepage": "https://github.com/GeoSensorWebLab/arctic-web-map-pages",
"dependencies": {
"harp": "*"
},
"engines": {
"node": "6.10.x"
}
}
| {
"name": "arctic-web-map-pages",
"version": "1.0.0",
"description": "This repository contains the HTML, CSS, and JavaScript for the promotional site for Arctic Web Map.",
"main": "public/index.html",
"scripts": {
"start": "NODE_ENV=production node index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/GeoSensorWebLab/arctic-web-map-pages"
},
"author": "James Badger <jpbadger@ucalgary.ca>",
"license": "ISC",
"homepage": "https://github.com/GeoSensorWebLab/arctic-web-map-pages",
"dependencies": {
"harp": "*"
},
"engines": {
"node": "6.10.x",
"npm": "^4.5.0"
}
}
| Upgrade to use NPM 4.5.0 | Upgrade to use NPM 4.5.0
| JSON | mit | GeoSensorWebLab/arctic-web-map-pages | json | ## Code Before:
{
"name": "arctic-web-map-pages",
"version": "1.0.0",
"description": "This repository contains the HTML, CSS, and JavaScript for the promotional site for Arctic Web Map.",
"main": "public/index.html",
"scripts": {
"start": "NODE_ENV=production node index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/GeoSensorWebLab/arctic-web-map-pages"
},
"author": "James Badger <jpbadger@ucalgary.ca>",
"license": "ISC",
"homepage": "https://github.com/GeoSensorWebLab/arctic-web-map-pages",
"dependencies": {
"harp": "*"
},
"engines": {
"node": "6.10.x"
}
}
## Instruction:
Upgrade to use NPM 4.5.0
## Code After:
{
"name": "arctic-web-map-pages",
"version": "1.0.0",
"description": "This repository contains the HTML, CSS, and JavaScript for the promotional site for Arctic Web Map.",
"main": "public/index.html",
"scripts": {
"start": "NODE_ENV=production node index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/GeoSensorWebLab/arctic-web-map-pages"
},
"author": "James Badger <jpbadger@ucalgary.ca>",
"license": "ISC",
"homepage": "https://github.com/GeoSensorWebLab/arctic-web-map-pages",
"dependencies": {
"harp": "*"
},
"engines": {
"node": "6.10.x",
"npm": "^4.5.0"
}
}
| {
"name": "arctic-web-map-pages",
"version": "1.0.0",
"description": "This repository contains the HTML, CSS, and JavaScript for the promotional site for Arctic Web Map.",
"main": "public/index.html",
"scripts": {
"start": "NODE_ENV=production node index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/GeoSensorWebLab/arctic-web-map-pages"
},
"author": "James Badger <jpbadger@ucalgary.ca>",
"license": "ISC",
"homepage": "https://github.com/GeoSensorWebLab/arctic-web-map-pages",
"dependencies": {
"harp": "*"
},
"engines": {
- "node": "6.10.x"
+ "node": "6.10.x",
? +
+ "npm": "^4.5.0"
}
} | 3 | 0.136364 | 2 | 1 |
c14f81623dc8959ebace503f62f289fc11b80fce | tests/__tests__/transpile-if-ts.spec.ts | tests/__tests__/transpile-if-ts.spec.ts | import { transpileIfTypescript } from '../../src';
describe('transpileIfTypescript', () => {
it('should ignore anything non-TS', () => {
const contents = 'unaltered';
expect(transpileIfTypescript('some.js', contents)).toBe(contents);
});
it('should be able to transpile some TS', () => {
const ts = 'const x:string = "anything";';
expect(transpileIfTypescript('some.ts', ts)).toMatch('var x = "anything";');
expect(transpileIfTypescript('some.tsx', ts)).toMatch('var x = "anything";');
});
it('should be possible to pass a custom config', () => {
const customTsConfigFile = 'not-existant.json';
const customConfig = { __TS_CONFIG__: customTsConfigFile};
expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
});
});
| import { transpileIfTypescript } from '../../src';
describe('transpileIfTypescript', () => {
it('should ignore anything non-TS', () => {
const contents = 'unaltered';
expect(transpileIfTypescript('some.js', contents)).toBe(contents);
});
it('should be able to transpile some TS', () => {
const ts = 'const x:string = "anything";';
expect(transpileIfTypescript('some.ts', ts)).toMatch('var x = "anything";');
expect(transpileIfTypescript('some.tsx', ts)).toMatch('var x = "anything";');
});
it('should be possible to pass a custom config (Deprecated)', () => {
const customTsConfigFile = 'not-existant.json';
const customConfig = { __TS_CONFIG__: customTsConfigFile };
expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
});
it('should be possible to pass a custom config', () => {
const customTsConfigFile = 'not-existant.json';
const customConfig = { 'ts-jest': { tsConfigFile: customTsConfigFile }};
expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
});
});
| Add new config schema tests | Add new config schema tests
| TypeScript | mit | kulshekhar/ts-jest,kulshekhar/ts-jest | typescript | ## Code Before:
import { transpileIfTypescript } from '../../src';
describe('transpileIfTypescript', () => {
it('should ignore anything non-TS', () => {
const contents = 'unaltered';
expect(transpileIfTypescript('some.js', contents)).toBe(contents);
});
it('should be able to transpile some TS', () => {
const ts = 'const x:string = "anything";';
expect(transpileIfTypescript('some.ts', ts)).toMatch('var x = "anything";');
expect(transpileIfTypescript('some.tsx', ts)).toMatch('var x = "anything";');
});
it('should be possible to pass a custom config', () => {
const customTsConfigFile = 'not-existant.json';
const customConfig = { __TS_CONFIG__: customTsConfigFile};
expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
});
});
## Instruction:
Add new config schema tests
## Code After:
import { transpileIfTypescript } from '../../src';
describe('transpileIfTypescript', () => {
it('should ignore anything non-TS', () => {
const contents = 'unaltered';
expect(transpileIfTypescript('some.js', contents)).toBe(contents);
});
it('should be able to transpile some TS', () => {
const ts = 'const x:string = "anything";';
expect(transpileIfTypescript('some.ts', ts)).toMatch('var x = "anything";');
expect(transpileIfTypescript('some.tsx', ts)).toMatch('var x = "anything";');
});
it('should be possible to pass a custom config (Deprecated)', () => {
const customTsConfigFile = 'not-existant.json';
const customConfig = { __TS_CONFIG__: customTsConfigFile };
expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
});
it('should be possible to pass a custom config', () => {
const customTsConfigFile = 'not-existant.json';
const customConfig = { 'ts-jest': { tsConfigFile: customTsConfigFile }};
expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
});
});
| import { transpileIfTypescript } from '../../src';
describe('transpileIfTypescript', () => {
it('should ignore anything non-TS', () => {
const contents = 'unaltered';
expect(transpileIfTypescript('some.js', contents)).toBe(contents);
});
it('should be able to transpile some TS', () => {
const ts = 'const x:string = "anything";';
expect(transpileIfTypescript('some.ts', ts)).toMatch('var x = "anything";');
expect(transpileIfTypescript('some.tsx', ts)).toMatch('var x = "anything";');
});
+ it('should be possible to pass a custom config (Deprecated)', () => {
+ const customTsConfigFile = 'not-existant.json';
+ const customConfig = { __TS_CONFIG__: customTsConfigFile };
+ expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
+ });
+
it('should be possible to pass a custom config', () => {
const customTsConfigFile = 'not-existant.json';
- const customConfig = { __TS_CONFIG__: customTsConfigFile};
? ^^^^^ ^^ ^^^^
+ const customConfig = { 'ts-jest': { tsConfigFile: customTsConfigFile }};
? ^^^^^^^^^^^^^^^ ^^^^^ ^^^ ++
expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
});
}); | 8 | 0.421053 | 7 | 1 |
bd71c2ca599bb35b6aec6a2801c5b303df139e49 | README.md | README.md |
Uploading Files To Amazon S3 Using Plupload And ColdFusion
by [Ben Nadel][1]
This is a look at how to use Plupload and ColdFusion to upload files directly
from the browser to Amazon Simple Storage Service (S3) without using the
ColdFusion browser as a proxy.
[1]: http://www.bennadel.com |
Uploading Files To Amazon S3 Using Plupload And ColdFusion
by [Ben Nadel][1]
This is a look at how to use Plupload and ColdFusion to upload files directly
from the browser to Amazon Simple Storage Service (S3) without using the
ColdFusion browser as a proxy.
See blog post: [Uploading files to Amazon S3 using Plupload and ColdFusion][2].
[1]: http://www.bennadel.com
[2]: http://www.bennadel.com/blog/2502-Uploading-Files-To-Amazon-S3-Using-Plupload-And-ColdFusion.htm | Update readme with blog post link. | Update readme with blog post link.
| Markdown | mit | bennadel/Plupload-S3-Demo,bennadel/Plupload-S3-Demo | markdown | ## Code Before:
Uploading Files To Amazon S3 Using Plupload And ColdFusion
by [Ben Nadel][1]
This is a look at how to use Plupload and ColdFusion to upload files directly
from the browser to Amazon Simple Storage Service (S3) without using the
ColdFusion browser as a proxy.
[1]: http://www.bennadel.com
## Instruction:
Update readme with blog post link.
## Code After:
Uploading Files To Amazon S3 Using Plupload And ColdFusion
by [Ben Nadel][1]
This is a look at how to use Plupload and ColdFusion to upload files directly
from the browser to Amazon Simple Storage Service (S3) without using the
ColdFusion browser as a proxy.
See blog post: [Uploading files to Amazon S3 using Plupload and ColdFusion][2].
[1]: http://www.bennadel.com
[2]: http://www.bennadel.com/blog/2502-Uploading-Files-To-Amazon-S3-Using-Plupload-And-ColdFusion.htm |
Uploading Files To Amazon S3 Using Plupload And ColdFusion
by [Ben Nadel][1]
This is a look at how to use Plupload and ColdFusion to upload files directly
from the browser to Amazon Simple Storage Service (S3) without using the
ColdFusion browser as a proxy.
+ See blog post: [Uploading files to Amazon S3 using Plupload and ColdFusion][2].
+
[1]: http://www.bennadel.com
+ [2]: http://www.bennadel.com/blog/2502-Uploading-Files-To-Amazon-S3-Using-Plupload-And-ColdFusion.htm | 3 | 0.272727 | 3 | 0 |
c029af1263a9322df8e6a8ed63fb1435ac15af51 | docs/source/recipes/how_to_customise_models.rst | docs/source/recipes/how_to_customise_models.rst | =======================
How to customise models
=======================
You must first create a local version of the app that you wish to customise. This
involves creating a local app with the same name and importing the equivalent models
from oscar into it.
Example
-------
Suppose you want to add a video_url field to the core product model. This means that
you want your application to use a subclass of ``oscar.apps.catalogue.models.Product`` which
has an additional field.
The first step is to create a local version of the "catalogue" app. At a minimum, this
involves creating ``catalogue/models.py`` within your project and changing ``INSTALLED_APPS``
to point to your local version rather than oscar's.
Next, you can modify the ``Product`` model through subclassing::
# yourproject/catalogue/models.py
from oscar.apps.catalogue.abstract_models import AbstractProduct
class Product(AbstractProduct):
video_url = models.URLField()
Now, running ``./manage.py syncdb`` will create the product model with your additional field
| =======================
How to customise models
=======================
You must first create a local version of the app that you wish to customise. This
involves creating a local app with the same name and importing the equivalent models
from oscar into it.
Example
-------
Suppose you want to add a video_url field to the core product model. This means that
you want your application to use a subclass of ``oscar.apps.catalogue.models.Product`` which
has an additional field.
The first step is to create a local version of the "catalogue" app. At a minimum, this
involves creating ``catalogue/models.py`` within your project and changing ``INSTALLED_APPS``
to point to your local version rather than oscar's.
Next, you can modify the ``Product`` model through subclassing::
# yourproject/catalogue/models.py
from django.db import models
from oscar.apps.catalogue.abstract_models import AbstractProduct
class Product(AbstractProduct):
video_url = models.URLField()
Now, running ``./manage.py syncdb`` will create the product model with your additional field
| Add missing import to sample code | Add missing import to sample code
Related to https://groups.google.com/forum/?fromgroups=#!topic/django-oscar/fscCRn4OlOg
| reStructuredText | bsd-3-clause | makielab/django-oscar,michaelkuty/django-oscar,taedori81/django-oscar,jinnykoo/wuyisj,WillisXChen/django-oscar,Jannes123/django-oscar,jinnykoo/wuyisj.com,WillisXChen/django-oscar,django-oscar/django-oscar,bnprk/django-oscar,ka7eh/django-oscar,ka7eh/django-oscar,vovanbo/django-oscar,anentropic/django-oscar,jinnykoo/wuyisj,jinnykoo/wuyisj.com,jinnykoo/wuyisj,WillisXChen/django-oscar,rocopartners/django-oscar,WillisXChen/django-oscar,faratro/django-oscar,pdonadeo/django-oscar,marcoantoniooliveira/labweb,mexeniz/django-oscar,lijoantony/django-oscar,nickpack/django-oscar,solarissmoke/django-oscar,bnprk/django-oscar,okfish/django-oscar,monikasulik/django-oscar,sonofatailor/django-oscar,mexeniz/django-oscar,mexeniz/django-oscar,elliotthill/django-oscar,pdonadeo/django-oscar,manevant/django-oscar,manevant/django-oscar,john-parton/django-oscar,Idematica/django-oscar,faratro/django-oscar,rocopartners/django-oscar,QLGu/django-oscar,nickpack/django-oscar,spartonia/django-oscar,makielab/django-oscar,itbabu/django-oscar,WadeYuChen/django-oscar,lijoantony/django-oscar,Jannes123/django-oscar,kapt/django-oscar,thechampanurag/django-oscar,anentropic/django-oscar,jmt4/django-oscar,ademuk/django-oscar,manevant/django-oscar,anentropic/django-oscar,Jannes123/django-oscar,binarydud/django-oscar,kapt/django-oscar,adamend/django-oscar,thechampanurag/django-oscar,spartonia/django-oscar,bschuon/django-oscar,anentropic/django-oscar,jlmadurga/django-oscar,jlmadurga/django-oscar,WadeYuChen/django-oscar,vovanbo/django-oscar,sonofatailor/django-oscar,nickpack/django-oscar,okfish/django-oscar,thechampanurag/django-oscar,eddiep1101/django-oscar,mexeniz/django-oscar,Bogh/django-oscar,marcoantoniooliveira/labweb,taedori81/django-oscar,Idematica/django-oscar,john-parton/django-oscar,django-oscar/django-oscar,QLGu/django-oscar,saadatqadri/django-oscar,pdonadeo/django-oscar,dongguangming/django-oscar,taedori81/django-oscar,kapari/django-oscar,kapt/django-oscar,itbabu/django-oscar,django-oscar/django-oscar,spartonia/django-oscar,ahmetdaglarbas/e-commerce,pdonadeo/django-oscar,faratro/django-oscar,QLGu/django-oscar,pasqualguerrero/django-oscar,manevant/django-oscar,saadatqadri/django-oscar,django-oscar/django-oscar,nfletton/django-oscar,itbabu/django-oscar,josesanch/django-oscar,kapari/django-oscar,WillisXChen/django-oscar,amirrpp/django-oscar,WadeYuChen/django-oscar,saadatqadri/django-oscar,dongguangming/django-oscar,spartonia/django-oscar,ka7eh/django-oscar,jlmadurga/django-oscar,makielab/django-oscar,nickpack/django-oscar,vovanbo/django-oscar,Bogh/django-oscar,makielab/django-oscar,john-parton/django-oscar,Bogh/django-oscar,MatthewWilkes/django-oscar,DrOctogon/unwash_ecom,okfish/django-oscar,eddiep1101/django-oscar,michaelkuty/django-oscar,eddiep1101/django-oscar,pasqualguerrero/django-oscar,nfletton/django-oscar,machtfit/django-oscar,machtfit/django-oscar,amirrpp/django-oscar,itbabu/django-oscar,ademuk/django-oscar,solarissmoke/django-oscar,adamend/django-oscar,john-parton/django-oscar,monikasulik/django-oscar,ademuk/django-oscar,bschuon/django-oscar,jinnykoo/christmas,jinnykoo/wuyisj.com,WillisXChen/django-oscar,solarissmoke/django-oscar,lijoantony/django-oscar,ka7eh/django-oscar,Idematica/django-oscar,marcoantoniooliveira/labweb,okfish/django-oscar,josesanch/django-oscar,MatthewWilkes/django-oscar,monikasulik/django-oscar,michaelkuty/django-oscar,bschuon/django-oscar,binarydud/django-oscar,nfletton/django-oscar,sonofatailor/django-oscar,dongguangming/django-oscar,bnprk/django-oscar,jinnykoo/wuyisj.com,jinnykoo/christmas,rocopartners/django-oscar,jmt4/django-oscar,taedori81/django-oscar,adamend/django-oscar,bnprk/django-oscar,ahmetdaglarbas/e-commerce,Jannes123/django-oscar,faratro/django-oscar,sasha0/django-oscar,jmt4/django-oscar,kapari/django-oscar,elliotthill/django-oscar,thechampanurag/django-oscar,vovanbo/django-oscar,sonofatailor/django-oscar,ahmetdaglarbas/e-commerce,kapari/django-oscar,MatthewWilkes/django-oscar,sasha0/django-oscar,pasqualguerrero/django-oscar,lijoantony/django-oscar,sasha0/django-oscar,monikasulik/django-oscar,jinnykoo/wuyisj,rocopartners/django-oscar,dongguangming/django-oscar,amirrpp/django-oscar,jlmadurga/django-oscar,ademuk/django-oscar,pasqualguerrero/django-oscar,sasha0/django-oscar,DrOctogon/unwash_ecom,binarydud/django-oscar,nfletton/django-oscar,josesanch/django-oscar,bschuon/django-oscar,WadeYuChen/django-oscar,michaelkuty/django-oscar,MatthewWilkes/django-oscar,ahmetdaglarbas/e-commerce,Bogh/django-oscar,binarydud/django-oscar,adamend/django-oscar,saadatqadri/django-oscar,jinnykoo/christmas,eddiep1101/django-oscar,machtfit/django-oscar,jmt4/django-oscar,amirrpp/django-oscar,solarissmoke/django-oscar,elliotthill/django-oscar,DrOctogon/unwash_ecom,QLGu/django-oscar,marcoantoniooliveira/labweb | restructuredtext | ## Code Before:
=======================
How to customise models
=======================
You must first create a local version of the app that you wish to customise. This
involves creating a local app with the same name and importing the equivalent models
from oscar into it.
Example
-------
Suppose you want to add a video_url field to the core product model. This means that
you want your application to use a subclass of ``oscar.apps.catalogue.models.Product`` which
has an additional field.
The first step is to create a local version of the "catalogue" app. At a minimum, this
involves creating ``catalogue/models.py`` within your project and changing ``INSTALLED_APPS``
to point to your local version rather than oscar's.
Next, you can modify the ``Product`` model through subclassing::
# yourproject/catalogue/models.py
from oscar.apps.catalogue.abstract_models import AbstractProduct
class Product(AbstractProduct):
video_url = models.URLField()
Now, running ``./manage.py syncdb`` will create the product model with your additional field
## Instruction:
Add missing import to sample code
Related to https://groups.google.com/forum/?fromgroups=#!topic/django-oscar/fscCRn4OlOg
## Code After:
=======================
How to customise models
=======================
You must first create a local version of the app that you wish to customise. This
involves creating a local app with the same name and importing the equivalent models
from oscar into it.
Example
-------
Suppose you want to add a video_url field to the core product model. This means that
you want your application to use a subclass of ``oscar.apps.catalogue.models.Product`` which
has an additional field.
The first step is to create a local version of the "catalogue" app. At a minimum, this
involves creating ``catalogue/models.py`` within your project and changing ``INSTALLED_APPS``
to point to your local version rather than oscar's.
Next, you can modify the ``Product`` model through subclassing::
# yourproject/catalogue/models.py
from django.db import models
from oscar.apps.catalogue.abstract_models import AbstractProduct
class Product(AbstractProduct):
video_url = models.URLField()
Now, running ``./manage.py syncdb`` will create the product model with your additional field
| =======================
How to customise models
=======================
You must first create a local version of the app that you wish to customise. This
involves creating a local app with the same name and importing the equivalent models
from oscar into it.
Example
-------
Suppose you want to add a video_url field to the core product model. This means that
you want your application to use a subclass of ``oscar.apps.catalogue.models.Product`` which
has an additional field.
The first step is to create a local version of the "catalogue" app. At a minimum, this
involves creating ``catalogue/models.py`` within your project and changing ``INSTALLED_APPS``
to point to your local version rather than oscar's.
Next, you can modify the ``Product`` model through subclassing::
# yourproject/catalogue/models.py
+ from django.db import models
+
from oscar.apps.catalogue.abstract_models import AbstractProduct
class Product(AbstractProduct):
video_url = models.URLField()
Now, running ``./manage.py syncdb`` will create the product model with your additional field
| 2 | 0.064516 | 2 | 0 |
6a08dfbc17b4666395276e96d73db1e30501a820 | .github/workflows/release-on-tag.yml | .github/workflows/release-on-tag.yml | name: Generate Release Notes
on:
push:
tags:
- v*
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.8.x'
- run: npm install github-release-notes -g
- name: Write PreRelease Notes
env:
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_EVENT_REF: ${{ github.event.ref }}
run: |
tagname="${GITHUB_EVENT_REF/refs\/tags\//}"
gren release --override -d --tags=$tagname | name: Generate Release Notes
on:
create:
tags:
- v*
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.8.x'
- run: npm install github-release-notes -g
- name: Write PreRelease Notes
env:
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gren release --override -d --tags=${{ github.event.ref }} | Resolve issue with gren when using "on: push" github event | Resolve issue with gren when using "on: push" github event
| YAML | mit | DonJayamanne/gitHistoryVSCode,DonJayamanne/gitHistoryVSCode | yaml | ## Code Before:
name: Generate Release Notes
on:
push:
tags:
- v*
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.8.x'
- run: npm install github-release-notes -g
- name: Write PreRelease Notes
env:
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_EVENT_REF: ${{ github.event.ref }}
run: |
tagname="${GITHUB_EVENT_REF/refs\/tags\//}"
gren release --override -d --tags=$tagname
## Instruction:
Resolve issue with gren when using "on: push" github event
## Code After:
name: Generate Release Notes
on:
create:
tags:
- v*
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.8.x'
- run: npm install github-release-notes -g
- name: Write PreRelease Notes
env:
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gren release --override -d --tags=${{ github.event.ref }} | name: Generate Release Notes
on:
- push:
+ create:
tags:
- v*
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.8.x'
- run: npm install github-release-notes -g
- name: Write PreRelease Notes
env:
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GITHUB_EVENT_REF: ${{ github.event.ref }}
- run: |
- tagname="${GITHUB_EVENT_REF/refs\/tags\//}"
- gren release --override -d --tags=$tagname
? ^ ^^ ^^
+ run: gren release --override -d --tags=${{ github.event.ref }}
? ^^^^ +++++ ^^^^^^^ ^^^ ++++
| 7 | 0.304348 | 2 | 5 |
431fb13564fa4919d1797ff7ba47895c41fa1bfe | _site.yml | _site.yml | name: "Podcast Stats"
output_dir: "_site"
navbar:
title: "Podcast Stats"
left:
- text: "Overview"
href: index.html
- text: "The Incomparable"
icon: fa-list-ul
menu:
- text: "The Mothership"
href: incomparable_main.html
- text: "Network Wide"
href: incomparable_network.html
- text: "Relay FM"
icon: fa-list-ul
href: relayfm_network.html
- text: "ATP"
icon: fa-list-ul
href: ATP.html
right:
- text: "Data"
icon: fa-download
href: "/data"
- text: "Code"
icon: fa-github
href: "https://github.com/jemus42/podcaststats"
output:
html_document:
toc: true
toc_float: true
highlight: kate
fig_width: 9
mathjax: null
theme: flatly
code_folding: hide
self_contained: false
include:
after_body: html_includes/_footer.html
in_header: html_includes/matomo.html
| name: "Podcast Stats"
output_dir: "_site"
navbar:
title: "Podcast Stats"
left:
- text: "Overview"
href: index.html
- text: "The Incomparable"
icon: fa-list-ul
menu:
- text: "The Mothership"
href: incomparable_main.html
- text: "Network Wide"
href: incomparable_network.html
- text: "Relay FM"
icon: fa-list-ul
href: relayfm_network.html
- text: "ATP"
icon: fa-list-ul
href: ATP.html
right:
- text: "Data"
icon: fa-download
href: "/data/index.Rmd"
- text: "Code"
icon: fa-github
href: "https://github.com/jemus42/podcaststats"
output:
html_document:
toc: true
toc_float: true
highlight: kate
fig_width: 9
mathjax: null
theme: flatly
code_folding: hide
self_contained: false
include:
after_body: html_includes/_footer.html
in_header: html_includes/matomo.html
| Add data index to site | Add data index to site
| YAML | mit | jemus42/podcaststats,jemus42/podcaststats | yaml | ## Code Before:
name: "Podcast Stats"
output_dir: "_site"
navbar:
title: "Podcast Stats"
left:
- text: "Overview"
href: index.html
- text: "The Incomparable"
icon: fa-list-ul
menu:
- text: "The Mothership"
href: incomparable_main.html
- text: "Network Wide"
href: incomparable_network.html
- text: "Relay FM"
icon: fa-list-ul
href: relayfm_network.html
- text: "ATP"
icon: fa-list-ul
href: ATP.html
right:
- text: "Data"
icon: fa-download
href: "/data"
- text: "Code"
icon: fa-github
href: "https://github.com/jemus42/podcaststats"
output:
html_document:
toc: true
toc_float: true
highlight: kate
fig_width: 9
mathjax: null
theme: flatly
code_folding: hide
self_contained: false
include:
after_body: html_includes/_footer.html
in_header: html_includes/matomo.html
## Instruction:
Add data index to site
## Code After:
name: "Podcast Stats"
output_dir: "_site"
navbar:
title: "Podcast Stats"
left:
- text: "Overview"
href: index.html
- text: "The Incomparable"
icon: fa-list-ul
menu:
- text: "The Mothership"
href: incomparable_main.html
- text: "Network Wide"
href: incomparable_network.html
- text: "Relay FM"
icon: fa-list-ul
href: relayfm_network.html
- text: "ATP"
icon: fa-list-ul
href: ATP.html
right:
- text: "Data"
icon: fa-download
href: "/data/index.Rmd"
- text: "Code"
icon: fa-github
href: "https://github.com/jemus42/podcaststats"
output:
html_document:
toc: true
toc_float: true
highlight: kate
fig_width: 9
mathjax: null
theme: flatly
code_folding: hide
self_contained: false
include:
after_body: html_includes/_footer.html
in_header: html_includes/matomo.html
| name: "Podcast Stats"
output_dir: "_site"
navbar:
title: "Podcast Stats"
left:
- text: "Overview"
href: index.html
- text: "The Incomparable"
icon: fa-list-ul
menu:
- text: "The Mothership"
href: incomparable_main.html
- text: "Network Wide"
href: incomparable_network.html
- text: "Relay FM"
icon: fa-list-ul
href: relayfm_network.html
- text: "ATP"
icon: fa-list-ul
href: ATP.html
right:
- text: "Data"
icon: fa-download
- href: "/data"
+ href: "/data/index.Rmd"
? ++++++++++
- text: "Code"
icon: fa-github
href: "https://github.com/jemus42/podcaststats"
output:
html_document:
toc: true
toc_float: true
highlight: kate
fig_width: 9
mathjax: null
theme: flatly
code_folding: hide
self_contained: false
include:
after_body: html_includes/_footer.html
in_header: html_includes/matomo.html | 2 | 0.05 | 1 | 1 |
4e4b9abdb90d89aa1064fa07bab630428144a352 | src/Native/JsonP.js | src/Native/JsonP.js | var _paramanders$elm_twitch_chat$Native_Jsonp = function() {
function jsonp(url, callbackName)
{
return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
window[callbackName] = function(content)
{
callback(_elm_lang$core$Native_Scheduler.succeed(JSON.stringify(content)));
};
var scriptTag = createScript(url, callbackName);
document.head.appendChild(scriptTag);
document.head.removeChild(scriptTag);
});
}
function createScript(url, callbackName)
{
var s = document.createElement('script');
s.type = 'text/javascript';
if (url.indexOf('?') >= 0)
{
s.src = url + '&callback=' + callbackName;
}
else {
s.src = url + '?callback=' + callbackName;
}
return s;
}
return {
jsonp: F2(jsonp)
};
}();
| var _paramanders$elm_twitch_chat$Native_Jsonp = function() {
function jsonp(url, callbackName)
{
return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
window[callbackName] = function(content)
{
callback(_elm_lang$core$Native_Scheduler.succeed(JSON.stringify(content)));
delete window[callbackName];
};
var scriptTag = createScript(url, callbackName);
document.head.appendChild(scriptTag);
document.head.removeChild(scriptTag);
});
}
function createScript(url, callbackName)
{
var s = document.createElement('script');
s.type = 'text/javascript';
if (url.indexOf('?') >= 0)
{
s.src = url + '&callback=' + callbackName;
}
else {
s.src = url + '?callback=' + callbackName;
}
return s;
}
return {
jsonp: F2(jsonp)
};
}();
| Remove JSONP callback function once done | Remove JSONP callback function once done
| JavaScript | mit | paramanders/elm-twitch-chat,paramanders/elm-twitch-chat | javascript | ## Code Before:
var _paramanders$elm_twitch_chat$Native_Jsonp = function() {
function jsonp(url, callbackName)
{
return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
window[callbackName] = function(content)
{
callback(_elm_lang$core$Native_Scheduler.succeed(JSON.stringify(content)));
};
var scriptTag = createScript(url, callbackName);
document.head.appendChild(scriptTag);
document.head.removeChild(scriptTag);
});
}
function createScript(url, callbackName)
{
var s = document.createElement('script');
s.type = 'text/javascript';
if (url.indexOf('?') >= 0)
{
s.src = url + '&callback=' + callbackName;
}
else {
s.src = url + '?callback=' + callbackName;
}
return s;
}
return {
jsonp: F2(jsonp)
};
}();
## Instruction:
Remove JSONP callback function once done
## Code After:
var _paramanders$elm_twitch_chat$Native_Jsonp = function() {
function jsonp(url, callbackName)
{
return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
window[callbackName] = function(content)
{
callback(_elm_lang$core$Native_Scheduler.succeed(JSON.stringify(content)));
delete window[callbackName];
};
var scriptTag = createScript(url, callbackName);
document.head.appendChild(scriptTag);
document.head.removeChild(scriptTag);
});
}
function createScript(url, callbackName)
{
var s = document.createElement('script');
s.type = 'text/javascript';
if (url.indexOf('?') >= 0)
{
s.src = url + '&callback=' + callbackName;
}
else {
s.src = url + '?callback=' + callbackName;
}
return s;
}
return {
jsonp: F2(jsonp)
};
}();
| var _paramanders$elm_twitch_chat$Native_Jsonp = function() {
function jsonp(url, callbackName)
{
-
return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
window[callbackName] = function(content)
{
callback(_elm_lang$core$Native_Scheduler.succeed(JSON.stringify(content)));
+ delete window[callbackName];
};
var scriptTag = createScript(url, callbackName);
document.head.appendChild(scriptTag);
document.head.removeChild(scriptTag);
});
}
function createScript(url, callbackName)
{
var s = document.createElement('script');
s.type = 'text/javascript';
if (url.indexOf('?') >= 0)
{
s.src = url + '&callback=' + callbackName;
}
else {
s.src = url + '?callback=' + callbackName;
}
return s;
}
return {
jsonp: F2(jsonp)
};
}(); | 2 | 0.05 | 1 | 1 |
86a5a78da6a4e1b2fcd7821977ef2c317d8d8630 | codeusersettings.json | codeusersettings.json | {
"breadcrumbs.enabled": true,
"editor.fontSize": 16,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 100,
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"workbench.colorTheme": "Atom One Light",
"workbench.iconTheme": "file-icons",
"workbench.sideBar.location": "right"
}
| {
"breadcrumbs.enabled": true,
"editor.fontSize": 16,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 100,
"files.insertFinalNewline": true,
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"workbench.colorTheme": "Atom One Light",
"workbench.iconTheme": "file-icons",
"workbench.sideBar.location": "right"
}
| Insert final newline in Visual Studio Code | Insert final newline in Visual Studio Code
| JSON | mit | askalot/dotfiles | json | ## Code Before:
{
"breadcrumbs.enabled": true,
"editor.fontSize": 16,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 100,
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"workbench.colorTheme": "Atom One Light",
"workbench.iconTheme": "file-icons",
"workbench.sideBar.location": "right"
}
## Instruction:
Insert final newline in Visual Studio Code
## Code After:
{
"breadcrumbs.enabled": true,
"editor.fontSize": 16,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 100,
"files.insertFinalNewline": true,
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"workbench.colorTheme": "Atom One Light",
"workbench.iconTheme": "file-icons",
"workbench.sideBar.location": "right"
}
| {
"breadcrumbs.enabled": true,
"editor.fontSize": 16,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 100,
+ "files.insertFinalNewline": true,
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"workbench.colorTheme": "Atom One Light",
"workbench.iconTheme": "file-icons",
"workbench.sideBar.location": "right"
}
| 1 | 0.071429 | 1 | 0 |
6682309ec2401a5b98f8c22dcdbca4d5a3930e1c | lib/rbk/cli.rb | lib/rbk/cli.rb |
module Rbk
class Cli
def self.run(argv=ARGV, options={})
new(argv, options).setup.run
end
def initialize(argv, options={})
@argv = argv
@options = options
@git = @options[:git] || Git
@github = @options[:github_repos] || Github::Repos
end
def setup
@config = Configuration.create(@argv)
@shell = @options[:shell] || Shell.new(@config.quiet?)
@archiver = Archiver.new(@shell)
@s3 = @options[:s3] || AWS::S3.new(@config.aws_credentials)
@uploader = Uploader.new(@s3.buckets[@config.bucket], @shell)
self
end
def run
if @config.help?
@shell.puts(@config.usage)
else
Backup.new(repos, git, archiver, uploader, shell).run
end
end
private
attr_reader :git, :archiver, :uploader, :shell
def repos
@repos ||= begin
r = @github.new(oauth_token: @config.github_access_token)
r.list(org: @config.organization, auto_pagination: true)
end
end
class Archiver
def initialize(shell=Shell.new)
@shell = shell
end
def create(path)
archive = %(#{path}.tar.gz)
@shell.exec(%(tar czf #{archive} #{path}))
archive
end
end
end
end
|
module Rbk
class Cli
def self.run(argv=ARGV, options={})
new(argv, options).setup.run
end
def initialize(argv, options={})
@argv = argv
@options = options
@git = @options[:git] || Git
@github_repos = @options[:github_repos] || Github::Repos
end
def setup
@config = Configuration.create(@argv)
@shell = @options[:shell] || Shell.new(@config.quiet?)
@archiver = Archiver.new(@shell)
@s3 = @options[:s3] || AWS::S3.new(@config.aws_credentials)
@uploader = Uploader.new(@s3.buckets[@config.bucket], @shell)
self
end
def run
if @config.help?
@shell.puts(@config.usage)
else
Backup.new(repos, git, archiver, uploader, shell).run
end
end
private
attr_reader :git, :archiver, :uploader, :shell
def repos
@repos ||= begin
r = @github_repos.new(oauth_token: @config.github_access_token)
r.list(org: @config.organization, auto_pagination: true)
end
end
class Archiver
def initialize(shell=Shell.new)
@shell = shell
end
def create(path)
archive = %(#{path}.tar.gz)
@shell.exec(%(tar czf #{archive} #{path}))
archive
end
end
end
end
| Rename `github` instance variable in Cli | Rename `github` instance variable in Cli
| Ruby | bsd-3-clause | mthssdrbrg/rbk | ruby | ## Code Before:
module Rbk
class Cli
def self.run(argv=ARGV, options={})
new(argv, options).setup.run
end
def initialize(argv, options={})
@argv = argv
@options = options
@git = @options[:git] || Git
@github = @options[:github_repos] || Github::Repos
end
def setup
@config = Configuration.create(@argv)
@shell = @options[:shell] || Shell.new(@config.quiet?)
@archiver = Archiver.new(@shell)
@s3 = @options[:s3] || AWS::S3.new(@config.aws_credentials)
@uploader = Uploader.new(@s3.buckets[@config.bucket], @shell)
self
end
def run
if @config.help?
@shell.puts(@config.usage)
else
Backup.new(repos, git, archiver, uploader, shell).run
end
end
private
attr_reader :git, :archiver, :uploader, :shell
def repos
@repos ||= begin
r = @github.new(oauth_token: @config.github_access_token)
r.list(org: @config.organization, auto_pagination: true)
end
end
class Archiver
def initialize(shell=Shell.new)
@shell = shell
end
def create(path)
archive = %(#{path}.tar.gz)
@shell.exec(%(tar czf #{archive} #{path}))
archive
end
end
end
end
## Instruction:
Rename `github` instance variable in Cli
## Code After:
module Rbk
class Cli
def self.run(argv=ARGV, options={})
new(argv, options).setup.run
end
def initialize(argv, options={})
@argv = argv
@options = options
@git = @options[:git] || Git
@github_repos = @options[:github_repos] || Github::Repos
end
def setup
@config = Configuration.create(@argv)
@shell = @options[:shell] || Shell.new(@config.quiet?)
@archiver = Archiver.new(@shell)
@s3 = @options[:s3] || AWS::S3.new(@config.aws_credentials)
@uploader = Uploader.new(@s3.buckets[@config.bucket], @shell)
self
end
def run
if @config.help?
@shell.puts(@config.usage)
else
Backup.new(repos, git, archiver, uploader, shell).run
end
end
private
attr_reader :git, :archiver, :uploader, :shell
def repos
@repos ||= begin
r = @github_repos.new(oauth_token: @config.github_access_token)
r.list(org: @config.organization, auto_pagination: true)
end
end
class Archiver
def initialize(shell=Shell.new)
@shell = shell
end
def create(path)
archive = %(#{path}.tar.gz)
@shell.exec(%(tar czf #{archive} #{path}))
archive
end
end
end
end
|
module Rbk
class Cli
def self.run(argv=ARGV, options={})
new(argv, options).setup.run
end
def initialize(argv, options={})
@argv = argv
@options = options
@git = @options[:git] || Git
- @github = @options[:github_repos] || Github::Repos
+ @github_repos = @options[:github_repos] || Github::Repos
? ++++++
end
def setup
@config = Configuration.create(@argv)
@shell = @options[:shell] || Shell.new(@config.quiet?)
@archiver = Archiver.new(@shell)
@s3 = @options[:s3] || AWS::S3.new(@config.aws_credentials)
@uploader = Uploader.new(@s3.buckets[@config.bucket], @shell)
self
end
def run
if @config.help?
@shell.puts(@config.usage)
else
Backup.new(repos, git, archiver, uploader, shell).run
end
end
private
attr_reader :git, :archiver, :uploader, :shell
def repos
@repos ||= begin
- r = @github.new(oauth_token: @config.github_access_token)
+ r = @github_repos.new(oauth_token: @config.github_access_token)
? ++++++
r.list(org: @config.organization, auto_pagination: true)
end
end
class Archiver
def initialize(shell=Shell.new)
@shell = shell
end
def create(path)
archive = %(#{path}.tar.gz)
@shell.exec(%(tar czf #{archive} #{path}))
archive
end
end
end
end | 4 | 0.072727 | 2 | 2 |
98f08fee9800d0a423aaa614cb8e3dc0a8578ed4 | .travis.yml | .travis.yml | language: python
python:
- "2.7"
# - "3.2"
# - "3.3"
# - "3.4"
# - "3.5"
# - "nightly" # currently points to 3.6-dev
sudo: false
notifications:
email: false
# Setup anaconda and install packages
install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n dmsky-env python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib astropy healpy pyyaml pytest -c fermipy
- source activate dmsky-env
- python setup.py install
# command to run tests
script:
#- nosetests
#- python -c "import numpy; import scipy; import pylab"
#- python -c "import dmsky"
- python tests/test_skymap.py
- python tests/test_density.py
- python tests/test_jcalc.py | language: python
python:
- "2.7"
# - "3.2"
# - "3.3"
# - "3.4"
# - "3.5"
# - "nightly" # currently points to 3.6-dev
sudo: false
notifications:
email: false
# Setup anaconda and install packages
install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n dmsky-env python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib astropy healpy pyyaml nose -c fermipy
- source activate dmsky-env
- git clone https://github.com/kadrlica/pymodeler.git
- cd pymodeler; python setup.py install; cd -
- python setup.py install
# command to run tests
script:
#- nosetests
#- python -c "import numpy; import scipy; import pylab"
#- python -c "import dmsky"
- python tests/test_skymap.py
- python tests/test_density.py
- python tests/test_jcalc.py | Clone bleeding edge of pymodeler | Clone bleeding edge of pymodeler
| YAML | mit | kadrlica/dmsky | yaml | ## Code Before:
language: python
python:
- "2.7"
# - "3.2"
# - "3.3"
# - "3.4"
# - "3.5"
# - "nightly" # currently points to 3.6-dev
sudo: false
notifications:
email: false
# Setup anaconda and install packages
install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n dmsky-env python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib astropy healpy pyyaml pytest -c fermipy
- source activate dmsky-env
- python setup.py install
# command to run tests
script:
#- nosetests
#- python -c "import numpy; import scipy; import pylab"
#- python -c "import dmsky"
- python tests/test_skymap.py
- python tests/test_density.py
- python tests/test_jcalc.py
## Instruction:
Clone bleeding edge of pymodeler
## Code After:
language: python
python:
- "2.7"
# - "3.2"
# - "3.3"
# - "3.4"
# - "3.5"
# - "nightly" # currently points to 3.6-dev
sudo: false
notifications:
email: false
# Setup anaconda and install packages
install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n dmsky-env python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib astropy healpy pyyaml nose -c fermipy
- source activate dmsky-env
- git clone https://github.com/kadrlica/pymodeler.git
- cd pymodeler; python setup.py install; cd -
- python setup.py install
# command to run tests
script:
#- nosetests
#- python -c "import numpy; import scipy; import pylab"
#- python -c "import dmsky"
- python tests/test_skymap.py
- python tests/test_density.py
- python tests/test_jcalc.py | language: python
python:
- "2.7"
# - "3.2"
# - "3.3"
# - "3.4"
# - "3.5"
# - "nightly" # currently points to 3.6-dev
sudo: false
notifications:
email: false
# Setup anaconda and install packages
install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- - conda create -q -n dmsky-env python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib astropy healpy pyyaml pytest -c fermipy
? ^^^ --
+ - conda create -q -n dmsky-env python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib astropy healpy pyyaml nose -c fermipy
? ^^^
- source activate dmsky-env
+ - git clone https://github.com/kadrlica/pymodeler.git
+ - cd pymodeler; python setup.py install; cd -
- python setup.py install
# command to run tests
script:
#- nosetests
#- python -c "import numpy; import scipy; import pylab"
#- python -c "import dmsky"
- python tests/test_skymap.py
- python tests/test_density.py
- python tests/test_jcalc.py | 4 | 0.114286 | 3 | 1 |
ceebe69862210293c757f8c7f5f65fd17698359f | packages/lesswrong/components/questions/AnswersSection.jsx | packages/lesswrong/components/questions/AnswersSection.jsx | import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import PropTypes from 'prop-types';
import withUser from '../common/withUser'
const AnswersSection = ({post}) => {
const { AnswersList, NewAnswerForm, currentUser } = Components
return (
<div>
{currentUser && <NewAnswerForm postId={post._id}/>}
<AnswersList terms={{view: "questionAnswers", postId: post._id}} post={post}/>
</div>
)
};
AnswersSection.propTypes = {
post: PropTypes.object.isRequired,
};
registerComponent('AnswersSection', AnswersSection, withUser);
| import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import PropTypes from 'prop-types';
import withUser from '../common/withUser'
const AnswersSection = ({post, currentUser}) => {
const { AnswersList, NewAnswerForm } = Components
return (
<div>
{currentUser && <NewAnswerForm postId={post._id}/>}
<AnswersList terms={{view: "questionAnswers", postId: post._id}} post={post}/>
</div>
)
};
AnswersSection.propTypes = {
post: PropTypes.object.isRequired,
};
registerComponent('AnswersSection', AnswersSection, withUser);
| Fix NewAnswerForm for logged-in users | Fix NewAnswerForm for logged-in users
| JSX | mit | Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2 | jsx | ## Code Before:
import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import PropTypes from 'prop-types';
import withUser from '../common/withUser'
const AnswersSection = ({post}) => {
const { AnswersList, NewAnswerForm, currentUser } = Components
return (
<div>
{currentUser && <NewAnswerForm postId={post._id}/>}
<AnswersList terms={{view: "questionAnswers", postId: post._id}} post={post}/>
</div>
)
};
AnswersSection.propTypes = {
post: PropTypes.object.isRequired,
};
registerComponent('AnswersSection', AnswersSection, withUser);
## Instruction:
Fix NewAnswerForm for logged-in users
## Code After:
import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import PropTypes from 'prop-types';
import withUser from '../common/withUser'
const AnswersSection = ({post, currentUser}) => {
const { AnswersList, NewAnswerForm } = Components
return (
<div>
{currentUser && <NewAnswerForm postId={post._id}/>}
<AnswersList terms={{view: "questionAnswers", postId: post._id}} post={post}/>
</div>
)
};
AnswersSection.propTypes = {
post: PropTypes.object.isRequired,
};
registerComponent('AnswersSection', AnswersSection, withUser);
| import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import PropTypes from 'prop-types';
import withUser from '../common/withUser'
- const AnswersSection = ({post}) => {
+ const AnswersSection = ({post, currentUser}) => {
? +++++++++++++
- const { AnswersList, NewAnswerForm, currentUser } = Components
? -------------
+ const { AnswersList, NewAnswerForm } = Components
return (
<div>
{currentUser && <NewAnswerForm postId={post._id}/>}
<AnswersList terms={{view: "questionAnswers", postId: post._id}} post={post}/>
</div>
)
};
AnswersSection.propTypes = {
post: PropTypes.object.isRequired,
};
registerComponent('AnswersSection', AnswersSection, withUser); | 4 | 0.181818 | 2 | 2 |
a17736abf56bf8c26f0ef947d5ed00afa7250c6d | tests/regression/02-base/44-malloc_array.c | tests/regression/02-base/44-malloc_array.c | // PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
} | // PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
(* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavior.
In our implementation we keep the whole memory allocated by malloc as one Blob and the whole Blob contains 2 after it was assigned to r[3].
This is more useful than keeping the Blob unknown. *)
} | Add explanation to the regression test 02 44 | Add explanation to the regression test 02 44
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer | c | ## Code Before:
// PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
}
## Instruction:
Add explanation to the regression test 02 44
## Code After:
// PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
(* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavior.
In our implementation we keep the whole memory allocated by malloc as one Blob and the whole Blob contains 2 after it was assigned to r[3].
This is more useful than keeping the Blob unknown. *)
} | // PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
- assert(r[4] == 2);
+ assert(r[4] == 2);
? +
+ (* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavior.
+ In our implementation we keep the whole memory allocated by malloc as one Blob and the whole Blob contains 2 after it was assigned to r[3].
+ This is more useful than keeping the Blob unknown. *)
} | 5 | 0.454545 | 4 | 1 |
eab703b15786b5a0b0ffe8abe91ca3559728e1d9 | src/config.js | src/config.js | /* jslint node:true */
'use strict';
exports = module.exports = {
db: null,
databaseUrl: process.env.CLOUDRON_MONGODB_URL || 'mongodb://127.0.0.1:27017/meemo',
_clearDatabase: clearDatabase,
attachmentDir: process.env.ATTACHMENT_DIR || (__dirname + '/../storage')
};
var MongoClient = require('mongodb').MongoClient;
function clearDatabase(callback) {
MongoClient.connect(exports.databaseUrl, function (error, db) {
if (error) return callback(error);
db.dropDatabase(callback);
});
}
| /* jslint node:true */
'use strict';
exports = module.exports = {
db: null,
databaseUrl: process.env.CLOUDRON_MONGODB_URL || 'mongodb://127.0.0.1:27017/meemo',
_clearDatabase: clearDatabase,
attachmentDir: process.env.ATTACHMENT_DIR || (__dirname + '/../storage')
};
var MongoClient = require('mongodb').MongoClient;
function clearDatabase(callback) {
MongoClient.connect(exports.databaseUrl, { useUnifiedTopology: true }, function (error, client) {
if (error) return callback(error);
client.db().dropDatabase(callback);
});
}
| Fix mongodb usage in tests | Fix mongodb usage in tests
| JavaScript | mit | nebulade/meemo,nebulade/guacamoly,nebulade/guacamoly,nebulade/meemo,nebulade/meemo,nebulade/guacamoly | javascript | ## Code Before:
/* jslint node:true */
'use strict';
exports = module.exports = {
db: null,
databaseUrl: process.env.CLOUDRON_MONGODB_URL || 'mongodb://127.0.0.1:27017/meemo',
_clearDatabase: clearDatabase,
attachmentDir: process.env.ATTACHMENT_DIR || (__dirname + '/../storage')
};
var MongoClient = require('mongodb').MongoClient;
function clearDatabase(callback) {
MongoClient.connect(exports.databaseUrl, function (error, db) {
if (error) return callback(error);
db.dropDatabase(callback);
});
}
## Instruction:
Fix mongodb usage in tests
## Code After:
/* jslint node:true */
'use strict';
exports = module.exports = {
db: null,
databaseUrl: process.env.CLOUDRON_MONGODB_URL || 'mongodb://127.0.0.1:27017/meemo',
_clearDatabase: clearDatabase,
attachmentDir: process.env.ATTACHMENT_DIR || (__dirname + '/../storage')
};
var MongoClient = require('mongodb').MongoClient;
function clearDatabase(callback) {
MongoClient.connect(exports.databaseUrl, { useUnifiedTopology: true }, function (error, client) {
if (error) return callback(error);
client.db().dropDatabase(callback);
});
}
| /* jslint node:true */
'use strict';
exports = module.exports = {
db: null,
databaseUrl: process.env.CLOUDRON_MONGODB_URL || 'mongodb://127.0.0.1:27017/meemo',
_clearDatabase: clearDatabase,
attachmentDir: process.env.ATTACHMENT_DIR || (__dirname + '/../storage')
};
var MongoClient = require('mongodb').MongoClient;
function clearDatabase(callback) {
- MongoClient.connect(exports.databaseUrl, function (error, db) {
? ^^
+ MongoClient.connect(exports.databaseUrl, { useUnifiedTopology: true }, function (error, client) {
? ++++++++++++++++++++++++++++++ ^^^^^^
if (error) return callback(error);
- db.dropDatabase(callback);
+ client.db().dropDatabase(callback);
? +++++++ ++
});
} | 4 | 0.190476 | 2 | 2 |
df9dc6f613916cd96f626e2b337f8d9fe15bb864 | tests/test_cayley_client.py | tests/test_cayley_client.py | from unittest import TestCase
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/film/performance/actor") \
.Out("name") \
.All()
response = client.Send(query)
print response.result
self.assertTrue(response.r.status_code == 200)
self.assertTrue(response.r is not None)
self.assertTrue(len(response.result) > 0)
| from unittest import TestCase
import unittest
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
@unittest.skip('Disabled for now!')
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/film/performance/actor") \
.Out("name") \
.All()
response = client.Send(query)
print response.result
self.assertTrue(response.r.status_code == 200)
self.assertTrue(response.r is not None)
self.assertTrue(len(response.result) > 0)
| Add skip attribute for CayleyClient send test. | Add skip attribute for CayleyClient send test.
| Python | unlicense | ziyasal/pyley,ziyasal/pyley,joshainglis/pyley,joshainglis/pyley | python | ## Code Before:
from unittest import TestCase
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/film/performance/actor") \
.Out("name") \
.All()
response = client.Send(query)
print response.result
self.assertTrue(response.r.status_code == 200)
self.assertTrue(response.r is not None)
self.assertTrue(len(response.result) > 0)
## Instruction:
Add skip attribute for CayleyClient send test.
## Code After:
from unittest import TestCase
import unittest
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
@unittest.skip('Disabled for now!')
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/film/performance/actor") \
.Out("name") \
.All()
response = client.Send(query)
print response.result
self.assertTrue(response.r.status_code == 200)
self.assertTrue(response.r is not None)
self.assertTrue(len(response.result) > 0)
| from unittest import TestCase
+ import unittest
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
+ @unittest.skip('Disabled for now!')
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/film/performance/actor") \
.Out("name") \
.All()
response = client.Send(query)
print response.result
self.assertTrue(response.r.status_code == 200)
self.assertTrue(response.r is not None)
self.assertTrue(len(response.result) > 0) | 2 | 0.1 | 2 | 0 |
4f1a99f9e376ea890d9486d33ee59c59d63532aa | telemetry/telemetry/page/actions/gesture_common.js | telemetry/telemetry/page/actions/gesture_common.js | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file provides common functionality for synthetic gesture actions.
'use strict';
(function() {
function getBoundingVisibleRect(el) {
var bound = el.getBoundingClientRect();
var rect = { top: bound.top,
left: bound.left,
width: bound.width,
height: bound.height };
if (rect.top < 0) {
rect.height += rect.top;
rect.top = 0;
}
if (rect.left < 0) {
rect.width += rect.left;
rect.left = 0;
}
var outsideHeight = (rect.top + rect.height) - window.innerHeight;
var outsideWidth = (rect.left + rect.width) - window.innerWidth;
if (outsideHeight > 0) {
rect.height -= outsideHeight;
}
if (outsideWidth > 0) {
rect.width -= outsideWidth;
}
return rect;
};
window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect;
})();
| // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file provides common functionality for synthetic gesture actions.
'use strict';
(function() {
// Returns the bounding rectangle wrt to the top-most document.
function getBoundingRect(el) {
var client_rect = el.getBoundingClientRect();
var bound = { left: client_rect.left,
top: client_rect.top,
width: client_rect.width,
height: client_rect.height };
var frame = el.ownerDocument.defaultView.frameElement;
while (frame) {
var frame_bound = frame.getBoundingClientRect();
// This computation doesn't account for more complex CSS transforms on the
// frame (e.g. scaling or rotations).
bound.left += frame_bound.left;
bound.top += frame_bound.top;
frame = frame.ownerDocument.frameElement;
}
return bound;
}
function getBoundingVisibleRect(el) {
var rect = getBoundingRect(el);
if (rect.top < 0) {
rect.height += rect.top;
rect.top = 0;
}
if (rect.left < 0) {
rect.width += rect.left;
rect.left = 0;
}
var outsideHeight = (rect.top + rect.height) - window.innerHeight;
var outsideWidth = (rect.left + rect.width) - window.innerWidth;
if (outsideHeight > 0) {
rect.height -= outsideHeight;
}
if (outsideWidth > 0) {
rect.width -= outsideWidth;
}
return rect;
};
window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect;
})();
| Fix calculation of bounding rects for elements in iframes. | Telemetry: Fix calculation of bounding rects for elements in iframes.
We currently use getBoundingClientRect() to compute the bounds of an element in
the page. That method returns the coordinates wrt to its viewport (which could
be an iframe). For synthetic gestures however, we require coordinates wrt to the
top-most window.
This patch fixes the computation by walking up the tree of frames and updating
the bounds for the element by the coordinates of the frames.
Tested on http://www.polymer-project.org/components/paper-elements/demo.html
BUG=391406
Review URL: https://codereview.chromium.org/365113004
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@281418 0039d316-1c4b-4281-b951-d872f2087c98
| JavaScript | bsd-3-clause | sahiljain/catapult,catapult-project/catapult,benschmaus/catapult,catapult-project/catapult,benschmaus/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,benschmaus/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,sahiljain/catapult,catapult-project/catapult-csm,catapult-project/catapult,sahiljain/catapult,catapult-project/catapult,sahiljain/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,sahiljain/catapult,benschmaus/catapult,benschmaus/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,benschmaus/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult,SummerLW/Perf-Insight-Report,SummerLW/Perf-Insight-Report,SummerLW/Perf-Insight-Report | javascript | ## Code Before:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file provides common functionality for synthetic gesture actions.
'use strict';
(function() {
function getBoundingVisibleRect(el) {
var bound = el.getBoundingClientRect();
var rect = { top: bound.top,
left: bound.left,
width: bound.width,
height: bound.height };
if (rect.top < 0) {
rect.height += rect.top;
rect.top = 0;
}
if (rect.left < 0) {
rect.width += rect.left;
rect.left = 0;
}
var outsideHeight = (rect.top + rect.height) - window.innerHeight;
var outsideWidth = (rect.left + rect.width) - window.innerWidth;
if (outsideHeight > 0) {
rect.height -= outsideHeight;
}
if (outsideWidth > 0) {
rect.width -= outsideWidth;
}
return rect;
};
window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect;
})();
## Instruction:
Telemetry: Fix calculation of bounding rects for elements in iframes.
We currently use getBoundingClientRect() to compute the bounds of an element in
the page. That method returns the coordinates wrt to its viewport (which could
be an iframe). For synthetic gestures however, we require coordinates wrt to the
top-most window.
This patch fixes the computation by walking up the tree of frames and updating
the bounds for the element by the coordinates of the frames.
Tested on http://www.polymer-project.org/components/paper-elements/demo.html
BUG=391406
Review URL: https://codereview.chromium.org/365113004
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@281418 0039d316-1c4b-4281-b951-d872f2087c98
## Code After:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file provides common functionality for synthetic gesture actions.
'use strict';
(function() {
// Returns the bounding rectangle wrt to the top-most document.
function getBoundingRect(el) {
var client_rect = el.getBoundingClientRect();
var bound = { left: client_rect.left,
top: client_rect.top,
width: client_rect.width,
height: client_rect.height };
var frame = el.ownerDocument.defaultView.frameElement;
while (frame) {
var frame_bound = frame.getBoundingClientRect();
// This computation doesn't account for more complex CSS transforms on the
// frame (e.g. scaling or rotations).
bound.left += frame_bound.left;
bound.top += frame_bound.top;
frame = frame.ownerDocument.frameElement;
}
return bound;
}
function getBoundingVisibleRect(el) {
var rect = getBoundingRect(el);
if (rect.top < 0) {
rect.height += rect.top;
rect.top = 0;
}
if (rect.left < 0) {
rect.width += rect.left;
rect.left = 0;
}
var outsideHeight = (rect.top + rect.height) - window.innerHeight;
var outsideWidth = (rect.left + rect.width) - window.innerWidth;
if (outsideHeight > 0) {
rect.height -= outsideHeight;
}
if (outsideWidth > 0) {
rect.width -= outsideWidth;
}
return rect;
};
window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect;
})();
| // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file provides common functionality for synthetic gesture actions.
'use strict';
(function() {
+ // Returns the bounding rectangle wrt to the top-most document.
+ function getBoundingRect(el) {
+ var client_rect = el.getBoundingClientRect();
+ var bound = { left: client_rect.left,
+ top: client_rect.top,
+ width: client_rect.width,
+ height: client_rect.height };
+
+ var frame = el.ownerDocument.defaultView.frameElement;
+ while (frame) {
+ var frame_bound = frame.getBoundingClientRect();
+ // This computation doesn't account for more complex CSS transforms on the
+ // frame (e.g. scaling or rotations).
+ bound.left += frame_bound.left;
+ bound.top += frame_bound.top;
+
+ frame = frame.ownerDocument.frameElement;
+ }
+ return bound;
+ }
+
function getBoundingVisibleRect(el) {
+ var rect = getBoundingRect(el);
- var bound = el.getBoundingClientRect();
- var rect = { top: bound.top,
- left: bound.left,
- width: bound.width,
- height: bound.height };
if (rect.top < 0) {
rect.height += rect.top;
rect.top = 0;
}
if (rect.left < 0) {
rect.width += rect.left;
rect.left = 0;
}
var outsideHeight = (rect.top + rect.height) - window.innerHeight;
var outsideWidth = (rect.left + rect.width) - window.innerWidth;
if (outsideHeight > 0) {
rect.height -= outsideHeight;
}
if (outsideWidth > 0) {
rect.width -= outsideWidth;
}
return rect;
};
window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect;
})(); | 27 | 0.710526 | 22 | 5 |
6c2dddbc0c922095d50a9dbaa5a70c33f37c2b71 | .github/workflows/web-app-main.yml | .github/workflows/web-app-main.yml | name: WebApp (JS) - Main
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/web-app-main.yml'
jobs:
deploy-to-main:
name: Deploy (Main)
environment: main
runs-on: ubuntu-latest
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: "Run azure/CLI@v1: az storage copy"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az storage copy -s https://slpublic.blob.core.windows.net/assets/latest-edge -d https://slpublic.blob.core.windows.net/assets/latest-main
- name: "Run azure/CLI@v1: az cdn endpoint purge"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az cdn endpoint purge --content-paths /assets/latest-main --profile-name "SharpLab-CDN" --name slpublic --resource-group SharpLab
- run: Invoke-RestMethod -Method POST -Uri 'https://sharplab.io/assets/reload' -Authentication Bearer -Token $(ConvertTo-SecureString $env:SHARPLAB_ASSETS_RELOAD_TOKEN -AsPlainText)
shell: pwsh
env:
SHARPLAB_ASSETS_RELOAD_TOKEN: ${{ secrets.SHARPLAB_ASSETS_RELOAD_TOKEN }} | name: WebApp (JS) - Main
on: workflow_dispatch
jobs:
deploy-to-main:
name: Deploy (Main)
environment: main
runs-on: ubuntu-latest
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: "Run azure/CLI@v1: az storage copy"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az storage copy -s https://slpublic.blob.core.windows.net/assets/latest-edge -d https://slpublic.blob.core.windows.net/assets/latest-main
- name: "Run azure/CLI@v1: az cdn endpoint purge"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az cdn endpoint purge --content-paths /assets/latest-main --profile-name "SharpLab-CDN" --name slpublic --resource-group SharpLab
- run: Invoke-RestMethod -Method POST -Uri 'https://sharplab.io/assets/reload' -Authentication Bearer -Token $(ConvertTo-SecureString $env:SHARPLAB_ASSETS_RELOAD_TOKEN -AsPlainText)
shell: pwsh
env:
SHARPLAB_ASSETS_RELOAD_TOKEN: ${{ secrets.SHARPLAB_ASSETS_RELOAD_TOKEN }} | Remove temporary push trigger for WebApp-Main | Remove temporary push trigger for WebApp-Main
| YAML | bsd-2-clause | ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab | yaml | ## Code Before:
name: WebApp (JS) - Main
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/web-app-main.yml'
jobs:
deploy-to-main:
name: Deploy (Main)
environment: main
runs-on: ubuntu-latest
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: "Run azure/CLI@v1: az storage copy"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az storage copy -s https://slpublic.blob.core.windows.net/assets/latest-edge -d https://slpublic.blob.core.windows.net/assets/latest-main
- name: "Run azure/CLI@v1: az cdn endpoint purge"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az cdn endpoint purge --content-paths /assets/latest-main --profile-name "SharpLab-CDN" --name slpublic --resource-group SharpLab
- run: Invoke-RestMethod -Method POST -Uri 'https://sharplab.io/assets/reload' -Authentication Bearer -Token $(ConvertTo-SecureString $env:SHARPLAB_ASSETS_RELOAD_TOKEN -AsPlainText)
shell: pwsh
env:
SHARPLAB_ASSETS_RELOAD_TOKEN: ${{ secrets.SHARPLAB_ASSETS_RELOAD_TOKEN }}
## Instruction:
Remove temporary push trigger for WebApp-Main
## Code After:
name: WebApp (JS) - Main
on: workflow_dispatch
jobs:
deploy-to-main:
name: Deploy (Main)
environment: main
runs-on: ubuntu-latest
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: "Run azure/CLI@v1: az storage copy"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az storage copy -s https://slpublic.blob.core.windows.net/assets/latest-edge -d https://slpublic.blob.core.windows.net/assets/latest-main
- name: "Run azure/CLI@v1: az cdn endpoint purge"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az cdn endpoint purge --content-paths /assets/latest-main --profile-name "SharpLab-CDN" --name slpublic --resource-group SharpLab
- run: Invoke-RestMethod -Method POST -Uri 'https://sharplab.io/assets/reload' -Authentication Bearer -Token $(ConvertTo-SecureString $env:SHARPLAB_ASSETS_RELOAD_TOKEN -AsPlainText)
shell: pwsh
env:
SHARPLAB_ASSETS_RELOAD_TOKEN: ${{ secrets.SHARPLAB_ASSETS_RELOAD_TOKEN }} | name: WebApp (JS) - Main
- on:
- workflow_dispatch:
? ^ -
+ on: workflow_dispatch
? ^^^
- push:
- paths:
- - '.github/workflows/web-app-main.yml'
jobs:
deploy-to-main:
name: Deploy (Main)
environment: main
runs-on: ubuntu-latest
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: "Run azure/CLI@v1: az storage copy"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az storage copy -s https://slpublic.blob.core.windows.net/assets/latest-edge -d https://slpublic.blob.core.windows.net/assets/latest-main
- name: "Run azure/CLI@v1: az cdn endpoint purge"
uses: azure/CLI@v1
with:
azcliversion: 2.9.1
inlineScript: |
az cdn endpoint purge --content-paths /assets/latest-main --profile-name "SharpLab-CDN" --name slpublic --resource-group SharpLab
- run: Invoke-RestMethod -Method POST -Uri 'https://sharplab.io/assets/reload' -Authentication Bearer -Token $(ConvertTo-SecureString $env:SHARPLAB_ASSETS_RELOAD_TOKEN -AsPlainText)
shell: pwsh
env:
SHARPLAB_ASSETS_RELOAD_TOKEN: ${{ secrets.SHARPLAB_ASSETS_RELOAD_TOKEN }} | 6 | 0.166667 | 1 | 5 |
f92f4a6c8e754281ae0235868ac7d54526872264 | templates/sidebar.php | templates/sidebar.php | <div id="sidebar">
<ul class="clearfix">
<li class="help"><a href="#">Help</a></li>
<li><a href="/">Upcoming Visits</a></li>
<li><a href="/cell">Unit Cell Search</a>
<?php if ($this->staff): ?>
<ul>
<li><a href="/cell/batch">PDB vs Unit Cell</a>
</ul>
<?php endif; ?>
</li>
<li><a href="/proposal">Proposals</a></li>
<li>
<span class="current" title="Click to change the currently selected proposal"><?php echo $prop ?></span>
<?php if ($prop): ?>
<ul>
<li><a href="/proposal/visits">Visits</a></li>
<li><a href="/dc/proposal">Calendar</a></li>
<li><a href="/samples/proposal">Prepare Experiment</a></li>
<li><a href="/shipment">Shipments</a></li>
<li><a href="/sample">Samples</a></li>
<li><a href="/sample/proteins">Proteins</a></li>
<li><a href="/contact">Lab Contacts</a></li>
<li><a href="/vstat/proposal">Statistics</a></li>
</ul>
<?php endif; ?>
</li>
</ul>
<a class="pull">Menu</a>
</div> | <div id="sidebar">
<ul class="clearfix">
<li class="help"><a href="#">Help</a></li>
<li><a href="/">Upcoming Visits</a>
<?php if ($this->staff): ?>
<ul>
<li><a href="/dc">Calendar</a></li>
</ul>
<?php endif; ?>
</li>
<li><a href="/cell">Unit Cell Search</a>
<?php if ($this->staff): ?>
<ul>
<li><a href="/cell/batch">PDB vs Unit Cell</a></li>
</ul>
<?php endif; ?>
</li>
<li><a href="/proposal">Proposals</a></li>
<li>
<span class="current" title="Click to change the currently selected proposal"><?php echo $prop ?></span>
<?php if ($prop): ?>
<ul>
<li><a href="/proposal/visits">Visits</a></li>
<li><a href="/dc/proposal">Calendar</a></li>
<li><a href="/samples/proposal">Prepare Experiment</a></li>
<li><a href="/shipment">Shipments</a></li>
<li><a href="/sample">Samples</a></li>
<li><a href="/sample/proteins">Proteins</a></li>
<li><a href="/contact">Lab Contacts</a></li>
<li><a href="/vstat/proposal">Statistics</a></li>
</ul>
<?php endif; ?>
</li>
</ul>
<a class="pull">Menu</a>
</div> | Add full calendar for staff | Add full calendar for staff
| PHP | apache-2.0 | stufisher/ispyb-php,stufisher/ispyb-php,stufisher/ispyb-php,stufisher/ispyb-php,stufisher/ispyb-php | php | ## Code Before:
<div id="sidebar">
<ul class="clearfix">
<li class="help"><a href="#">Help</a></li>
<li><a href="/">Upcoming Visits</a></li>
<li><a href="/cell">Unit Cell Search</a>
<?php if ($this->staff): ?>
<ul>
<li><a href="/cell/batch">PDB vs Unit Cell</a>
</ul>
<?php endif; ?>
</li>
<li><a href="/proposal">Proposals</a></li>
<li>
<span class="current" title="Click to change the currently selected proposal"><?php echo $prop ?></span>
<?php if ($prop): ?>
<ul>
<li><a href="/proposal/visits">Visits</a></li>
<li><a href="/dc/proposal">Calendar</a></li>
<li><a href="/samples/proposal">Prepare Experiment</a></li>
<li><a href="/shipment">Shipments</a></li>
<li><a href="/sample">Samples</a></li>
<li><a href="/sample/proteins">Proteins</a></li>
<li><a href="/contact">Lab Contacts</a></li>
<li><a href="/vstat/proposal">Statistics</a></li>
</ul>
<?php endif; ?>
</li>
</ul>
<a class="pull">Menu</a>
</div>
## Instruction:
Add full calendar for staff
## Code After:
<div id="sidebar">
<ul class="clearfix">
<li class="help"><a href="#">Help</a></li>
<li><a href="/">Upcoming Visits</a>
<?php if ($this->staff): ?>
<ul>
<li><a href="/dc">Calendar</a></li>
</ul>
<?php endif; ?>
</li>
<li><a href="/cell">Unit Cell Search</a>
<?php if ($this->staff): ?>
<ul>
<li><a href="/cell/batch">PDB vs Unit Cell</a></li>
</ul>
<?php endif; ?>
</li>
<li><a href="/proposal">Proposals</a></li>
<li>
<span class="current" title="Click to change the currently selected proposal"><?php echo $prop ?></span>
<?php if ($prop): ?>
<ul>
<li><a href="/proposal/visits">Visits</a></li>
<li><a href="/dc/proposal">Calendar</a></li>
<li><a href="/samples/proposal">Prepare Experiment</a></li>
<li><a href="/shipment">Shipments</a></li>
<li><a href="/sample">Samples</a></li>
<li><a href="/sample/proteins">Proteins</a></li>
<li><a href="/contact">Lab Contacts</a></li>
<li><a href="/vstat/proposal">Statistics</a></li>
</ul>
<?php endif; ?>
</li>
</ul>
<a class="pull">Menu</a>
</div> | <div id="sidebar">
<ul class="clearfix">
<li class="help"><a href="#">Help</a></li>
- <li><a href="/">Upcoming Visits</a></li>
? -----
+ <li><a href="/">Upcoming Visits</a>
+ <?php if ($this->staff): ?>
+ <ul>
+ <li><a href="/dc">Calendar</a></li>
+ </ul>
+ <?php endif; ?>
+ </li>
<li><a href="/cell">Unit Cell Search</a>
<?php if ($this->staff): ?>
<ul>
- <li><a href="/cell/batch">PDB vs Unit Cell</a>
+ <li><a href="/cell/batch">PDB vs Unit Cell</a></li>
? +++++
</ul>
<?php endif; ?>
</li>
<li><a href="/proposal">Proposals</a></li>
<li>
<span class="current" title="Click to change the currently selected proposal"><?php echo $prop ?></span>
<?php if ($prop): ?>
<ul>
<li><a href="/proposal/visits">Visits</a></li>
<li><a href="/dc/proposal">Calendar</a></li>
<li><a href="/samples/proposal">Prepare Experiment</a></li>
<li><a href="/shipment">Shipments</a></li>
<li><a href="/sample">Samples</a></li>
<li><a href="/sample/proteins">Proteins</a></li>
<li><a href="/contact">Lab Contacts</a></li>
<li><a href="/vstat/proposal">Statistics</a></li>
</ul>
<?php endif; ?>
</li>
</ul>
<a class="pull">Menu</a>
</div> | 10 | 0.232558 | 8 | 2 |
2068bdf3443a9b76c8b5f266fb2231fc113242c6 | util/create-error.js | util/create-error.js | 'use strict'
const _ = require('lodash')
module.exports = function createError (message, status) {
let props
let Constructor = Error
if (_.isPlainObject(message)) {
props = _.omit(message, 'message')
if (message.constructor) {
Constructor = props.constructor
}
message = message.message || 'Error'
} else {
props = {}
}
if (_.isPlainObject(status)) {
Object.assign(props, status)
} else if (typeof status === 'number') {
props.status = status
}
const err = new Constructor(message)
Object.assign(err, props)
return err
}
| 'use strict'
const _ = require('lodash')
module.exports = function createError (message, status) {
let props
let ErrorConstructor = Error
if (_.isPlainObject(message)) {
props = _.omit(message, 'message')
if (message.errorConstructor) {
ErrorConstructor = props.errorConstructor
}
message = message.message || 'Error'
} else {
props = {}
}
if (_.isPlainObject(status)) {
Object.assign(props, status)
} else if (typeof status === 'number') {
props.status = status
}
const err = new ErrorConstructor(message)
Object.assign(err, props)
return err
}
| Rename constructor option to avoid collision with prototype constructor | Rename constructor option to avoid collision with prototype constructor
| JavaScript | mit | thebitmill/midwest | javascript | ## Code Before:
'use strict'
const _ = require('lodash')
module.exports = function createError (message, status) {
let props
let Constructor = Error
if (_.isPlainObject(message)) {
props = _.omit(message, 'message')
if (message.constructor) {
Constructor = props.constructor
}
message = message.message || 'Error'
} else {
props = {}
}
if (_.isPlainObject(status)) {
Object.assign(props, status)
} else if (typeof status === 'number') {
props.status = status
}
const err = new Constructor(message)
Object.assign(err, props)
return err
}
## Instruction:
Rename constructor option to avoid collision with prototype constructor
## Code After:
'use strict'
const _ = require('lodash')
module.exports = function createError (message, status) {
let props
let ErrorConstructor = Error
if (_.isPlainObject(message)) {
props = _.omit(message, 'message')
if (message.errorConstructor) {
ErrorConstructor = props.errorConstructor
}
message = message.message || 'Error'
} else {
props = {}
}
if (_.isPlainObject(status)) {
Object.assign(props, status)
} else if (typeof status === 'number') {
props.status = status
}
const err = new ErrorConstructor(message)
Object.assign(err, props)
return err
}
| 'use strict'
const _ = require('lodash')
module.exports = function createError (message, status) {
let props
- let Constructor = Error
+ let ErrorConstructor = Error
? +++++
if (_.isPlainObject(message)) {
props = _.omit(message, 'message')
- if (message.constructor) {
? ^
+ if (message.errorConstructor) {
? ^^^^^^
- Constructor = props.constructor
? ^
+ ErrorConstructor = props.errorConstructor
? +++++ ^^^^^^
}
message = message.message || 'Error'
} else {
props = {}
}
if (_.isPlainObject(status)) {
Object.assign(props, status)
} else if (typeof status === 'number') {
props.status = status
}
- const err = new Constructor(message)
+ const err = new ErrorConstructor(message)
? +++++
Object.assign(err, props)
return err
} | 8 | 0.25 | 4 | 4 |
76ecf3757ece39247a06e04c6b4ebad80e038f1b | library/Denkmal/resources/db/update/20.php | library/Denkmal/resources/db/update/20.php | <?php
if (CM_Db_Db::existsIndex('denkmal_push_subscription', 'subscriptionId-endpoint')) {
CM_Db_Db::exec("DROP INDEX `subscriptionId-endpoint` ON denkmal_push_subscription;");
CM_Db_Db::exec("CREATE UNIQUE INDEX `endpoint` ON denkmal_push_subscription (endpoint);");
}
if (CM_Db_Db::existsColumn('denkmal_push_subscription', 'subscriptionId')) {
CM_Db_Db::exec("ALTER TABLE denkmal_push_subscription DROP COLUMN `subscriptionId`;");
}
| <?php
CM_Db_Db::delete('denkmal_push_subscription');
if (CM_Db_Db::existsIndex('denkmal_push_subscription', 'subscriptionId-endpoint')) {
CM_Db_Db::exec("DROP INDEX `subscriptionId-endpoint` ON denkmal_push_subscription;");
CM_Db_Db::exec("CREATE UNIQUE INDEX `endpoint` ON denkmal_push_subscription (endpoint);");
}
if (CM_Db_Db::existsColumn('denkmal_push_subscription', 'subscriptionId')) {
CM_Db_Db::exec("ALTER TABLE denkmal_push_subscription DROP COLUMN `subscriptionId`;");
}
| Delete all existing push subscriptions | Delete all existing push subscriptions
| PHP | mit | denkmal/denkmal.org,njam/denkmal.org,njam/denkmal.org,denkmal/denkmal.org,njam/denkmal.org,denkmal/denkmal.org,denkmal/denkmal.org,denkmal/denkmal.org,njam/denkmal.org,njam/denkmal.org | php | ## Code Before:
<?php
if (CM_Db_Db::existsIndex('denkmal_push_subscription', 'subscriptionId-endpoint')) {
CM_Db_Db::exec("DROP INDEX `subscriptionId-endpoint` ON denkmal_push_subscription;");
CM_Db_Db::exec("CREATE UNIQUE INDEX `endpoint` ON denkmal_push_subscription (endpoint);");
}
if (CM_Db_Db::existsColumn('denkmal_push_subscription', 'subscriptionId')) {
CM_Db_Db::exec("ALTER TABLE denkmal_push_subscription DROP COLUMN `subscriptionId`;");
}
## Instruction:
Delete all existing push subscriptions
## Code After:
<?php
CM_Db_Db::delete('denkmal_push_subscription');
if (CM_Db_Db::existsIndex('denkmal_push_subscription', 'subscriptionId-endpoint')) {
CM_Db_Db::exec("DROP INDEX `subscriptionId-endpoint` ON denkmal_push_subscription;");
CM_Db_Db::exec("CREATE UNIQUE INDEX `endpoint` ON denkmal_push_subscription (endpoint);");
}
if (CM_Db_Db::existsColumn('denkmal_push_subscription', 'subscriptionId')) {
CM_Db_Db::exec("ALTER TABLE denkmal_push_subscription DROP COLUMN `subscriptionId`;");
}
| <?php
+
+ CM_Db_Db::delete('denkmal_push_subscription');
if (CM_Db_Db::existsIndex('denkmal_push_subscription', 'subscriptionId-endpoint')) {
CM_Db_Db::exec("DROP INDEX `subscriptionId-endpoint` ON denkmal_push_subscription;");
CM_Db_Db::exec("CREATE UNIQUE INDEX `endpoint` ON denkmal_push_subscription (endpoint);");
}
if (CM_Db_Db::existsColumn('denkmal_push_subscription', 'subscriptionId')) {
CM_Db_Db::exec("ALTER TABLE denkmal_push_subscription DROP COLUMN `subscriptionId`;");
} | 2 | 0.181818 | 2 | 0 |
f1ed7dd603ace84b1b8015c2d7d57515d9de3947 | src/detector.py | src/detector.py | from sys import argv
import numpy as np
import cv2
import cv2.cv as cv
def detectCircle(imagePath):
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
gray = cv2.Canny(gray, 32, 2)
cv2.imwrite("canny.jpg", gray)
circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 1, 50, 10, 50, 6, 10)
if circles is not None:
circles = np.uint16(np.around(circles))
gray = cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR)
for i in circles[0,:]:
# draw the outer circle
cv2.circle(gray,(i[0],i[1]),i[2],(0,255,0),2)
# draw the center of the circle
cv2.circle(gray,(i[0],i[1]),2,(0,0,255),3)
cv2.imwrite('circled.jpg', gray)
return len(circles[0])
if __name__ == '__main__':
if len(argv) < 2:
exit(1)
print detectCircle(argv[1])
| from sys import argv
import numpy as np
import cv2
import cv2.cv as cv
def detectCircle(imagePath):
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
gray = cv2.Canny(gray, 32, 2)
cv2.imwrite("canny.jpg", gray)
circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 1, 10, np.array([]), 10, 20, 6, 20)
if circles is not None:
circles = np.uint16(np.around(circles))
gray = cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR)
for i in circles[0,:]:
# draw the outer circle
cv2.circle(gray,(i[0],i[1]),i[2],(0,255,0),2)
# draw the center of the circle
cv2.circle(gray,(i[0],i[1]),2,(0,0,255),3)
cv2.imwrite('circled.jpg', gray)
return len(circles[0])
if __name__ == '__main__':
if len(argv) < 2:
exit(1)
print detectCircle(argv[1])
| Fix error in RaspberryPi environment <numpy type error>. | Fix error in RaspberryPi environment <numpy type error>.
| Python | apache-2.0 | Jarrey/BotEyePi,Jarrey/BotEyePi | python | ## Code Before:
from sys import argv
import numpy as np
import cv2
import cv2.cv as cv
def detectCircle(imagePath):
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
gray = cv2.Canny(gray, 32, 2)
cv2.imwrite("canny.jpg", gray)
circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 1, 50, 10, 50, 6, 10)
if circles is not None:
circles = np.uint16(np.around(circles))
gray = cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR)
for i in circles[0,:]:
# draw the outer circle
cv2.circle(gray,(i[0],i[1]),i[2],(0,255,0),2)
# draw the center of the circle
cv2.circle(gray,(i[0],i[1]),2,(0,0,255),3)
cv2.imwrite('circled.jpg', gray)
return len(circles[0])
if __name__ == '__main__':
if len(argv) < 2:
exit(1)
print detectCircle(argv[1])
## Instruction:
Fix error in RaspberryPi environment <numpy type error>.
## Code After:
from sys import argv
import numpy as np
import cv2
import cv2.cv as cv
def detectCircle(imagePath):
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
gray = cv2.Canny(gray, 32, 2)
cv2.imwrite("canny.jpg", gray)
circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 1, 10, np.array([]), 10, 20, 6, 20)
if circles is not None:
circles = np.uint16(np.around(circles))
gray = cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR)
for i in circles[0,:]:
# draw the outer circle
cv2.circle(gray,(i[0],i[1]),i[2],(0,255,0),2)
# draw the center of the circle
cv2.circle(gray,(i[0],i[1]),2,(0,0,255),3)
cv2.imwrite('circled.jpg', gray)
return len(circles[0])
if __name__ == '__main__':
if len(argv) < 2:
exit(1)
print detectCircle(argv[1])
| from sys import argv
import numpy as np
import cv2
import cv2.cv as cv
def detectCircle(imagePath):
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
gray = cv2.Canny(gray, 32, 2)
cv2.imwrite("canny.jpg", gray)
- circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 1, 50, 10, 50, 6, 10)
? ^ ^ ^
+ circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 1, 10, np.array([]), 10, 20, 6, 20)
? ^ ++++++++++++++ ^ ^
if circles is not None:
circles = np.uint16(np.around(circles))
gray = cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR)
for i in circles[0,:]:
# draw the outer circle
cv2.circle(gray,(i[0],i[1]),i[2],(0,255,0),2)
# draw the center of the circle
cv2.circle(gray,(i[0],i[1]),2,(0,0,255),3)
cv2.imwrite('circled.jpg', gray)
return len(circles[0])
if __name__ == '__main__':
if len(argv) < 2:
exit(1)
print detectCircle(argv[1]) | 2 | 0.066667 | 1 | 1 |
f5d456277a6062d7de9f11d33f821aecd4f1dc08 | BHCDatabase/test/models/question_test.rb | BHCDatabase/test/models/question_test.rb | require 'test_helper'
class QuestionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| require 'test_helper'
# QuestionTest is the generic model test for a question.
class QuestionTest < ActiveSupport::TestCase
def setup
@question = questions(:one)
end
test 'should be valid' do
assert @question.valid?
end
test 'question should be present' do
@question.question = ''
assert_not @question.valid?
end
test "question shouldn't be too long" do
@question.question = 'a' * 65_537
assert_not @question.valid?
end
test 'visible should be present' do
@question.visible = nil
assert_not @question.valid?
end
test 'question_type should be present' do
@question.question_type = nil
assert_not @question.valid?
end
test 'question should be unique' do
@duplicate_question = @question.dup
assert @duplicate_question.question == @question.question
assert_no_difference 'Question.count' do
@duplicate_question.save
end
end
end
| Add model tests for question. | Add model tests for question.
| Ruby | mit | DaBrown95/BHCDatabase,DaBrown95/BHCDatabase,DaBrown95/BHCDatabase | ruby | ## Code Before:
require 'test_helper'
class QuestionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
## Instruction:
Add model tests for question.
## Code After:
require 'test_helper'
# QuestionTest is the generic model test for a question.
class QuestionTest < ActiveSupport::TestCase
def setup
@question = questions(:one)
end
test 'should be valid' do
assert @question.valid?
end
test 'question should be present' do
@question.question = ''
assert_not @question.valid?
end
test "question shouldn't be too long" do
@question.question = 'a' * 65_537
assert_not @question.valid?
end
test 'visible should be present' do
@question.visible = nil
assert_not @question.valid?
end
test 'question_type should be present' do
@question.question_type = nil
assert_not @question.valid?
end
test 'question should be unique' do
@duplicate_question = @question.dup
assert @duplicate_question.question == @question.question
assert_no_difference 'Question.count' do
@duplicate_question.save
end
end
end
| require 'test_helper'
+ # QuestionTest is the generic model test for a question.
class QuestionTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
+ def setup
+ @question = questions(:one)
+ end
+
+ test 'should be valid' do
+ assert @question.valid?
+ end
+
+ test 'question should be present' do
+ @question.question = ''
+ assert_not @question.valid?
+ end
+
+ test "question shouldn't be too long" do
+ @question.question = 'a' * 65_537
+ assert_not @question.valid?
+ end
+
+ test 'visible should be present' do
+ @question.visible = nil
+ assert_not @question.valid?
+ end
+
+ test 'question_type should be present' do
+ @question.question_type = nil
+ assert_not @question.valid?
+ end
+
+ test 'question should be unique' do
+ @duplicate_question = @question.dup
+ assert @duplicate_question.question == @question.question
+ assert_no_difference 'Question.count' do
+ @duplicate_question.save
- # end
? ^
+ end
? ^
+ end
end | 39 | 5.571429 | 36 | 3 |
9579909492ac9d80cfec0d9c9858ce7d89760aa1 | examples/flux-chat/js/app.js | examples/flux-chat/js/app.js | /**
* This file is provided by Facebook for testing and evaluation purposes
* only. Facebook reserves all rights not expressly granted.
*
* 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
* FACEBOOK 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.
*
* @jsx React.DOM
*/
// This file bootstraps the entire application.
var ChatApp = require('./components/ChatApp.react');
var ChatExampleData = require('./ChatExampleData');
var ChatWebAPIUtils = require('./utils/ChatWebAPIUtils');
var React = require('react');
ChatExampleData.init(); // load example data into localstorage
ChatWebAPIUtils.getAllMessages();
React.renderComponent(
<ChatApp />,
document.getElementById('react')
);
| /**
* This file is provided by Facebook for testing and evaluation purposes
* only. Facebook reserves all rights not expressly granted.
*
* 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
* FACEBOOK 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.
*
* @jsx React.DOM
*/
// This file bootstraps the entire application.
var ChatApp = require('./components/ChatApp.react');
var ChatExampleData = require('./ChatExampleData');
var ChatWebAPIUtils = require('./utils/ChatWebAPIUtils');
var React = require('react');
window.React = React; // export for http://fb.me/react-devtools
ChatExampleData.init(); // load example data into localstorage
ChatWebAPIUtils.getAllMessages();
React.renderComponent(
<ChatApp />,
document.getElementById('react')
);
| Enable React devtools by exposing React (setting window.React) | Enable React devtools by exposing React (setting window.React)
| JavaScript | bsd-3-clause | eclectriq/flux,ludiculous/flux,ayarulin/flux,nikhyl/flux,debbas/ChatV2,JanChw/flux,crsr/flux,keikun17/flux,jmandel/flux,gfogle/elm-todomvc,Chen-Han/flux,ephetic/flux,ayarulin/flux,superphung/flux,prabhash1785/flux,rstefek/flux,UIKit0/flux-1,Demian-Moschin/flux,avinnakota/flux,mircle/flux,viviancpy/flux,alexeybondarenko/flux,vl-lapikov/flux,cold-brew-coding/flux,bilboJ/flux,JanChw/flux,wandrejevic/flux,thebergamo/flux,gnoesiboe/flux,zshift/flux,vl-lapikov/flux,ludiculous/flux,oopchoi/flux,Binzzzz/flux,dingdingvsjj/flux,glitch100/flux,Eric-Vandenberg/flux,maximvl/flux,knrm/flux,kris1226/flux,viviancpy/flux,amoskyler/flux,MykolaBova/flux,jinkea/flux,maksymshtyria/flux,cjmanetta/flux,thadiggitystank/flux,yanarchy/flux,Zagorakiss/flux,zhanglingkang/flux,steveleec/flux,cgack/flux,tungmv7/flux,bilboJ/flux,jeremyhu9/flux,ayarulin/flux,rohannair/flux,bertomartin/flux,dmlinn/flux,prabhash1785/flux,pj8063/flux,noahlt/flux,lifebeyondfife/flux-todomvc,usufruct/flux,ksivam/flux,alemontree/flux,fauzan182/flux,hokennethk/flux,slapheadted/flux-nukebox,bartcharbon/flux,alexeygusak/flux,ataker/flux,zhanglingkang/flux,chenrui2014/flux,keikun17/flux,maksymshtyria/flux,Jonekee/flux,haruair/flux,birendra-ideas2it/flux,thewarpaint/flux,kiopl/flux,aaron-goshine/flux,jeremyhu9/flux,ShannonStoner/flux,MykolaBova/flux,danielchatfield/flux,kiopl/flux,fauzan182/flux,harrykiselev/flux,danielchatfield/flux,hoozi/flux,akhilxavierm/flux,pj8063/flux,crzidea/flux,chrismoulton/flux,DimitarRuskov/flux,andela-cijeomah/flux,alexeybondarenko/flux,JunyaOnishi/flux,stevemao/flux,jeffj/flux,bartcharbon/flux,tungmv7/flux,hanan198501/flux,justin3737/flux,gaurav1981/flux,sibinx7/flux,kwangkim/flux,rkho/flux,lilien1010/flux,haruair/flux,micahlmartin/flux,kwangkim/flux,rstefek/flux,alucas/flux,harrykiselev/flux,harrykiselev/flux,djfm/flux,andela-cijeomah/flux,thewarpaint/flux,cold-brew-coding/flux,chienchienchen/flux,garylgh/flux,runn1ng/flux,tinygrasshopper/flux,nvoron23/flux,jarl-alejandro/flux,mcanthony/flux,tcxq42aa/flux,kris1226/flux,bartcharbon/flux,crsr/flux,crzidea/flux,tungmv7/flux,jarl-alejandro/flux,dingdingvsjj/flux,noahlt/flux,latkins/flux,mandaltapesh/flux,keikun17/flux,jdholdren/flux,ShannonStoner/flux,crsgypin/flux,Chen-Han/flux,Eric-Vandenberg/flux,davidgbe/flux,chienchienchen/flux,jugend/flux,venkateshdaram434/flux,noahlt/flux,steveleec/flux,djfm/flux,gnoesiboe/flux,sahat/flux,prabhash1785/flux,james4388/flux,kangkot/flux,mzbac/flux,magus0219/flux,zhzenghui/flux,nvoron23/flux,baiwyc119/flux,siddhartharay007/flux,Eric-Vandenberg/flux,mandaltapesh/flux,mzbac/flux,RomanTsopin/flux,baijuachari/flux,chenckang/flux,crsgypin/flux,oopchoi/flux,rtfeldman/flux,Zagorakiss/flux,knrm/flux,gaurav1981/flux,Zagorakiss/flux,reinaldo13/flux,hoozi/flux,unidevel/flux,roshow/flux,RomanTsopin/flux,fauzan182/flux,lishengzxc/flux,gfogle/elm-todomvc,Aweary/flux,cgack/flux,ksivam/flux,cgack/flux,latkins/flux,rkho/flux,yanarchy/flux,ephetic/flux,gnoesiboe/flux,unidevel/flux,thewarpaint/flux,tom-mats/flux,soulcm/flux,bertomartin/flux,DimitarRuskov/flux,knrm/flux,lishengzxc/flux,chrismoulton/flux,avinnakota/flux,nikhyl/flux,gajus/flux,stevemao/flux,lgvalle/flux,latkins/flux,kaushik94/flux,YakovAvramenko/flux,tinygrasshopper/flux,magus0219/flux,Aweary/flux,DimitarRuskov/flux,tbutman/flux,nikhyl/flux,baiwyc119/flux,venkateshdaram434/flux,lgvalle/flux,georgetoothman/flux-todo,CedarLogic/flux,lifebeyondfife/flux-todomvc,rtfeldman/flux,alexeygusak/flux,Aweary/flux,doron2402/flux,thebergamo/flux,runn1ng/flux,yejodido/flux,ataker/flux,taylorhxu/flux,taylorhxu/flux,juliangamble/flux,lauramoore/flux,zshift/flux,usufruct/flux,gaurav1981/flux,briantopping/flux,aaron-goshine/flux,robhogfeldt-fron15/flux,lauramoore/flux,shunyitian/flux,mattvanhorn/flux,jonathanpeterwu/flux,amoskyler/flux,jarl-alejandro/flux,davidgbe/flux,songguangyu/flux,tcxq42aa/flux,gajus/flux,tom-mats/flux,albi34/flux,unidevel/flux,djfm/flux,doxiaodong/flux,nvoron23/flux,thadiggitystank/flux,hokennethk/flux,grandsong/flux,aecca/flux,wrrnwng/flux,birendra-ideas2it/flux,blazenko/flux,kaushik94/flux,lyip1992/flux,ruistime/flux,lifebeyondfife/flux-todomvc,dmlinn/flux,viviancpy/flux,lishengzxc/flux,baijuachari/flux,tcat/flux,james4388/flux,bilboJ/flux,UIKit0/flux-1,oopchoi/flux,crsgypin/flux,gold3bear/flux,maksymshtyria/flux,jmandel/flux,0rangeT1ger/flux,doron2402/flux,tom-mats/flux,0rangeT1ger/flux,lilien1010/flux,alexeybondarenko/flux,UIKit0/flux-1,dbenson24/flux,micahlmartin/flux,tcxq42aa/flux,tcat/flux,robhogfeldt-fron15/flux,superphung/flux,danielchatfield/flux,monkeyFeathers/flux,wrrnwng/flux,rachidmrad/flux,haruair/flux,vijayasingh523/flux,alemontree/flux,ruistime/flux,justin3737/flux,chikamichi/flux,jugend/flux,dbenson24/flux,gajus/flux,juliangamble/flux,alucas/flux,steveleec/flux,Binzzzz/flux,MjAbuz/flux,doxiaodong/flux,zshift/flux,aijiekj/flux,ruistime/flux,debbas/ChatV2,johan/flux,jinkea/flux,eclectriq/flux,icefoggy/flux,crzidea/flux,garylgh/flux,lgvalle/flux,reinaldo13/flux,kangkot/flux,topogigiovanni/flux,Chen-Han/flux,vijayasingh523/flux,rkho/flux,songguangyu/flux,mircle/flux,jonathanpeterwu/flux,zachwooddoughty/flux,slapheadted/flux-nukebox,Lhuihui/flux,hanan198501/flux,sibinx7/flux,chenckang/flux,v2018z/flux,alemontree/flux,rachidmrad/flux,debbas/ChatV2,gougouGet/flux,ephetic/flux,JunyaOnishi/flux,mcanthony/flux,siddhartharay007/flux,zhzenghui/flux,sahat/flux,v2018z/flux,micahlmartin/flux,CedarLogic/flux,juliangamble/flux,grandsong/flux,akhilxavierm/flux,jeffj/flux,YakovAvramenko/flux,LeeChSien/flux,kris1226/flux,maximvl/flux,soulcm/flux,albi34/flux,Lhuihui/flux,avinnakota/flux,icefoggy/flux,ataker/flux,lyip1992/flux,chikamichi/flux,zachwooddoughty/flux,johan/flux,rohannair/flux,shunyitian/flux,rtfeldman/flux,chenrui2014/flux,roshow/flux,topogigiovanni/flux,Jonekee/flux,gougouGet/flux,blazenko/flux,mattvanhorn/flux,LeeChSien/flux,monkeyFeathers/flux,tbutman/flux,wandrejevic/flux,chenckang/flux,georgetoothman/flux-todo,MjAbuz/flux,glitch100/flux,amoskyler/flux,slapheadted/flux-nukebox,jdholdren/flux,chienchienchen/flux,Demian-Moschin/flux,aijiekj/flux,yejodido/flux,tcat/flux,reinaldo13/flux,cjmanetta/flux,briantopping/flux,aecca/flux,gold3bear/flux,crsr/flux | javascript | ## Code Before:
/**
* This file is provided by Facebook for testing and evaluation purposes
* only. Facebook reserves all rights not expressly granted.
*
* 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
* FACEBOOK 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.
*
* @jsx React.DOM
*/
// This file bootstraps the entire application.
var ChatApp = require('./components/ChatApp.react');
var ChatExampleData = require('./ChatExampleData');
var ChatWebAPIUtils = require('./utils/ChatWebAPIUtils');
var React = require('react');
ChatExampleData.init(); // load example data into localstorage
ChatWebAPIUtils.getAllMessages();
React.renderComponent(
<ChatApp />,
document.getElementById('react')
);
## Instruction:
Enable React devtools by exposing React (setting window.React)
## Code After:
/**
* This file is provided by Facebook for testing and evaluation purposes
* only. Facebook reserves all rights not expressly granted.
*
* 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
* FACEBOOK 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.
*
* @jsx React.DOM
*/
// This file bootstraps the entire application.
var ChatApp = require('./components/ChatApp.react');
var ChatExampleData = require('./ChatExampleData');
var ChatWebAPIUtils = require('./utils/ChatWebAPIUtils');
var React = require('react');
window.React = React; // export for http://fb.me/react-devtools
ChatExampleData.init(); // load example data into localstorage
ChatWebAPIUtils.getAllMessages();
React.renderComponent(
<ChatApp />,
document.getElementById('react')
);
| /**
* This file is provided by Facebook for testing and evaluation purposes
* only. Facebook reserves all rights not expressly granted.
*
* 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
* FACEBOOK 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.
*
* @jsx React.DOM
*/
// This file bootstraps the entire application.
var ChatApp = require('./components/ChatApp.react');
var ChatExampleData = require('./ChatExampleData');
var ChatWebAPIUtils = require('./utils/ChatWebAPIUtils');
var React = require('react');
+ window.React = React; // export for http://fb.me/react-devtools
ChatExampleData.init(); // load example data into localstorage
ChatWebAPIUtils.getAllMessages();
React.renderComponent(
<ChatApp />,
document.getElementById('react')
); | 1 | 0.034483 | 1 | 0 |
70672da6b94ae0f272bd875e4aede28fab7aeb6f | pyluos/io/ws.py | pyluos/io/ws.py | import os
import socket
import websocket
from . import IOHandler
def resolve_hostname(hostname, port):
# We do our own mDNS resolution
# to enforce we only search for IPV4 address
# and avoid a 5s timeout in the websocket on the ESP
# See https://github.com/esp8266/Arduino/issues/2110
addrinfo = socket.getaddrinfo(hostname, port,
socket.AF_INET, 0,
socket.SOL_TCP)
addr = addrinfo[0][4][0]
return addr
class Ws(IOHandler):
@classmethod
def is_host_compatible(cls, host):
try:
socket.inet_pton(socket.AF_INET, host)
return True
except socket.error:
return host.endswith('.local')
@classmethod
def available_hosts(cls):
hosts = ['pi-gate.local']
return [
ip
for ip in hosts
if os.system('ping -c 1 -W1 -t1 {} > /dev/null 2>&1'.format(ip)) == 0
]
def __init__(self, host, port=9342):
host = resolve_hostname(host, port)
url = 'ws://{}:{}'.format(host, port)
self._ws = websocket.create_connection(url)
def is_ready(self):
return True
def recv(self):
return self._ws.recv()
def write(self, data):
self._ws.send(data)
def close(self):
self._ws.close()
| import os
import socket
import websocket
from . import IOHandler
def resolve_hostname(hostname, port):
# We do our own mDNS resolution
# to enforce we only search for IPV4 address
# and avoid a 5s timeout in the websocket on the ESP
# See https://github.com/esp8266/Arduino/issues/2110
addrinfo = socket.getaddrinfo(hostname, port,
socket.AF_INET, 0,
socket.SOL_TCP)
addr = addrinfo[0][4][0]
return addr
class Ws(IOHandler):
@classmethod
def is_host_compatible(cls, host):
try:
socket.inet_pton(socket.AF_INET, host)
return True
except socket.error:
return host.endswith('.local')
@classmethod
def available_hosts(cls):
hosts = ['pi-gate.local']
return [
ip
for ip in hosts
if os.system('ping -c 1 -W1 -t1 {} > /dev/null 2>&1'.format(ip)) == 0
]
def __init__(self, host, port=9342):
host = resolve_hostname(host, port)
url = 'ws://{}:{}'.format(host, port)
self._ws = websocket.create_connection(url)
def is_ready(self):
return True
def recv(self):
return self._ws.recv()
def write(self, data):
self._ws.send(data + '\r'.encode())
def close(self):
self._ws.close()
| Add \r at the end of Web socket | Add \r at the end of Web socket
| Python | mit | pollen/pyrobus | python | ## Code Before:
import os
import socket
import websocket
from . import IOHandler
def resolve_hostname(hostname, port):
# We do our own mDNS resolution
# to enforce we only search for IPV4 address
# and avoid a 5s timeout in the websocket on the ESP
# See https://github.com/esp8266/Arduino/issues/2110
addrinfo = socket.getaddrinfo(hostname, port,
socket.AF_INET, 0,
socket.SOL_TCP)
addr = addrinfo[0][4][0]
return addr
class Ws(IOHandler):
@classmethod
def is_host_compatible(cls, host):
try:
socket.inet_pton(socket.AF_INET, host)
return True
except socket.error:
return host.endswith('.local')
@classmethod
def available_hosts(cls):
hosts = ['pi-gate.local']
return [
ip
for ip in hosts
if os.system('ping -c 1 -W1 -t1 {} > /dev/null 2>&1'.format(ip)) == 0
]
def __init__(self, host, port=9342):
host = resolve_hostname(host, port)
url = 'ws://{}:{}'.format(host, port)
self._ws = websocket.create_connection(url)
def is_ready(self):
return True
def recv(self):
return self._ws.recv()
def write(self, data):
self._ws.send(data)
def close(self):
self._ws.close()
## Instruction:
Add \r at the end of Web socket
## Code After:
import os
import socket
import websocket
from . import IOHandler
def resolve_hostname(hostname, port):
# We do our own mDNS resolution
# to enforce we only search for IPV4 address
# and avoid a 5s timeout in the websocket on the ESP
# See https://github.com/esp8266/Arduino/issues/2110
addrinfo = socket.getaddrinfo(hostname, port,
socket.AF_INET, 0,
socket.SOL_TCP)
addr = addrinfo[0][4][0]
return addr
class Ws(IOHandler):
@classmethod
def is_host_compatible(cls, host):
try:
socket.inet_pton(socket.AF_INET, host)
return True
except socket.error:
return host.endswith('.local')
@classmethod
def available_hosts(cls):
hosts = ['pi-gate.local']
return [
ip
for ip in hosts
if os.system('ping -c 1 -W1 -t1 {} > /dev/null 2>&1'.format(ip)) == 0
]
def __init__(self, host, port=9342):
host = resolve_hostname(host, port)
url = 'ws://{}:{}'.format(host, port)
self._ws = websocket.create_connection(url)
def is_ready(self):
return True
def recv(self):
return self._ws.recv()
def write(self, data):
self._ws.send(data + '\r'.encode())
def close(self):
self._ws.close()
| import os
import socket
import websocket
from . import IOHandler
def resolve_hostname(hostname, port):
# We do our own mDNS resolution
# to enforce we only search for IPV4 address
# and avoid a 5s timeout in the websocket on the ESP
# See https://github.com/esp8266/Arduino/issues/2110
addrinfo = socket.getaddrinfo(hostname, port,
socket.AF_INET, 0,
socket.SOL_TCP)
addr = addrinfo[0][4][0]
return addr
class Ws(IOHandler):
@classmethod
def is_host_compatible(cls, host):
try:
socket.inet_pton(socket.AF_INET, host)
return True
except socket.error:
return host.endswith('.local')
@classmethod
def available_hosts(cls):
hosts = ['pi-gate.local']
return [
ip
for ip in hosts
if os.system('ping -c 1 -W1 -t1 {} > /dev/null 2>&1'.format(ip)) == 0
]
def __init__(self, host, port=9342):
host = resolve_hostname(host, port)
url = 'ws://{}:{}'.format(host, port)
self._ws = websocket.create_connection(url)
def is_ready(self):
return True
def recv(self):
return self._ws.recv()
def write(self, data):
- self._ws.send(data)
+ self._ws.send(data + '\r'.encode())
? +++++++++++++++ +
def close(self):
self._ws.close() | 2 | 0.035714 | 1 | 1 |
e1d42d4c47ad82fee5090410cb0084053a4f0bc0 | README.md | README.md | Online documentation:
http://digipost.github.io/digipost-api-client-dotnet/
|
Online documentation: http://digipost.github.io/digipost-api-client-dotnet/
An example web application that uses this client library can be found at https://github.com/digipost/digipost-client-lib-webapp-dotnet
| Add reference to example site in readme | Add reference to example site in readme | Markdown | apache-2.0 | digipost/digipost-api-client-dotnet | markdown | ## Code Before:
Online documentation:
http://digipost.github.io/digipost-api-client-dotnet/
## Instruction:
Add reference to example site in readme
## Code After:
Online documentation: http://digipost.github.io/digipost-api-client-dotnet/
An example web application that uses this client library can be found at https://github.com/digipost/digipost-client-lib-webapp-dotnet
| - Online documentation:
+
- http://digipost.github.io/digipost-api-client-dotnet/
+ Online documentation: http://digipost.github.io/digipost-api-client-dotnet/
? ++++++++++++++++++++++
+
+ An example web application that uses this client library can be found at https://github.com/digipost/digipost-client-lib-webapp-dotnet | 6 | 3 | 4 | 2 |
1739dfa999a6a5e0e317944cc7150d65326dd654 | lib/ffi-proj4/point.rb | lib/ffi-proj4/point.rb |
module Proj4
class Point < Struct.new(:x, :y, :z)
end
end
|
module Proj4
class Point
attr_accessor :x, :y, :z
def initialize(x, y, z = nil)
@x, @y, @z = x, y, z
end
end
end
| Convert Proj4::Point away from a Struct. | Convert Proj4::Point away from a Struct.
| Ruby | mit | dark-panda/ffi-proj4 | ruby | ## Code Before:
module Proj4
class Point < Struct.new(:x, :y, :z)
end
end
## Instruction:
Convert Proj4::Point away from a Struct.
## Code After:
module Proj4
class Point
attr_accessor :x, :y, :z
def initialize(x, y, z = nil)
@x, @y, @z = x, y, z
end
end
end
|
module Proj4
- class Point < Struct.new(:x, :y, :z)
+ class Point
+ attr_accessor :x, :y, :z
+
+ def initialize(x, y, z = nil)
+ @x, @y, @z = x, y, z
+ end
end
end | 7 | 1.4 | 6 | 1 |
a50d4372548222c70255cf118acf9ea67a8d149e | wiki/FitNesseRoot/HsacAcceptanceTests/SlimTests/BrowserTest/FileUploadTest.wiki | wiki/FitNesseRoot/HsacAcceptanceTests/SlimTests/BrowserTest/FileUploadTest.wiki | This test ensures we can deal with file upload inputs.
!define HTML { {{{
<html>
<body>
Choose file:
<input name="chosenFile" type="file">
<input name="chosenFile2" type="file">
<button>Upload</button>
</body>
</html>}}} }
|script |mock xml server setup|
|add response|${HTML} |
|$url= |get mock server url |
|script |file fixture |
|$generated=|create|bye1.txt|containing|Bye Bye 1|
|script |browser test |
|open |$url |
|note |Select file for first file upload on page |
|select file|$generated |
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|!--! |
|note |Select file for specific file upload on page|
|select file|$generated|for |name=chosenFile2|
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|=~/bye1.txt/ |
|script|mock xml server setup|
|stop |
| ---
Help: Skipped because PhantomJs on Linux seems to crash when using file inputs.
Prune
---
This test ensures we can deal with file upload inputs.
!define HTML { {{{
<html>
<body>
Choose file:
<input name="chosenFile" type="file">
<input name="chosenFile2" type="file">
<button>Upload</button>
</body>
</html>}}} }
|script |mock xml server setup|
|add response|${HTML} |
|$url= |get mock server url |
|script |file fixture |
|$generated=|create|bye1.txt|containing|Bye Bye 1|
|script |browser test |
|open |$url |
|note |Select file for first file upload on page |
|select file|$generated |
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|!--! |
|note |Select file for specific file upload on page|
|select file|$generated|for |name=chosenFile2|
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|=~/bye1.txt/ |
|script|mock xml server setup|
|stop |
| Downgrade to latest phantomjs driver from codeborn, see whether that supports Java 7 | Downgrade to latest phantomjs driver from codeborn, see whether that supports Java 7
| MediaWiki | apache-2.0 | GDasai/hsac-fitnesse-fixtures,ilseh/hsac-fitnesse-fixtures,ilseh/hsac-fitnesse-fixtures,GDasai/hsac-fitnesse-fixtures,teunisnl/hsac-fitnesse-fixtures,ilseh/hsac-fitnesse-fixtures,fhoeben/hsac-fitnesse-fixtures,fhoeben/hsac-fitnesse-fixtures,ilseh/hsac-fitnesse-fixtures,fhoeben/hsac-fitnesse-fixtures,teunisnl/hsac-fitnesse-fixtures,teunisnl/hsac-fitnesse-fixtures,GDasai/hsac-fitnesse-fixtures,fhoeben/hsac-fitnesse-fixtures,GDasai/hsac-fitnesse-fixtures,teunisnl/hsac-fitnesse-fixtures | mediawiki | ## Code Before:
This test ensures we can deal with file upload inputs.
!define HTML { {{{
<html>
<body>
Choose file:
<input name="chosenFile" type="file">
<input name="chosenFile2" type="file">
<button>Upload</button>
</body>
</html>}}} }
|script |mock xml server setup|
|add response|${HTML} |
|$url= |get mock server url |
|script |file fixture |
|$generated=|create|bye1.txt|containing|Bye Bye 1|
|script |browser test |
|open |$url |
|note |Select file for first file upload on page |
|select file|$generated |
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|!--! |
|note |Select file for specific file upload on page|
|select file|$generated|for |name=chosenFile2|
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|=~/bye1.txt/ |
|script|mock xml server setup|
|stop |
## Instruction:
Downgrade to latest phantomjs driver from codeborn, see whether that supports Java 7
## Code After:
---
Help: Skipped because PhantomJs on Linux seems to crash when using file inputs.
Prune
---
This test ensures we can deal with file upload inputs.
!define HTML { {{{
<html>
<body>
Choose file:
<input name="chosenFile" type="file">
<input name="chosenFile2" type="file">
<button>Upload</button>
</body>
</html>}}} }
|script |mock xml server setup|
|add response|${HTML} |
|$url= |get mock server url |
|script |file fixture |
|$generated=|create|bye1.txt|containing|Bye Bye 1|
|script |browser test |
|open |$url |
|note |Select file for first file upload on page |
|select file|$generated |
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|!--! |
|note |Select file for specific file upload on page|
|select file|$generated|for |name=chosenFile2|
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|=~/bye1.txt/ |
|script|mock xml server setup|
|stop |
| + ---
+ Help: Skipped because PhantomJs on Linux seems to crash when using file inputs.
+ Prune
+ ---
This test ensures we can deal with file upload inputs.
!define HTML { {{{
<html>
<body>
Choose file:
<input name="chosenFile" type="file">
<input name="chosenFile2" type="file">
<button>Upload</button>
</body>
</html>}}} }
|script |mock xml server setup|
|add response|${HTML} |
|$url= |get mock server url |
|script |file fixture |
|$generated=|create|bye1.txt|containing|Bye Bye 1|
|script |browser test |
|open |$url |
|note |Select file for first file upload on page |
|select file|$generated |
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|!--! |
|note |Select file for specific file upload on page|
|select file|$generated|for |name=chosenFile2|
|check |value of |name=chosenFile |=~/bye1.txt/ |
|check |value of |name=chosenFile2|=~/bye1.txt/ |
|script|mock xml server setup|
|stop |
| 4 | 0.108108 | 4 | 0 |
df803f1c85bfe832438edd2e6fd4623ae18f1ce2 | src/bits64/mod.rs | src/bits64/mod.rs | //! Data structures and functions used by IA-32e but not Protected Mode.
macro_rules! bit {
( $x:expr ) => {
1 << $x
};
}
macro_rules! check_flag {
($doc:meta, $fun:ident, $flag:ident) => (
#[$doc]
pub fn $fun(&self) -> bool {
self.contains($flag)
}
)
}
macro_rules! is_bit_set {
($field:expr, $bit:expr) => (
$field & (1 << $bit) > 0
)
}
macro_rules! check_bit_fn {
($doc:meta, $fun:ident, $field:ident, $bit:expr) => (
#[$doc]
pub fn $fun(&self) -> bool {
is_bit_set!(self.$field, $bit)
}
)
}
pub mod time;
pub mod irq;
pub mod paging;
pub mod task;
pub mod syscall;
pub mod sgx;
| //! Data structures and functions used by IA-32e but not Protected Mode.
macro_rules! bit {
( $x:expr ) => {
1 << $x
};
}
macro_rules! check_flag {
($doc:meta, $fun:ident, $flag:ident) => (
#[$doc]
pub fn $fun(&self) -> bool {
self.contains($flag)
}
)
}
pub mod time;
pub mod irq;
pub mod paging;
pub mod task;
pub mod syscall;
pub mod sgx;
| Remove unused macros causing compiler warnings. | Remove unused macros causing compiler warnings.
I also don't see how these are x86-64-specific, so they should be removed either way.
| Rust | mit | gz/rust-x86,gz/rust-x86 | rust | ## Code Before:
//! Data structures and functions used by IA-32e but not Protected Mode.
macro_rules! bit {
( $x:expr ) => {
1 << $x
};
}
macro_rules! check_flag {
($doc:meta, $fun:ident, $flag:ident) => (
#[$doc]
pub fn $fun(&self) -> bool {
self.contains($flag)
}
)
}
macro_rules! is_bit_set {
($field:expr, $bit:expr) => (
$field & (1 << $bit) > 0
)
}
macro_rules! check_bit_fn {
($doc:meta, $fun:ident, $field:ident, $bit:expr) => (
#[$doc]
pub fn $fun(&self) -> bool {
is_bit_set!(self.$field, $bit)
}
)
}
pub mod time;
pub mod irq;
pub mod paging;
pub mod task;
pub mod syscall;
pub mod sgx;
## Instruction:
Remove unused macros causing compiler warnings.
I also don't see how these are x86-64-specific, so they should be removed either way.
## Code After:
//! Data structures and functions used by IA-32e but not Protected Mode.
macro_rules! bit {
( $x:expr ) => {
1 << $x
};
}
macro_rules! check_flag {
($doc:meta, $fun:ident, $flag:ident) => (
#[$doc]
pub fn $fun(&self) -> bool {
self.contains($flag)
}
)
}
pub mod time;
pub mod irq;
pub mod paging;
pub mod task;
pub mod syscall;
pub mod sgx;
| //! Data structures and functions used by IA-32e but not Protected Mode.
macro_rules! bit {
( $x:expr ) => {
1 << $x
};
}
macro_rules! check_flag {
($doc:meta, $fun:ident, $flag:ident) => (
#[$doc]
pub fn $fun(&self) -> bool {
self.contains($flag)
}
)
}
- macro_rules! is_bit_set {
- ($field:expr, $bit:expr) => (
- $field & (1 << $bit) > 0
- )
- }
-
- macro_rules! check_bit_fn {
- ($doc:meta, $fun:ident, $field:ident, $bit:expr) => (
- #[$doc]
- pub fn $fun(&self) -> bool {
- is_bit_set!(self.$field, $bit)
- }
- )
- }
-
pub mod time;
pub mod irq;
pub mod paging;
pub mod task;
pub mod syscall;
pub mod sgx; | 15 | 0.394737 | 0 | 15 |
d9ed160e54ff40783a007154e194767af0574ec1 | setup.py | setup.py |
import sys
if sys.version_info < (3,):
sys.exit("catimg requires Python 3")
from setuptools import setup
import versioneer
setup(
name='catimg',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='''Print an image of a cat from Imgur to iTerm2.''',
author='Aaron Meurer',
author_email='asmeurer@gmail.com',
url='https://github.com/asmeurer/catimg',
packages=['catimg'],
package_data={'catimg.tests': ['aloha_cat.png']},
long_description="""
catimg
Uses iTerm2's proprietary escape codes and Imgur to display an image of a cat
in your terminal.
NOTE: I do not own the images that you see, nor have I any control over
them. You will see some image that is tagged as "cat" on Imgur. That could be
anything. I do filter out images that are tagged NSFW, but there are no
guarantees that you won't see something you wish you hadn't. Use at your own
risk.
License: MIT
""",
entry_points={'console_scripts': [ 'catimg = catimg.__main__:main']},
install_requires=[
'requests',
'imgurpython',
],
license="MIT",
classifiers=[
'Environment :: MacOS X',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Python :: 3',
],
zip_safe=False,
)
|
import sys
if sys.version_info < (3,):
sys.exit("catimg requires Python 3")
from setuptools import setup
import versioneer
setup(
name='catimg',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='''Print an image of a cat from Imgur to iTerm2.''',
author='Aaron Meurer',
author_email='asmeurer@gmail.com',
url='https://github.com/asmeurer/catimg',
packages=['catimg', 'catimg.tests'],
package_data={'catimg.tests': ['aloha_cat.png']},
long_description="""
catimg
Uses iTerm2's proprietary escape codes and Imgur to display an image of a cat
in your terminal.
NOTE: I do not own the images that you see, nor have I any control over
them. You will see some image that is tagged as "cat" on Imgur. That could be
anything. I do filter out images that are tagged NSFW, but there are no
guarantees that you won't see something you wish you hadn't. Use at your own
risk.
License: MIT
""",
entry_points={'console_scripts': [ 'catimg = catimg.__main__:main']},
install_requires=[
'requests',
'imgurpython',
],
license="MIT",
classifiers=[
'Environment :: MacOS X',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Python :: 3',
],
zip_safe=False,
)
| Include the tests in the install | Include the tests in the install
| Python | mit | asmeurer/catimg | python | ## Code Before:
import sys
if sys.version_info < (3,):
sys.exit("catimg requires Python 3")
from setuptools import setup
import versioneer
setup(
name='catimg',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='''Print an image of a cat from Imgur to iTerm2.''',
author='Aaron Meurer',
author_email='asmeurer@gmail.com',
url='https://github.com/asmeurer/catimg',
packages=['catimg'],
package_data={'catimg.tests': ['aloha_cat.png']},
long_description="""
catimg
Uses iTerm2's proprietary escape codes and Imgur to display an image of a cat
in your terminal.
NOTE: I do not own the images that you see, nor have I any control over
them. You will see some image that is tagged as "cat" on Imgur. That could be
anything. I do filter out images that are tagged NSFW, but there are no
guarantees that you won't see something you wish you hadn't. Use at your own
risk.
License: MIT
""",
entry_points={'console_scripts': [ 'catimg = catimg.__main__:main']},
install_requires=[
'requests',
'imgurpython',
],
license="MIT",
classifiers=[
'Environment :: MacOS X',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Python :: 3',
],
zip_safe=False,
)
## Instruction:
Include the tests in the install
## Code After:
import sys
if sys.version_info < (3,):
sys.exit("catimg requires Python 3")
from setuptools import setup
import versioneer
setup(
name='catimg',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='''Print an image of a cat from Imgur to iTerm2.''',
author='Aaron Meurer',
author_email='asmeurer@gmail.com',
url='https://github.com/asmeurer/catimg',
packages=['catimg', 'catimg.tests'],
package_data={'catimg.tests': ['aloha_cat.png']},
long_description="""
catimg
Uses iTerm2's proprietary escape codes and Imgur to display an image of a cat
in your terminal.
NOTE: I do not own the images that you see, nor have I any control over
them. You will see some image that is tagged as "cat" on Imgur. That could be
anything. I do filter out images that are tagged NSFW, but there are no
guarantees that you won't see something you wish you hadn't. Use at your own
risk.
License: MIT
""",
entry_points={'console_scripts': [ 'catimg = catimg.__main__:main']},
install_requires=[
'requests',
'imgurpython',
],
license="MIT",
classifiers=[
'Environment :: MacOS X',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Python :: 3',
],
zip_safe=False,
)
|
import sys
if sys.version_info < (3,):
sys.exit("catimg requires Python 3")
from setuptools import setup
import versioneer
setup(
name='catimg',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='''Print an image of a cat from Imgur to iTerm2.''',
author='Aaron Meurer',
author_email='asmeurer@gmail.com',
url='https://github.com/asmeurer/catimg',
- packages=['catimg'],
+ packages=['catimg', 'catimg.tests'],
? ++++++++++++++++
package_data={'catimg.tests': ['aloha_cat.png']},
long_description="""
catimg
Uses iTerm2's proprietary escape codes and Imgur to display an image of a cat
in your terminal.
NOTE: I do not own the images that you see, nor have I any control over
them. You will see some image that is tagged as "cat" on Imgur. That could be
anything. I do filter out images that are tagged NSFW, but there are no
guarantees that you won't see something you wish you hadn't. Use at your own
risk.
License: MIT
""",
entry_points={'console_scripts': [ 'catimg = catimg.__main__:main']},
install_requires=[
'requests',
'imgurpython',
],
license="MIT",
classifiers=[
'Environment :: MacOS X',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Python :: 3',
],
zip_safe=False,
) | 2 | 0.043478 | 1 | 1 |
02ff3f6c090b6cfb423fcca0b4af925014d1eaf2 | applications/opibuilder/opibuilder-plugins/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/CssEntityResolver.java | applications/opibuilder/opibuilder-plugins/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/CssEntityResolver.java | package org.csstudio.opibuilder.scriptUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import org.csstudio.opibuilder.util.ResourceUtil;
import org.eclipse.core.runtime.IPath;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class CssEntityResolver implements EntityResolver {
@Override
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException {
try {
URI uri = new URI(systemId);
File file = new File(uri);
if(!file.exists()) {
IPath path = ResourceUtil.getPathFromString(file.getPath());
InputStream inputStream = ResourceUtil.pathToInputStream(path);
if(inputStream != null) {
return new InputSource(inputStream);
}
}
} catch (Exception e) {
// Entity may not be found and this may throw exception. This is normal and FileUtil will revert to xi:fallback
}
return null;
}
}
| package org.csstudio.opibuilder.scriptUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import org.csstudio.opibuilder.util.ResourceUtil;
import org.eclipse.core.runtime.IPath;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class CssEntityResolver implements EntityResolver {
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
try {
URI uri = new URI(systemId);
File file = new File(uri);
if (!file.exists()) {
IPath path = ResourceUtil.getPathFromString(file.getPath());
InputStream inputStream = ResourceUtil.pathToInputStream(path);
if (inputStream != null) {
InputSource source = new InputSource(systemId);
source.setByteStream(inputStream);
return source;
}
}
} catch (Exception e) {
// Entity may not be found and this may throw exception. This is normal and FileUtil will revert to xi:fallback
}
return null;
}
}
| Fix for XInclude -- resolving entities with workspace relative path | Fix for XInclude -- resolving entities with workspace relative path
| Java | epl-1.0 | ControlSystemStudio/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,ControlSystemStudio/cs-studio,ControlSystemStudio/cs-studio,css-iter/cs-studio,css-iter/cs-studio,css-iter/cs-studio,css-iter/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,ControlSystemStudio/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio | java | ## Code Before:
package org.csstudio.opibuilder.scriptUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import org.csstudio.opibuilder.util.ResourceUtil;
import org.eclipse.core.runtime.IPath;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class CssEntityResolver implements EntityResolver {
@Override
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException {
try {
URI uri = new URI(systemId);
File file = new File(uri);
if(!file.exists()) {
IPath path = ResourceUtil.getPathFromString(file.getPath());
InputStream inputStream = ResourceUtil.pathToInputStream(path);
if(inputStream != null) {
return new InputSource(inputStream);
}
}
} catch (Exception e) {
// Entity may not be found and this may throw exception. This is normal and FileUtil will revert to xi:fallback
}
return null;
}
}
## Instruction:
Fix for XInclude -- resolving entities with workspace relative path
## Code After:
package org.csstudio.opibuilder.scriptUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import org.csstudio.opibuilder.util.ResourceUtil;
import org.eclipse.core.runtime.IPath;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class CssEntityResolver implements EntityResolver {
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
try {
URI uri = new URI(systemId);
File file = new File(uri);
if (!file.exists()) {
IPath path = ResourceUtil.getPathFromString(file.getPath());
InputStream inputStream = ResourceUtil.pathToInputStream(path);
if (inputStream != null) {
InputSource source = new InputSource(systemId);
source.setByteStream(inputStream);
return source;
}
}
} catch (Exception e) {
// Entity may not be found and this may throw exception. This is normal and FileUtil will revert to xi:fallback
}
return null;
}
}
| package org.csstudio.opibuilder.scriptUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import org.csstudio.opibuilder.util.ResourceUtil;
import org.eclipse.core.runtime.IPath;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class CssEntityResolver implements EntityResolver {
@Override
- public InputSource resolveEntity(String publicId, String systemId)
+ public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
? +++++++++++++++++++++++++++++++++++
- throws SAXException, IOException {
try {
- URI uri = new URI(systemId);
+ URI uri = new URI(systemId);
? +
- File file = new File(uri);
+ File file = new File(uri);
? +
- if(!file.exists()) {
+ if (!file.exists()) {
? + +
- IPath path = ResourceUtil.getPathFromString(file.getPath());
+ IPath path = ResourceUtil.getPathFromString(file.getPath());
? +
- InputStream inputStream = ResourceUtil.pathToInputStream(path);
+ InputStream inputStream = ResourceUtil.pathToInputStream(path);
? +
- if(inputStream != null) {
- return new InputSource(inputStream);
- }
- }
- } catch (Exception e) {
- // Entity may not be found and this may throw exception. This is normal and FileUtil will revert to xi:fallback
- }
+ if (inputStream != null) {
+ InputSource source = new InputSource(systemId);
+ source.setByteStream(inputStream);
+ return source;
+ }
+ }
+ } catch (Exception e) {
+ // Entity may not be found and this may throw exception. This is normal and FileUtil will revert to xi:fallback
+ }
- return null;
+ return null;
? +
}
} | 31 | 0.861111 | 16 | 15 |
644a25e2b61bec8847af2f6d64b9b41b8798092d | setup.py | setup.py |
from setuptools import setup, find_packages
VERSION = '0.4.2'
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='django-backupdb',
version=VERSION,
description='Management commands for backing up and restoring databases in Django.',
long_description=readme(),
author='Fusionbox programmers',
author_email='programmers@fusionbox.com',
keywords='django database backup',
url='https://github.com/fusionbox/django-backupdb',
packages=find_packages(exclude=('tests',)),
platforms='any',
license='BSD',
test_suite='nose.collector',
setup_requires=[
'nose==1.2.1',
'mock==1.0.1',
],
tests_require=[
'nose==1.2.1',
'mock==1.0.1',
],
install_requires=[
'django>=1.3',
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
],
)
|
from setuptools import setup, find_packages
VERSION = '0.4.2'
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='django-backupdb',
version=VERSION,
description='Management commands for backing up and restoring databases in Django.',
long_description=readme(),
author='Fusionbox programmers',
author_email='programmers@fusionbox.com',
keywords='django database backup',
url='https://github.com/fusionbox/django-backupdb',
packages=find_packages(exclude=('tests',)),
platforms='any',
license='BSD',
test_suite='nose.collector',
setup_requires=[
'nose==1.2.1',
'mock==1.0.1',
'coverage==3.6',
],
tests_require=[
'nose==1.2.1',
'mock==1.0.1',
'coverage==3.6',
],
install_requires=[
'django>=1.3',
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
],
)
| Add coverage as a testing requirement | Add coverage as a testing requirement
| Python | bsd-2-clause | fusionbox/django-backupdb | python | ## Code Before:
from setuptools import setup, find_packages
VERSION = '0.4.2'
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='django-backupdb',
version=VERSION,
description='Management commands for backing up and restoring databases in Django.',
long_description=readme(),
author='Fusionbox programmers',
author_email='programmers@fusionbox.com',
keywords='django database backup',
url='https://github.com/fusionbox/django-backupdb',
packages=find_packages(exclude=('tests',)),
platforms='any',
license='BSD',
test_suite='nose.collector',
setup_requires=[
'nose==1.2.1',
'mock==1.0.1',
],
tests_require=[
'nose==1.2.1',
'mock==1.0.1',
],
install_requires=[
'django>=1.3',
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
],
)
## Instruction:
Add coverage as a testing requirement
## Code After:
from setuptools import setup, find_packages
VERSION = '0.4.2'
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='django-backupdb',
version=VERSION,
description='Management commands for backing up and restoring databases in Django.',
long_description=readme(),
author='Fusionbox programmers',
author_email='programmers@fusionbox.com',
keywords='django database backup',
url='https://github.com/fusionbox/django-backupdb',
packages=find_packages(exclude=('tests',)),
platforms='any',
license='BSD',
test_suite='nose.collector',
setup_requires=[
'nose==1.2.1',
'mock==1.0.1',
'coverage==3.6',
],
tests_require=[
'nose==1.2.1',
'mock==1.0.1',
'coverage==3.6',
],
install_requires=[
'django>=1.3',
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
],
)
|
from setuptools import setup, find_packages
VERSION = '0.4.2'
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='django-backupdb',
version=VERSION,
description='Management commands for backing up and restoring databases in Django.',
long_description=readme(),
author='Fusionbox programmers',
author_email='programmers@fusionbox.com',
keywords='django database backup',
url='https://github.com/fusionbox/django-backupdb',
packages=find_packages(exclude=('tests',)),
platforms='any',
license='BSD',
test_suite='nose.collector',
setup_requires=[
'nose==1.2.1',
'mock==1.0.1',
+ 'coverage==3.6',
],
tests_require=[
'nose==1.2.1',
'mock==1.0.1',
+ 'coverage==3.6',
],
install_requires=[
'django>=1.3',
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
],
) | 2 | 0.047619 | 2 | 0 |
23f86686f94e792b31481855286f3d5f8b71abc1 | app/controllers/admin/journals_controller.rb | app/controllers/admin/journals_controller.rb | class Admin::JournalsController < ApplicationController
before_action :authenticate_user!
before_action :enforce_policy
respond_to :json
def index
respond_with current_user.administered_journals, each_serializer: AdminJournalSerializer, root: 'admin_journals'
end
def create
respond_with Journal.create journal_params
end
def update
journal = Journal.find(params[:id])
if journal.update(journal_params)
render json: journal, serializer: AdminJournalSerializer
else
respond_with journal
end
end
def upload_logo
journal = DownloadLogo.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
def upload_epub_cover
journal = DownloadEpubCover.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
private
def journal_params
params.require(:admin_journal).permit(:name, :description, :epub_cover, :epub_css, :pdf_css, :manuscript_css)
end
end
| class Admin::JournalsController < ApplicationController
before_action :authenticate_user!
before_action :enforce_policy
respond_to :json
def index
respond_with current_user.administered_journals, each_serializer: AdminJournalSerializer, root: 'admin_journals'
end
def create
respond_with Journal.create(journal_params), serializer: AdminJournalSerializer, root: 'admin_journals'
end
def update
journal = Journal.find(params[:id])
if journal.update(journal_params)
render json: journal, serializer: AdminJournalSerializer
else
respond_with journal
end
end
def upload_logo
journal = DownloadLogo.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
def upload_epub_cover
journal = DownloadEpubCover.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
private
def journal_params
params.require(:admin_journal).permit(:name, :description, :epub_cover, :epub_css, :pdf_css, :manuscript_css)
end
end
| Use AdminJournalSerializer after create too | Use AdminJournalSerializer after create too
| Ruby | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi | ruby | ## Code Before:
class Admin::JournalsController < ApplicationController
before_action :authenticate_user!
before_action :enforce_policy
respond_to :json
def index
respond_with current_user.administered_journals, each_serializer: AdminJournalSerializer, root: 'admin_journals'
end
def create
respond_with Journal.create journal_params
end
def update
journal = Journal.find(params[:id])
if journal.update(journal_params)
render json: journal, serializer: AdminJournalSerializer
else
respond_with journal
end
end
def upload_logo
journal = DownloadLogo.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
def upload_epub_cover
journal = DownloadEpubCover.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
private
def journal_params
params.require(:admin_journal).permit(:name, :description, :epub_cover, :epub_css, :pdf_css, :manuscript_css)
end
end
## Instruction:
Use AdminJournalSerializer after create too
## Code After:
class Admin::JournalsController < ApplicationController
before_action :authenticate_user!
before_action :enforce_policy
respond_to :json
def index
respond_with current_user.administered_journals, each_serializer: AdminJournalSerializer, root: 'admin_journals'
end
def create
respond_with Journal.create(journal_params), serializer: AdminJournalSerializer, root: 'admin_journals'
end
def update
journal = Journal.find(params[:id])
if journal.update(journal_params)
render json: journal, serializer: AdminJournalSerializer
else
respond_with journal
end
end
def upload_logo
journal = DownloadLogo.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
def upload_epub_cover
journal = DownloadEpubCover.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
private
def journal_params
params.require(:admin_journal).permit(:name, :description, :epub_cover, :epub_css, :pdf_css, :manuscript_css)
end
end
| class Admin::JournalsController < ApplicationController
before_action :authenticate_user!
before_action :enforce_policy
respond_to :json
def index
respond_with current_user.administered_journals, each_serializer: AdminJournalSerializer, root: 'admin_journals'
end
def create
- respond_with Journal.create journal_params
+ respond_with Journal.create(journal_params), serializer: AdminJournalSerializer, root: 'admin_journals'
end
def update
journal = Journal.find(params[:id])
if journal.update(journal_params)
render json: journal, serializer: AdminJournalSerializer
else
respond_with journal
end
end
def upload_logo
journal = DownloadLogo.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
def upload_epub_cover
journal = DownloadEpubCover.call(Journal.find(params[:id]), params[:url])
render json: journal, serializer: AdminJournalSerializer
end
private
def journal_params
params.require(:admin_journal).permit(:name, :description, :epub_cover, :epub_css, :pdf_css, :manuscript_css)
end
end | 2 | 0.05 | 1 | 1 |
c6c24874201427b307113e3949bed6b487934939 | lib/epub/search/database.rb | lib/epub/search/database.rb | module EPUB
module Search
class Database
FILE_NAME = 'epub-search.db'
def initialize(db_dir)
@db_dir = Pathname.new(db_dir)
end
def db_file
@db_file ||= @db_dir + FILE_NAME
end
def create(force=false)
@db_dir.rmtree if force
@db_dir.mkpath
Groonga::Context.default_options = {:encoding => :utf8}
Groonga::Database.create(:path => db_file.to_path)
Groonga::Schema.create_table 'Pages', :type => :array
Groonga::Schema.change_table 'Pages' do |table|
table.text 'location' # file path or URI
table.text 'iri' # inner IRI
table.text 'title'
table.text 'metadata'
table.text 'content'
end
Groonga::Schema.create_table 'Terms',
:type => :patricia_trie,
:normalizer => :NormalizerAuto,
:default_tokenizer => 'TokenBigram'
Groonga::Schema.change_table 'Terms' do |table|
table.index 'Pages.title'
table.index 'Pages.metadata'
table.index 'Pages.content'
end
end
end
end
end
| module EPUB
module Search
class Database
FILE_NAME = 'epub-search.db'
def initialize(db_dir)
@db_dir = Pathname.new(db_dir)
Groonga::Context.default_options = {:encoding => :utf8}
end
def db_file
@db_file ||= @db_dir + FILE_NAME
end
def create(force=false)
@db_dir.rmtree if force
@db_dir.mkpath
Groonga::Database.create(:path => db_file.to_path)
Groonga::Schema.create_table 'Pages', :type => :array
Groonga::Schema.change_table 'Pages' do |table|
table.text 'location' # file path or URI
table.text 'iri' # inner IRI
table.text 'title'
table.text 'metadata'
table.text 'content'
end
Groonga::Schema.create_table 'Terms',
:type => :patricia_trie,
:normalizer => :NormalizerAuto,
:default_tokenizer => 'TokenBigram'
Groonga::Schema.change_table 'Terms' do |table|
table.index 'Pages.title'
table.index 'Pages.metadata'
table.index 'Pages.content'
end
end
end
end
end
| Move setting of Groonga from action to initialize | Move setting of Groonga from action to initialize
| Ruby | mit | KitaitiMakoto/epub-search | ruby | ## Code Before:
module EPUB
module Search
class Database
FILE_NAME = 'epub-search.db'
def initialize(db_dir)
@db_dir = Pathname.new(db_dir)
end
def db_file
@db_file ||= @db_dir + FILE_NAME
end
def create(force=false)
@db_dir.rmtree if force
@db_dir.mkpath
Groonga::Context.default_options = {:encoding => :utf8}
Groonga::Database.create(:path => db_file.to_path)
Groonga::Schema.create_table 'Pages', :type => :array
Groonga::Schema.change_table 'Pages' do |table|
table.text 'location' # file path or URI
table.text 'iri' # inner IRI
table.text 'title'
table.text 'metadata'
table.text 'content'
end
Groonga::Schema.create_table 'Terms',
:type => :patricia_trie,
:normalizer => :NormalizerAuto,
:default_tokenizer => 'TokenBigram'
Groonga::Schema.change_table 'Terms' do |table|
table.index 'Pages.title'
table.index 'Pages.metadata'
table.index 'Pages.content'
end
end
end
end
end
## Instruction:
Move setting of Groonga from action to initialize
## Code After:
module EPUB
module Search
class Database
FILE_NAME = 'epub-search.db'
def initialize(db_dir)
@db_dir = Pathname.new(db_dir)
Groonga::Context.default_options = {:encoding => :utf8}
end
def db_file
@db_file ||= @db_dir + FILE_NAME
end
def create(force=false)
@db_dir.rmtree if force
@db_dir.mkpath
Groonga::Database.create(:path => db_file.to_path)
Groonga::Schema.create_table 'Pages', :type => :array
Groonga::Schema.change_table 'Pages' do |table|
table.text 'location' # file path or URI
table.text 'iri' # inner IRI
table.text 'title'
table.text 'metadata'
table.text 'content'
end
Groonga::Schema.create_table 'Terms',
:type => :patricia_trie,
:normalizer => :NormalizerAuto,
:default_tokenizer => 'TokenBigram'
Groonga::Schema.change_table 'Terms' do |table|
table.index 'Pages.title'
table.index 'Pages.metadata'
table.index 'Pages.content'
end
end
end
end
end
| module EPUB
module Search
class Database
FILE_NAME = 'epub-search.db'
def initialize(db_dir)
@db_dir = Pathname.new(db_dir)
+ Groonga::Context.default_options = {:encoding => :utf8}
end
def db_file
@db_file ||= @db_dir + FILE_NAME
end
def create(force=false)
@db_dir.rmtree if force
@db_dir.mkpath
- Groonga::Context.default_options = {:encoding => :utf8}
Groonga::Database.create(:path => db_file.to_path)
Groonga::Schema.create_table 'Pages', :type => :array
Groonga::Schema.change_table 'Pages' do |table|
table.text 'location' # file path or URI
table.text 'iri' # inner IRI
table.text 'title'
table.text 'metadata'
table.text 'content'
end
Groonga::Schema.create_table 'Terms',
:type => :patricia_trie,
:normalizer => :NormalizerAuto,
:default_tokenizer => 'TokenBigram'
Groonga::Schema.change_table 'Terms' do |table|
table.index 'Pages.title'
table.index 'Pages.metadata'
table.index 'Pages.content'
end
end
end
end
end | 2 | 0.051282 | 1 | 1 |
de85cd211c9dc5f59fe2856d0f67d8751f0caa64 | system/validator/SystemValidator.sh | system/validator/SystemValidator.sh | include system.System
@class
SystemValidator(){
isLinux(){
if [[ $(System getOS) =~ Linux ]]; then
echo true
fi
}
isWindows(){
if [[ $(System getOS) =~ NT ]]; then
echo true
fi
}
$@
} | include system.System
@class
SystemValidator(){
isLinux(){
if [[ $(System getOS) =~ Linux ]]; then
echo true
fi
}
isShell(){
case $TERM in
xterm|cygwin|rxvt) echo true ;;
esac
}
isWindows(){
if [[ $(System getOS) =~ NT ]]; then
echo true
fi
}
$@
} | Add function to check if terminal is shell emulator | Add function to check if terminal is shell emulator
| Shell | mit | anthony-chu/bash-toolbox | shell | ## Code Before:
include system.System
@class
SystemValidator(){
isLinux(){
if [[ $(System getOS) =~ Linux ]]; then
echo true
fi
}
isWindows(){
if [[ $(System getOS) =~ NT ]]; then
echo true
fi
}
$@
}
## Instruction:
Add function to check if terminal is shell emulator
## Code After:
include system.System
@class
SystemValidator(){
isLinux(){
if [[ $(System getOS) =~ Linux ]]; then
echo true
fi
}
isShell(){
case $TERM in
xterm|cygwin|rxvt) echo true ;;
esac
}
isWindows(){
if [[ $(System getOS) =~ NT ]]; then
echo true
fi
}
$@
} | include system.System
@class
SystemValidator(){
isLinux(){
if [[ $(System getOS) =~ Linux ]]; then
echo true
fi
}
+ isShell(){
+ case $TERM in
+ xterm|cygwin|rxvt) echo true ;;
+ esac
+ }
+
isWindows(){
if [[ $(System getOS) =~ NT ]]; then
echo true
fi
}
$@
} | 6 | 0.333333 | 6 | 0 |
2e661ce1500611586a404958caba7a10b1fc8a49 | index.html | index.html | <!DOCTYPE html>
<html>
<head>
<title>
Hedracide
</title>
</head>
<body>
A new way to kill yourself.
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>
Hedracide
</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
<body>
A new way to kill yourself.
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.js"></script>
<script>
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var geometry = new THREE.BoxGeometry( 1, 1, 1 );
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
var cube = new THREE.Mesh( geometry, material );
scene.add( cube );
camera.position.z = 5;
var render = function () {
requestAnimationFrame( render );
cube.rotation.x += 0.1;
cube.rotation.y += 0.1;
renderer.render(scene, camera);
};
render();
</script>
</body>
</html>
| Add spinning cube using three.js | Add spinning cube using three.js
| HTML | mit | bjwbell/hedracide,bjwbell/hedracide | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>
Hedracide
</title>
</head>
<body>
A new way to kill yourself.
</body>
</html>
## Instruction:
Add spinning cube using three.js
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>
Hedracide
</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
<body>
A new way to kill yourself.
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.js"></script>
<script>
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var geometry = new THREE.BoxGeometry( 1, 1, 1 );
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
var cube = new THREE.Mesh( geometry, material );
scene.add( cube );
camera.position.z = 5;
var render = function () {
requestAnimationFrame( render );
cube.rotation.x += 0.1;
cube.rotation.y += 0.1;
renderer.render(scene, camera);
};
render();
</script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>
Hedracide
</title>
+ <style>
+ body { margin: 0; }
+ canvas { width: 100%; height: 100% }
+ </style>
+
</head>
<body>
A new way to kill yourself.
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.js"></script>
+ <script>
+ var scene = new THREE.Scene();
+ var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
+
+ var renderer = new THREE.WebGLRenderer();
+ renderer.setSize( window.innerWidth, window.innerHeight );
+ document.body.appendChild( renderer.domElement );
+
+ var geometry = new THREE.BoxGeometry( 1, 1, 1 );
+ var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
+ var cube = new THREE.Mesh( geometry, material );
+ scene.add( cube );
+
+ camera.position.z = 5;
+
+ var render = function () {
+ requestAnimationFrame( render );
+
+ cube.rotation.x += 0.1;
+ cube.rotation.y += 0.1;
+
+ renderer.render(scene, camera);
+ };
+
+ render();
+ </script>
+
</body>
</html> | 33 | 3 | 33 | 0 |
3dee35fdc99e76b5c1cb3983723d5930df3fb046 | .travis.yml | .travis.yml | ---
language: python
python: "2.7"
script:
- make test-release
- make test-devel
| ---
language: python
python: "2.7"
matrix:
allow_failures:
- env: COMMAND=test-devel
include:
- env: COMMAND=test-release
- env: COMMAND=test-devel
script:
- make $COMMAND
| Use a build matrix, allow dev to fail. | Use a build matrix, allow dev to fail.
| YAML | mit | nsg/ansible-inventory,nsg/ansible-inventory | yaml | ## Code Before:
---
language: python
python: "2.7"
script:
- make test-release
- make test-devel
## Instruction:
Use a build matrix, allow dev to fail.
## Code After:
---
language: python
python: "2.7"
matrix:
allow_failures:
- env: COMMAND=test-devel
include:
- env: COMMAND=test-release
- env: COMMAND=test-devel
script:
- make $COMMAND
| ---
language: python
python: "2.7"
+ matrix:
+ allow_failures:
+ - env: COMMAND=test-devel
+ include:
+ - env: COMMAND=test-release
+ - env: COMMAND=test-devel
+
script:
+ - make $COMMAND
- - make test-release
- - make test-devel | 10 | 1.25 | 8 | 2 |
5dbdd276f3fdb0e2680bf740e4cf2f61b7747daf | README.md | README.md |
The Media Cloud Dashboard provides a common front-end interface for the Media Cloud data platform.
## Contents
* [Dependencies](#dependencies)
## Dependencies
* flask
* flask-login
* pymongo
|
The Media Cloud Dashboard provides a common front-end interface for the Media Cloud data platform.
## Contents
* [Dependencies](#dependencies)
* [Managing Users](#managing-users)
## Dependencies
* flask
* flask-login
* pymongo
## Managing Users
The command line tool `userconfig` can be used to add, modify, and remove users.
To see usage, just run `userconfig` with no arguments:
$ ./userconfig
Usage:
userconfig add <username> <password>
userconfig remove <username>
userconfig password <username> <password>
To add a user named `alice` with password `topsecret`:
$ ./userconfig add alice topsecret
To change the password for user `alice` to `bettersecret`:
$ ./userconfig password alice bettersecret
To remove user `alice`:
$ ./userconfig remove `alice`
| Add user management to readme. | Add user management to readme. | Markdown | apache-2.0 | c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Skeleton,c4fcm/MediaMeter-Frequency,c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Skeleton,c4fcm/MediaMeter-Frequency,c4fcm/MediaMeter-Mentions,c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Mentions,c4fcm/MediaMeter-Skeleton | markdown | ## Code Before:
The Media Cloud Dashboard provides a common front-end interface for the Media Cloud data platform.
## Contents
* [Dependencies](#dependencies)
## Dependencies
* flask
* flask-login
* pymongo
## Instruction:
Add user management to readme.
## Code After:
The Media Cloud Dashboard provides a common front-end interface for the Media Cloud data platform.
## Contents
* [Dependencies](#dependencies)
* [Managing Users](#managing-users)
## Dependencies
* flask
* flask-login
* pymongo
## Managing Users
The command line tool `userconfig` can be used to add, modify, and remove users.
To see usage, just run `userconfig` with no arguments:
$ ./userconfig
Usage:
userconfig add <username> <password>
userconfig remove <username>
userconfig password <username> <password>
To add a user named `alice` with password `topsecret`:
$ ./userconfig add alice topsecret
To change the password for user `alice` to `bettersecret`:
$ ./userconfig password alice bettersecret
To remove user `alice`:
$ ./userconfig remove `alice`
|
The Media Cloud Dashboard provides a common front-end interface for the Media Cloud data platform.
## Contents
* [Dependencies](#dependencies)
+ * [Managing Users](#managing-users)
## Dependencies
* flask
* flask-login
* pymongo
+ ## Managing Users
+ The command line tool `userconfig` can be used to add, modify, and remove users.
+
+ To see usage, just run `userconfig` with no arguments:
+ $ ./userconfig
+ Usage:
+ userconfig add <username> <password>
+ userconfig remove <username>
+ userconfig password <username> <password>
+
+ To add a user named `alice` with password `topsecret`:
+ $ ./userconfig add alice topsecret
+
+ To change the password for user `alice` to `bettersecret`:
+ $ ./userconfig password alice bettersecret
+
+ To remove user `alice`:
+ $ ./userconfig remove `alice` | 19 | 1.727273 | 19 | 0 |
0073a4d2e0b6b8e6c0227ad7297e1d085153c33b | spec/scanner_spec.rb | spec/scanner_spec.rb | require_relative '../lib/abcing/scanner.rb'
describe ABCing::Scanner do
it 'scans' do
params = { app_directories: [], test_directories: [] }
scanner = ABCing::Scanner.new(params)
end
context 'Raises an error' do
it 'when supplied with nil params' do
expect { ABCing::Scanner.new(nil) }.to raise_error()
end
end
end
| require_relative '../lib/abcing/scanner.rb'
describe ABCing::Scanner do
let(:empty_params) do
{ app_directories: [], test_directories: [] }
end
it 'scans' do
scanner = ABCing::Scanner.new(empty_params)
end
context 'Raises an error' do
it 'when supplied with nil params' do
expect { ABCing::Scanner.new(nil) }.to raise_error()
end
it 'when supplied incomplete data' do
empty_params.delete(:app_directories)
expect { ABCing::Scanner.new(empty_params) }.to raise_error()
empty_params.delete(:test_directories)
expect { ABCing::Scanner.new(empty_params) }.to raise_error()
end
end
end
| Test for missing params to scanner | Test for missing params to scanner
| Ruby | mit | emileswarts/abcing | ruby | ## Code Before:
require_relative '../lib/abcing/scanner.rb'
describe ABCing::Scanner do
it 'scans' do
params = { app_directories: [], test_directories: [] }
scanner = ABCing::Scanner.new(params)
end
context 'Raises an error' do
it 'when supplied with nil params' do
expect { ABCing::Scanner.new(nil) }.to raise_error()
end
end
end
## Instruction:
Test for missing params to scanner
## Code After:
require_relative '../lib/abcing/scanner.rb'
describe ABCing::Scanner do
let(:empty_params) do
{ app_directories: [], test_directories: [] }
end
it 'scans' do
scanner = ABCing::Scanner.new(empty_params)
end
context 'Raises an error' do
it 'when supplied with nil params' do
expect { ABCing::Scanner.new(nil) }.to raise_error()
end
it 'when supplied incomplete data' do
empty_params.delete(:app_directories)
expect { ABCing::Scanner.new(empty_params) }.to raise_error()
empty_params.delete(:test_directories)
expect { ABCing::Scanner.new(empty_params) }.to raise_error()
end
end
end
| require_relative '../lib/abcing/scanner.rb'
describe ABCing::Scanner do
+ let(:empty_params) do
+ { app_directories: [], test_directories: [] }
+ end
+
it 'scans' do
- params = { app_directories: [], test_directories: [] }
- scanner = ABCing::Scanner.new(params)
+ scanner = ABCing::Scanner.new(empty_params)
? ++++++
end
context 'Raises an error' do
it 'when supplied with nil params' do
expect { ABCing::Scanner.new(nil) }.to raise_error()
end
+
+ it 'when supplied incomplete data' do
+ empty_params.delete(:app_directories)
+ expect { ABCing::Scanner.new(empty_params) }.to raise_error()
+
+ empty_params.delete(:test_directories)
+ expect { ABCing::Scanner.new(empty_params) }.to raise_error()
+ end
end
end | 15 | 1.071429 | 13 | 2 |
0e280058561a9dcce9caeb27636c9a921a79d2b2 | HelloWorld/src/HelloWorld.java | HelloWorld/src/HelloWorld.java | import lejos.nxt.Button;
import lejos.nxt.LCD;
public class HelloWorld {
public static void main(String args[]) throws InterruptedException{
LCD.drawString("Hello World!", 1, 1);
Button.ESCAPE.waitForPressAndRelease();
}
}
| import lejos.nxt.Button;
import lejos.nxt.LCD;
public class HelloWorld {
public static void main(String args[]) throws InterruptedException{
LCD.drawString("Hello World!", 1, 1);
LCD.drawString("Second line", 1, 2);
Button.ESCAPE.waitForPressAndRelease();
}
}
| Test to update one line of code. | Test to update one line of code. | Java | mit | PeterOrneholm/penemunxt | java | ## Code Before:
import lejos.nxt.Button;
import lejos.nxt.LCD;
public class HelloWorld {
public static void main(String args[]) throws InterruptedException{
LCD.drawString("Hello World!", 1, 1);
Button.ESCAPE.waitForPressAndRelease();
}
}
## Instruction:
Test to update one line of code.
## Code After:
import lejos.nxt.Button;
import lejos.nxt.LCD;
public class HelloWorld {
public static void main(String args[]) throws InterruptedException{
LCD.drawString("Hello World!", 1, 1);
LCD.drawString("Second line", 1, 2);
Button.ESCAPE.waitForPressAndRelease();
}
}
| import lejos.nxt.Button;
import lejos.nxt.LCD;
public class HelloWorld {
public static void main(String args[]) throws InterruptedException{
LCD.drawString("Hello World!", 1, 1);
+ LCD.drawString("Second line", 1, 2);
Button.ESCAPE.waitForPressAndRelease();
}
} | 1 | 0.1 | 1 | 0 |
21717a7517d0328b424b9557c941bb7631ef16b3 | templates/index.html | templates/index.html | <!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fifth Postulate</title>
<link rel="stylesheet" href="css/fifth-postulate.css">
</head>
<body>
<section class="header">
<h1>Fifth Postulate</h1>
<ul>
<li>Consultancy</li>
<li>Training</li>
<li>Public Speaking</li>
</ul>
</section>
<section class="footer">
<dl>
<dt>KvK</dt>
<dd>65044649</dd>
<dt>Contact</dt>
<dd>info@fifth-postulate.nl</dd>
</dl>
</section>
<section class="content">
{{{content}}}
</section>
</body>
</html>
| <!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fifth Postulate</title>
<link rel="stylesheet" href="css/fifth-postulate.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/solarized-dark.min.css">
</head>
<body>
<section class="header">
<h1>Fifth Postulate</h1>
<ul>
<li>Consultancy</li>
<li>Training</li>
<li>Public Speaking</li>
</ul>
</section>
<section class="footer">
<dl>
<dt>KvK</dt>
<dd>65044649</dd>
<dt>Contact</dt>
<dd>info@fifth-postulate.nl</dd>
</dl>
</section>
<section class="content">
{{{content}}}
</section>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
| Use highlight.js for syntax highlighting | Use highlight.js for syntax highlighting
| HTML | cc0-1.0 | fifth-postulate/blog,fifth-postulate/blog | html | ## Code Before:
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fifth Postulate</title>
<link rel="stylesheet" href="css/fifth-postulate.css">
</head>
<body>
<section class="header">
<h1>Fifth Postulate</h1>
<ul>
<li>Consultancy</li>
<li>Training</li>
<li>Public Speaking</li>
</ul>
</section>
<section class="footer">
<dl>
<dt>KvK</dt>
<dd>65044649</dd>
<dt>Contact</dt>
<dd>info@fifth-postulate.nl</dd>
</dl>
</section>
<section class="content">
{{{content}}}
</section>
</body>
</html>
## Instruction:
Use highlight.js for syntax highlighting
## Code After:
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fifth Postulate</title>
<link rel="stylesheet" href="css/fifth-postulate.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/solarized-dark.min.css">
</head>
<body>
<section class="header">
<h1>Fifth Postulate</h1>
<ul>
<li>Consultancy</li>
<li>Training</li>
<li>Public Speaking</li>
</ul>
</section>
<section class="footer">
<dl>
<dt>KvK</dt>
<dd>65044649</dd>
<dt>Contact</dt>
<dd>info@fifth-postulate.nl</dd>
</dl>
</section>
<section class="content">
{{{content}}}
</section>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
| <!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fifth Postulate</title>
<link rel="stylesheet" href="css/fifth-postulate.css">
+ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/solarized-dark.min.css">
- </head>
? -
+ </head>
<body>
<section class="header">
<h1>Fifth Postulate</h1>
<ul>
<li>Consultancy</li>
<li>Training</li>
<li>Public Speaking</li>
</ul>
</section>
<section class="footer">
<dl>
<dt>KvK</dt>
<dd>65044649</dd>
<dt>Contact</dt>
<dd>info@fifth-postulate.nl</dd>
</dl>
</section>
<section class="content">
{{{content}}}
</section>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/highlight.min.js"></script>
+ <script>hljs.initHighlightingOnLoad();</script>
</body>
</html> | 5 | 0.172414 | 4 | 1 |
aa811476171e44238494d4f036d3c656a061cbc8 | grails-app/services/wirc/ClassifierService.groovy | grails-app/services/wirc/ClassifierService.groovy | package wirc
import com.heikkiv.ml.thomas.*
import com.heikkiv.ml.thomas.mongo.*
import javax.annotation.PostConstruct
class ClassifierService {
def grailsApplication
Classifier classifier
ClassifierService() {
classifier = new NaiveBayesClassifier()
classifier.repository = new MongoBayesClassifierRepository()
}
@PostConstruct
void setThreshold() {
classifier.setThreshold('work', grailsApplication.config.thomas.threshold as double)
}
void train(String document, String category) {
classifier.train(document, category)
}
String classify(String document) {
return classifier.classify(document)
}
}
| package wirc
import com.heikkiv.ml.thomas.*
import com.heikkiv.ml.thomas.mongo.*
import javax.annotation.PostConstruct
class ClassifierService {
def grailsApplication
Classifier classifier
ClassifierService() {
classifier = new NaiveBayesClassifier()
}
@PostConstruct
void setThreshold() {
classifier.setThreshold('work', grailsApplication.config.thomas.threshold as double)
}
void train(String document, String category) {
classifier.train(document, category)
}
String classify(String document) {
return classifier.classify(document)
}
}
| Use in memory classifier db | Use in memory classifier db
| Groovy | mit | heikkiv/wirc,heikkiv/wirc | groovy | ## Code Before:
package wirc
import com.heikkiv.ml.thomas.*
import com.heikkiv.ml.thomas.mongo.*
import javax.annotation.PostConstruct
class ClassifierService {
def grailsApplication
Classifier classifier
ClassifierService() {
classifier = new NaiveBayesClassifier()
classifier.repository = new MongoBayesClassifierRepository()
}
@PostConstruct
void setThreshold() {
classifier.setThreshold('work', grailsApplication.config.thomas.threshold as double)
}
void train(String document, String category) {
classifier.train(document, category)
}
String classify(String document) {
return classifier.classify(document)
}
}
## Instruction:
Use in memory classifier db
## Code After:
package wirc
import com.heikkiv.ml.thomas.*
import com.heikkiv.ml.thomas.mongo.*
import javax.annotation.PostConstruct
class ClassifierService {
def grailsApplication
Classifier classifier
ClassifierService() {
classifier = new NaiveBayesClassifier()
}
@PostConstruct
void setThreshold() {
classifier.setThreshold('work', grailsApplication.config.thomas.threshold as double)
}
void train(String document, String category) {
classifier.train(document, category)
}
String classify(String document) {
return classifier.classify(document)
}
}
| package wirc
import com.heikkiv.ml.thomas.*
import com.heikkiv.ml.thomas.mongo.*
import javax.annotation.PostConstruct
class ClassifierService {
def grailsApplication
Classifier classifier
ClassifierService() {
classifier = new NaiveBayesClassifier()
- classifier.repository = new MongoBayesClassifierRepository()
}
@PostConstruct
void setThreshold() {
classifier.setThreshold('work', grailsApplication.config.thomas.threshold as double)
}
void train(String document, String category) {
classifier.train(document, category)
}
String classify(String document) {
return classifier.classify(document)
}
} | 1 | 0.032258 | 0 | 1 |
9ab94feb518c518816bd64a4e0e811dfedb3c428 | katas/libraries/hamjest/assertThat.js | katas/libraries/hamjest/assertThat.js | // 1: assertThat
// To do: make all tests pass, leave the assert lines unchanged!
import {
assertThat, equalTo,
containsString, throws, returns,
} from 'hamjest';
describe('The core function, `assertThat()`', () => {
it('is a function', () => {
const typeOfAssertThat = typeof assertThat;
assertThat(typeOfAssertThat, equalTo('function'));
});
describe('requires at least two params', () => {
it('1st: the actual value', () => {
const expected = equalTo('actual');
assertThat('actual', expected);
});
it('2nd: a matcher for the expected value', () => {
const matcher = equalTo('expected');
assertThat('expected', matcher);
});
describe('the optional 3rd param', () => {
it('goes first(!), and is the assertion reason', () => {
const reason = 'This is the reason, the first `assertThat()` throws as part of its message.';
try {
assertThat(reason, true, equalTo(false));
} catch (e) {
assertThat(e.message, containsString(reason));
}
});
});
});
describe('under the hood, it does', () => {
it('nothing, WHEN actual and expected match (using the given matcher)', () => {
const passingTest = () => assertThat(true, equalTo(true));
assertThat(passingTest, returns());
});
it('throw an assertion, WHEN actual and expected don`t match', () => {
const failingTest = () => assertThat(false, equalTo(true));
assertThat(failingTest, throws());
});
});
});
| // 1: assertThat
// To do: make all tests pass, leave the assert lines unchanged!
import {
assertThat, equalTo,
containsString, throws, returns,
} from 'hamjest';
describe('The core function, `assertThat()`', () => {
it('is a function', () => {
const typeOfAssertThat = typeof assertThat;
assertThat(typeOfAssertThat, equalTo('function'));
});
describe('requires at least two params', () => {
it('1st: the actual value', () => {
const actual = 'actual';
const expected = equalTo('actual');
assertThat(actual, expected);
});
it('2nd: a matcher for the expected value', () => {
const matcher = equalTo('expected');
assertThat('expected', matcher);
});
describe('the optional 3rd param', () => {
it('goes first(!), and is the assertion reason', () => {
let caughtError;
const reason = 'This is the reason, the first `assertThat()` throws as part of its message.';
try {
assertThat(reason, true, equalTo(false));
} catch (e) {
caughtError = e;
}
assertThat(caughtError.message, containsString(reason));
});
});
});
describe('under the hood, it does', () => {
it('nothing, WHEN actual and expected match (using the given matcher)', () => {
const passingTest = () => assertThat(true, equalTo(true));
assertThat(passingTest, returns());
});
it('throw an assertion, WHEN actual and expected don`t match', () => {
const failingTest = () => assertThat(false, equalTo(true));
assertThat(failingTest, throws());
});
});
});
| Prepare for making it a kata. | Prepare for making it a kata.
| JavaScript | mit | tddbin/katas,tddbin/katas,tddbin/katas | javascript | ## Code Before:
// 1: assertThat
// To do: make all tests pass, leave the assert lines unchanged!
import {
assertThat, equalTo,
containsString, throws, returns,
} from 'hamjest';
describe('The core function, `assertThat()`', () => {
it('is a function', () => {
const typeOfAssertThat = typeof assertThat;
assertThat(typeOfAssertThat, equalTo('function'));
});
describe('requires at least two params', () => {
it('1st: the actual value', () => {
const expected = equalTo('actual');
assertThat('actual', expected);
});
it('2nd: a matcher for the expected value', () => {
const matcher = equalTo('expected');
assertThat('expected', matcher);
});
describe('the optional 3rd param', () => {
it('goes first(!), and is the assertion reason', () => {
const reason = 'This is the reason, the first `assertThat()` throws as part of its message.';
try {
assertThat(reason, true, equalTo(false));
} catch (e) {
assertThat(e.message, containsString(reason));
}
});
});
});
describe('under the hood, it does', () => {
it('nothing, WHEN actual and expected match (using the given matcher)', () => {
const passingTest = () => assertThat(true, equalTo(true));
assertThat(passingTest, returns());
});
it('throw an assertion, WHEN actual and expected don`t match', () => {
const failingTest = () => assertThat(false, equalTo(true));
assertThat(failingTest, throws());
});
});
});
## Instruction:
Prepare for making it a kata.
## Code After:
// 1: assertThat
// To do: make all tests pass, leave the assert lines unchanged!
import {
assertThat, equalTo,
containsString, throws, returns,
} from 'hamjest';
describe('The core function, `assertThat()`', () => {
it('is a function', () => {
const typeOfAssertThat = typeof assertThat;
assertThat(typeOfAssertThat, equalTo('function'));
});
describe('requires at least two params', () => {
it('1st: the actual value', () => {
const actual = 'actual';
const expected = equalTo('actual');
assertThat(actual, expected);
});
it('2nd: a matcher for the expected value', () => {
const matcher = equalTo('expected');
assertThat('expected', matcher);
});
describe('the optional 3rd param', () => {
it('goes first(!), and is the assertion reason', () => {
let caughtError;
const reason = 'This is the reason, the first `assertThat()` throws as part of its message.';
try {
assertThat(reason, true, equalTo(false));
} catch (e) {
caughtError = e;
}
assertThat(caughtError.message, containsString(reason));
});
});
});
describe('under the hood, it does', () => {
it('nothing, WHEN actual and expected match (using the given matcher)', () => {
const passingTest = () => assertThat(true, equalTo(true));
assertThat(passingTest, returns());
});
it('throw an assertion, WHEN actual and expected don`t match', () => {
const failingTest = () => assertThat(false, equalTo(true));
assertThat(failingTest, throws());
});
});
});
| // 1: assertThat
// To do: make all tests pass, leave the assert lines unchanged!
import {
assertThat, equalTo,
containsString, throws, returns,
} from 'hamjest';
describe('The core function, `assertThat()`', () => {
it('is a function', () => {
const typeOfAssertThat = typeof assertThat;
assertThat(typeOfAssertThat, equalTo('function'));
});
describe('requires at least two params', () => {
it('1st: the actual value', () => {
+ const actual = 'actual';
const expected = equalTo('actual');
- assertThat('actual', expected);
? - -
+ assertThat(actual, expected);
});
it('2nd: a matcher for the expected value', () => {
const matcher = equalTo('expected');
assertThat('expected', matcher);
});
describe('the optional 3rd param', () => {
it('goes first(!), and is the assertion reason', () => {
+ let caughtError;
const reason = 'This is the reason, the first `assertThat()` throws as part of its message.';
try {
assertThat(reason, true, equalTo(false));
} catch (e) {
- assertThat(e.message, containsString(reason));
+ caughtError = e;
}
+ assertThat(caughtError.message, containsString(reason));
});
});
});
describe('under the hood, it does', () => {
it('nothing, WHEN actual and expected match (using the given matcher)', () => {
const passingTest = () => assertThat(true, equalTo(true));
assertThat(passingTest, returns());
});
it('throw an assertion, WHEN actual and expected don`t match', () => {
const failingTest = () => assertThat(false, equalTo(true));
assertThat(failingTest, throws());
});
});
}); | 7 | 0.155556 | 5 | 2 |
1169e3116f7b070a2bdd6d79b2734282d38c53a2 | metadata/org.itishka.pointim.txt | metadata/org.itishka.pointim.txt | AntiFeatures:NonFreeNet
Categories:Internet
License:GPLv3
Web Site:
Source Code:https://github.com/Tishka17/Point.im-Android
Issue Tracker:https://github.com/Tishka17/Point.im-Android/issues
Auto Name:Point.im
Summary:Point.im client
Description:
Unoficial android client for microblogging service [https://point.im/ Point.IM].
.
Repo Type:git
Repo:https://github.com/Tishka17/Point.im-Android
Build:2.9,23
commit=2.9
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Build:2.10,24
commit=2.10
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Auto Update Mode:Version %v
Update Check Mode:Tags
Current Version:2.10
Current Version Code:24
| AntiFeatures:NonFreeNet
Categories:Internet
License:GPLv3
Web Site:
Source Code:https://github.com/Tishka17/Point.im-Android
Issue Tracker:https://github.com/Tishka17/Point.im-Android/issues
Auto Name:Point.im
Summary:Point.im client
Description:
Unoficial android client for microblogging service [https://point.im/ Point.IM].
.
Repo Type:git
Repo:https://github.com/Tishka17/Point.im-Android
Build:2.9,23
commit=2.9
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Build:2.10,24
commit=2.10
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Build:2.11,25
commit=2.11
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Auto Update Mode:Version %v
Update Check Mode:Tags
Current Version:2.11
Current Version Code:25
| Update Point.im to 2.11 (25) | Update Point.im to 2.11 (25)
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroid-data,f-droid/fdroiddata | text | ## Code Before:
AntiFeatures:NonFreeNet
Categories:Internet
License:GPLv3
Web Site:
Source Code:https://github.com/Tishka17/Point.im-Android
Issue Tracker:https://github.com/Tishka17/Point.im-Android/issues
Auto Name:Point.im
Summary:Point.im client
Description:
Unoficial android client for microblogging service [https://point.im/ Point.IM].
.
Repo Type:git
Repo:https://github.com/Tishka17/Point.im-Android
Build:2.9,23
commit=2.9
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Build:2.10,24
commit=2.10
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Auto Update Mode:Version %v
Update Check Mode:Tags
Current Version:2.10
Current Version Code:24
## Instruction:
Update Point.im to 2.11 (25)
## Code After:
AntiFeatures:NonFreeNet
Categories:Internet
License:GPLv3
Web Site:
Source Code:https://github.com/Tishka17/Point.im-Android
Issue Tracker:https://github.com/Tishka17/Point.im-Android/issues
Auto Name:Point.im
Summary:Point.im client
Description:
Unoficial android client for microblogging service [https://point.im/ Point.IM].
.
Repo Type:git
Repo:https://github.com/Tishka17/Point.im-Android
Build:2.9,23
commit=2.9
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Build:2.10,24
commit=2.10
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Build:2.11,25
commit=2.11
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Auto Update Mode:Version %v
Update Check Mode:Tags
Current Version:2.11
Current Version Code:25
| AntiFeatures:NonFreeNet
Categories:Internet
License:GPLv3
Web Site:
Source Code:https://github.com/Tishka17/Point.im-Android
Issue Tracker:https://github.com/Tishka17/Point.im-Android/issues
Auto Name:Point.im
Summary:Point.im client
Description:
Unoficial android client for microblogging service [https://point.im/ Point.IM].
.
Repo Type:git
Repo:https://github.com/Tishka17/Point.im-Android
Build:2.9,23
commit=2.9
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
Build:2.10,24
commit=2.10
subdir=app
init=sed -i '/sonatype/d' build.gradle
gradle=yes
prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
+ Build:2.11,25
+ commit=2.11
+ subdir=app
+ init=sed -i '/sonatype/d' build.gradle
+ gradle=yes
+ prebuild=echo -e 'imgurId="1f48b577414e505"\nimgurSecret=""' >> ../local.properties
+
Auto Update Mode:Version %v
Update Check Mode:Tags
- Current Version:2.10
? ^
+ Current Version:2.11
? ^
- Current Version Code:24
? ^
+ Current Version Code:25
? ^
| 11 | 0.314286 | 9 | 2 |
75ee9afbf44d84ace2912320306043bf14a80753 | tasks/main.yml | tasks/main.yml | ---
- name: install necessary packages for the tor onion service
apt:
package: tor
state: latest
notify: restart tor
- name: copy torrc template
template:
src: torrc.j2
dest: "{{ torrc }}"
notify: restart tor
| ---
- name: install necessary packages for the tor onion service
apt:
package: "{{ item }}"
state: latest
notify: restart tor
with_items:
- tor
- torsocks
- name: copy torrc template
template:
src: torrc.j2
dest: "{{ torrc }}"
notify: restart tor
| Install torsocks for serverspec acceptance tests through torify | Install torsocks for serverspec acceptance tests through torify
| YAML | mit | RebelCodeBase/ansible-role-tor-nginx-debian | yaml | ## Code Before:
---
- name: install necessary packages for the tor onion service
apt:
package: tor
state: latest
notify: restart tor
- name: copy torrc template
template:
src: torrc.j2
dest: "{{ torrc }}"
notify: restart tor
## Instruction:
Install torsocks for serverspec acceptance tests through torify
## Code After:
---
- name: install necessary packages for the tor onion service
apt:
package: "{{ item }}"
state: latest
notify: restart tor
with_items:
- tor
- torsocks
- name: copy torrc template
template:
src: torrc.j2
dest: "{{ torrc }}"
notify: restart tor
| ---
- name: install necessary packages for the tor onion service
apt:
- package: tor
+ package: "{{ item }}"
state: latest
notify: restart tor
+ with_items:
+ - tor
+ - torsocks
- name: copy torrc template
template:
src: torrc.j2
dest: "{{ torrc }}"
notify: restart tor | 5 | 0.416667 | 4 | 1 |
5ea525d0ada9be70e4bdaad2d11a3fbc0c29c165 | portfolio/src/main/webapp/index.html | portfolio/src/main/webapp/index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AI-ssistant</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap" rel="stylesheet">
<script src="script.js"></script>
</head>
<body>
<div id="content">
<h1>Hi, what can I help you with?</h1>
<div id = "listening-graphic"> </div>
<div id = "conversation-container"> </div>
<button onclick="startListening()">Record</button>
<br><br>
<form action = "/audio-input" method = "POST">
<textarea name="request-input" placeholder= "Type Your Question"></textarea>
<br><br>
<input type="submit"/>
<br><br>
</form>
</div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>AI-ssistant</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap" rel="stylesheet">
</head>
<body>
<div id="content">
<h1>Hi, what can I help you with?</h1>
<section class="main-controls">
<canvas class="visualizer" height="60px"></canvas>
<div id="buttons">
<button class="record">Record</button>
<button class="stop">Stop</button>
</div>
<section class="sound-clips">
</section>
</section>
<div id = "listening-graphic"> </div>
<div id = "conversation-container"> </div>
<button onclick="startListening()">Record</button>
<br><br>
<form action = "/audio-input" method = "POST">
<textarea name="request-input" placeholder= "Type Your Question"></textarea>
<br><br>
<input type="submit"/>
<br><br>
</form>
</div>
<script src="script.js"></script>
</body>
</html>
| Add audio wave to frontend | Add audio wave to frontend
| HTML | apache-2.0 | googleinterns/step43-2020,googleinterns/step43-2020,googleinterns/step43-2020,googleinterns/step43-2020 | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AI-ssistant</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap" rel="stylesheet">
<script src="script.js"></script>
</head>
<body>
<div id="content">
<h1>Hi, what can I help you with?</h1>
<div id = "listening-graphic"> </div>
<div id = "conversation-container"> </div>
<button onclick="startListening()">Record</button>
<br><br>
<form action = "/audio-input" method = "POST">
<textarea name="request-input" placeholder= "Type Your Question"></textarea>
<br><br>
<input type="submit"/>
<br><br>
</form>
</div>
</body>
</html>
## Instruction:
Add audio wave to frontend
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>AI-ssistant</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap" rel="stylesheet">
</head>
<body>
<div id="content">
<h1>Hi, what can I help you with?</h1>
<section class="main-controls">
<canvas class="visualizer" height="60px"></canvas>
<div id="buttons">
<button class="record">Record</button>
<button class="stop">Stop</button>
</div>
<section class="sound-clips">
</section>
</section>
<div id = "listening-graphic"> </div>
<div id = "conversation-container"> </div>
<button onclick="startListening()">Record</button>
<br><br>
<form action = "/audio-input" method = "POST">
<textarea name="request-input" placeholder= "Type Your Question"></textarea>
<br><br>
<input type="submit"/>
<br><br>
</form>
</div>
<script src="script.js"></script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width">
<title>AI-ssistant</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap" rel="stylesheet">
- <script src="script.js"></script>
</head>
<body>
<div id="content">
<h1>Hi, what can I help you with?</h1>
+
+ <section class="main-controls">
+ <canvas class="visualizer" height="60px"></canvas>
+ <div id="buttons">
+ <button class="record">Record</button>
+ <button class="stop">Stop</button>
+ </div>
+
+ <section class="sound-clips">
+ </section>
+ </section>
+
<div id = "listening-graphic"> </div>
<div id = "conversation-container"> </div>
<button onclick="startListening()">Record</button>
<br><br>
<form action = "/audio-input" method = "POST">
<textarea name="request-input" placeholder= "Type Your Question"></textarea>
<br><br>
<input type="submit"/>
<br><br>
</form>
</div>
+ <script src="script.js"></script>
</body>
</html> | 15 | 0.576923 | 14 | 1 |
fbacaaf05d96dbd5224dae38d6c99b599ad4ae0d | angular.json | angular.json | {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng-http-loader": {
"root": "",
"sourceRoot": "src",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "./tsconfig.lib.json",
"project": "./ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "./src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "./polyfills.ts",
"tsConfig": "./tsconfig.spec.json",
"watch": false
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"./tsconfig.lib.json",
"./tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ng-http-loader",
"schematics": {
"@schematics/angular:component": {
"prefix": "",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": ""
}
}
}
| {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng-http-loader": {
"root": "",
"sourceRoot": "src",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "./tsconfig.lib.json",
"project": "./ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "./src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "./polyfills.ts",
"tsConfig": "./tsconfig.spec.json",
"watch": false
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"./tsconfig.lib.json",
"./tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ng-http-loader",
"schematics": {
"@schematics/angular:component": {
"prefix": ""
},
"@schematics/angular:directive": {
"prefix": ""
}
}
}
| Remove styleext property as its value was the default one | Remove styleext property as its value was the default one
| JSON | mit | mpalourdio/ng-http-loader,mpalourdio/ng-http-loader,mpalourdio/ng-http-loader | json | ## Code Before:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng-http-loader": {
"root": "",
"sourceRoot": "src",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "./tsconfig.lib.json",
"project": "./ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "./src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "./polyfills.ts",
"tsConfig": "./tsconfig.spec.json",
"watch": false
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"./tsconfig.lib.json",
"./tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ng-http-loader",
"schematics": {
"@schematics/angular:component": {
"prefix": "",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": ""
}
}
}
## Instruction:
Remove styleext property as its value was the default one
## Code After:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng-http-loader": {
"root": "",
"sourceRoot": "src",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "./tsconfig.lib.json",
"project": "./ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "./src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "./polyfills.ts",
"tsConfig": "./tsconfig.spec.json",
"watch": false
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"./tsconfig.lib.json",
"./tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ng-http-loader",
"schematics": {
"@schematics/angular:component": {
"prefix": ""
},
"@schematics/angular:directive": {
"prefix": ""
}
}
}
| {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng-http-loader": {
"root": "",
"sourceRoot": "src",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "./tsconfig.lib.json",
"project": "./ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "./src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "./polyfills.ts",
"tsConfig": "./tsconfig.spec.json",
"watch": false
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"./tsconfig.lib.json",
"./tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ng-http-loader",
"schematics": {
"@schematics/angular:component": {
- "prefix": "",
? -
+ "prefix": ""
- "styleext": "css"
},
"@schematics/angular:directive": {
"prefix": ""
}
}
} | 3 | 0.056604 | 1 | 2 |
9b12846e9e3df884dded12065a85e07c6233b6d8 | README.md | README.md |
*NPM integration for Composer packages.*
[![The most recent stable version is 1.0.1]][Semantic versioning]
[![Current build status image]][Current build status]
[![Current coverage status image]][Current coverage status]
## Installation and documentation
* Available as [Composer] package [eloquent/composer-npm-bridge].
* [API documentation] available.
<!-- References -->
[API documentation]: http://lqnt.co/composer-npm-bridge/artifacts/documentation/api/
[Composer]: http://getcomposer.org/
[Current build status image]: https://img.shields.io/travis/eloquent/composer-npm-bridge/develop.svg "Current build status for the develop branch"
[Current build status]: https://travis-ci.org/eloquent/composer-npm-bridge
[Current coverage status image]: https://img.shields.io/coveralls/eloquent/composer-npm-bridge/develop.svg "Current test coverage for the develop branch"
[Current coverage status]: https://coveralls.io/r/eloquent/composer-npm-bridge
[eloquent/composer-npm-bridge]: https://packagist.org/packages/eloquent/composer-npm-bridge
[Semantic versioning]: http://semver.org/
[The most recent stable version is 1.0.1]: https://img.shields.io/:semver-1.0.1-brightgreen.svg "This project uses semantic versioning"
|
*NPM integration for Composer packages.*
[![The most recent stable version is 1.0.1][version-image]][Semantic versioning]
[![Current build status image][build-image]][Current build status]
[![Current coverage status image][coverage-image]][Current coverage status]
## Installation and documentation
* Available as [Composer] package [eloquent/composer-npm-bridge].
* [API documentation] available.
<!-- References -->
[API documentation]: http://lqnt.co/composer-npm-bridge/artifacts/documentation/api/
[Composer]: http://getcomposer.org/
[build-image]: http://img.shields.io/travis/eloquent/composer-npm-bridge/develop.svg "Current build status for the develop branch"
[Current build status]: https://travis-ci.org/eloquent/composer-npm-bridge
[coverage-image]: http://img.shields.io/coveralls/eloquent/composer-npm-bridge/develop.svg "Current test coverage for the develop branch"
[Current coverage status]: https://coveralls.io/r/eloquent/composer-npm-bridge
[eloquent/composer-npm-bridge]: https://packagist.org/packages/eloquent/composer-npm-bridge
[Semantic versioning]: http://semver.org/
[version-image]: http://img.shields.io/:semver-1.0.1-brightgreen.svg "This project uses semantic versioning"
| Revert to http for shields. | Revert to http for shields. [ci skip]
| Markdown | mit | eloquent/composer-npm-bridge | markdown | ## Code Before:
*NPM integration for Composer packages.*
[![The most recent stable version is 1.0.1]][Semantic versioning]
[![Current build status image]][Current build status]
[![Current coverage status image]][Current coverage status]
## Installation and documentation
* Available as [Composer] package [eloquent/composer-npm-bridge].
* [API documentation] available.
<!-- References -->
[API documentation]: http://lqnt.co/composer-npm-bridge/artifacts/documentation/api/
[Composer]: http://getcomposer.org/
[Current build status image]: https://img.shields.io/travis/eloquent/composer-npm-bridge/develop.svg "Current build status for the develop branch"
[Current build status]: https://travis-ci.org/eloquent/composer-npm-bridge
[Current coverage status image]: https://img.shields.io/coveralls/eloquent/composer-npm-bridge/develop.svg "Current test coverage for the develop branch"
[Current coverage status]: https://coveralls.io/r/eloquent/composer-npm-bridge
[eloquent/composer-npm-bridge]: https://packagist.org/packages/eloquent/composer-npm-bridge
[Semantic versioning]: http://semver.org/
[The most recent stable version is 1.0.1]: https://img.shields.io/:semver-1.0.1-brightgreen.svg "This project uses semantic versioning"
## Instruction:
Revert to http for shields. [ci skip]
## Code After:
*NPM integration for Composer packages.*
[![The most recent stable version is 1.0.1][version-image]][Semantic versioning]
[![Current build status image][build-image]][Current build status]
[![Current coverage status image][coverage-image]][Current coverage status]
## Installation and documentation
* Available as [Composer] package [eloquent/composer-npm-bridge].
* [API documentation] available.
<!-- References -->
[API documentation]: http://lqnt.co/composer-npm-bridge/artifacts/documentation/api/
[Composer]: http://getcomposer.org/
[build-image]: http://img.shields.io/travis/eloquent/composer-npm-bridge/develop.svg "Current build status for the develop branch"
[Current build status]: https://travis-ci.org/eloquent/composer-npm-bridge
[coverage-image]: http://img.shields.io/coveralls/eloquent/composer-npm-bridge/develop.svg "Current test coverage for the develop branch"
[Current coverage status]: https://coveralls.io/r/eloquent/composer-npm-bridge
[eloquent/composer-npm-bridge]: https://packagist.org/packages/eloquent/composer-npm-bridge
[Semantic versioning]: http://semver.org/
[version-image]: http://img.shields.io/:semver-1.0.1-brightgreen.svg "This project uses semantic versioning"
|
*NPM integration for Composer packages.*
- [![The most recent stable version is 1.0.1]][Semantic versioning]
+ [![The most recent stable version is 1.0.1][version-image]][Semantic versioning]
? +++++++++++++++
- [![Current build status image]][Current build status]
+ [![Current build status image][build-image]][Current build status]
? +++++++++++++
- [![Current coverage status image]][Current coverage status]
+ [![Current coverage status image][coverage-image]][Current coverage status]
? ++++++++++++++++
## Installation and documentation
* Available as [Composer] package [eloquent/composer-npm-bridge].
* [API documentation] available.
<!-- References -->
[API documentation]: http://lqnt.co/composer-npm-bridge/artifacts/documentation/api/
[Composer]: http://getcomposer.org/
- [Current build status image]: https://img.shields.io/travis/eloquent/composer-npm-bridge/develop.svg "Current build status for the develop branch"
? -------- ^^^^^^^^ -
+ [build-image]: http://img.shields.io/travis/eloquent/composer-npm-bridge/develop.svg "Current build status for the develop branch"
? ^
[Current build status]: https://travis-ci.org/eloquent/composer-npm-bridge
- [Current coverage status image]: https://img.shields.io/coveralls/eloquent/composer-npm-bridge/develop.svg "Current test coverage for the develop branch"
? -------- ^^^^^^^^ -
+ [coverage-image]: http://img.shields.io/coveralls/eloquent/composer-npm-bridge/develop.svg "Current test coverage for the develop branch"
? ^
[Current coverage status]: https://coveralls.io/r/eloquent/composer-npm-bridge
[eloquent/composer-npm-bridge]: https://packagist.org/packages/eloquent/composer-npm-bridge
[Semantic versioning]: http://semver.org/
- [The most recent stable version is 1.0.1]: https://img.shields.io/:semver-1.0.1-brightgreen.svg "This project uses semantic versioning"
? ----------------------- ^ ^^^^^^^ -
+ [version-image]: http://img.shields.io/:semver-1.0.1-brightgreen.svg "This project uses semantic versioning"
? ^ ^^^^
| 12 | 0.521739 | 6 | 6 |
6f335bf7dc45751e9d536aa737e4bcac92473855 | .travis.yml | .travis.yml | language: ruby
rvm:
- 2.2.3
env:
- DB=postgres
install:
- bundle install
env:
matrix:
- SOLIDUS_BRANCH=v1.3
- SOLIDUS_BRANCH=v1.4
- SOLIDUS_BRANCH=v2.0
- SOLIDUS_BRANCH=v2.1
- SOLIDUS_BRANCH=v2.2
- SOLIDUS_BRANCH=master
script:
- bundle exec rake test_app
- ( cd ./spec/dummy && bundle exec rake solidus-adyen:factory_girl:lint RAILS_ENV=test )
- bundle exec rspec
| language: ruby
rvm:
- 2.2.3
env:
- DB=postgres
install:
- bundle install
env:
matrix:
- SOLIDUS_BRANCH=v1.3
- SOLIDUS_BRANCH=v1.4
- SOLIDUS_BRANCH=v2.0
- SOLIDUS_BRANCH=v2.1
- SOLIDUS_BRANCH=v2.2
script:
- bundle exec rake test_app
- ( cd ./spec/dummy && bundle exec rake solidus-adyen:factory_girl:lint RAILS_ENV=test )
- bundle exec rspec
| Remove master from testing grid | Remove master from testing grid
This extension is not at all ready for master. Additional work will be
required to fix everything up.
| YAML | mit | freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen | yaml | ## Code Before:
language: ruby
rvm:
- 2.2.3
env:
- DB=postgres
install:
- bundle install
env:
matrix:
- SOLIDUS_BRANCH=v1.3
- SOLIDUS_BRANCH=v1.4
- SOLIDUS_BRANCH=v2.0
- SOLIDUS_BRANCH=v2.1
- SOLIDUS_BRANCH=v2.2
- SOLIDUS_BRANCH=master
script:
- bundle exec rake test_app
- ( cd ./spec/dummy && bundle exec rake solidus-adyen:factory_girl:lint RAILS_ENV=test )
- bundle exec rspec
## Instruction:
Remove master from testing grid
This extension is not at all ready for master. Additional work will be
required to fix everything up.
## Code After:
language: ruby
rvm:
- 2.2.3
env:
- DB=postgres
install:
- bundle install
env:
matrix:
- SOLIDUS_BRANCH=v1.3
- SOLIDUS_BRANCH=v1.4
- SOLIDUS_BRANCH=v2.0
- SOLIDUS_BRANCH=v2.1
- SOLIDUS_BRANCH=v2.2
script:
- bundle exec rake test_app
- ( cd ./spec/dummy && bundle exec rake solidus-adyen:factory_girl:lint RAILS_ENV=test )
- bundle exec rspec
| language: ruby
rvm:
- 2.2.3
env:
- DB=postgres
install:
- bundle install
env:
matrix:
- SOLIDUS_BRANCH=v1.3
- SOLIDUS_BRANCH=v1.4
- SOLIDUS_BRANCH=v2.0
- SOLIDUS_BRANCH=v2.1
- SOLIDUS_BRANCH=v2.2
- - SOLIDUS_BRANCH=master
script:
- bundle exec rake test_app
- ( cd ./spec/dummy && bundle exec rake solidus-adyen:factory_girl:lint RAILS_ENV=test )
- bundle exec rspec | 1 | 0.052632 | 0 | 1 |
958976186e8a3702852805e446039b1dddaeff10 | netlib/test/resolver_test.cpp | netlib/test/resolver_test.cpp |
using namespace net;
TEST(LookupAddress, Localhost) {
{
std::string addr;
error err = LookupAddress("localhost", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
{
std::string addr;
error err = LookupAddress("127.0.0.1", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
}
TEST(LookupAddress, Nullptr) {
ASSERT_DEATH({ LookupAddress("localhost", nullptr); }, "");
}
|
using namespace net;
TEST(LookupAddress, Localhost) {
std::string addr;
error err = LookupAddress("localhost", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
TEST(LookupAddress, LocalIPv4) {
std::string addr;
error err = LookupAddress("127.0.0.1", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
TEST(LookupAddress, Nullptr) {
ASSERT_DEATH({ LookupAddress("localhost", nullptr); }, "");
}
| Refactor the resolver test code | refactor/test: Refactor the resolver test code
| C++ | mit | yksz/netlib,yksz/netlib | c++ | ## Code Before:
using namespace net;
TEST(LookupAddress, Localhost) {
{
std::string addr;
error err = LookupAddress("localhost", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
{
std::string addr;
error err = LookupAddress("127.0.0.1", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
}
TEST(LookupAddress, Nullptr) {
ASSERT_DEATH({ LookupAddress("localhost", nullptr); }, "");
}
## Instruction:
refactor/test: Refactor the resolver test code
## Code After:
using namespace net;
TEST(LookupAddress, Localhost) {
std::string addr;
error err = LookupAddress("localhost", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
TEST(LookupAddress, LocalIPv4) {
std::string addr;
error err = LookupAddress("127.0.0.1", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
TEST(LookupAddress, Nullptr) {
ASSERT_DEATH({ LookupAddress("localhost", nullptr); }, "");
}
|
using namespace net;
TEST(LookupAddress, Localhost) {
- {
- std::string addr;
? ----
+ std::string addr;
- error err = LookupAddress("localhost", &addr);
? ----
+ error err = LookupAddress("localhost", &addr);
+
- EXPECT_EQ(error::nil, err);
? ----
+ EXPECT_EQ(error::nil, err);
- EXPECT_EQ("127.0.0.1", addr);
? ----
+ EXPECT_EQ("127.0.0.1", addr);
- }
- {
+ }
+
+ TEST(LookupAddress, LocalIPv4) {
- std::string addr;
? ----
+ std::string addr;
- error err = LookupAddress("127.0.0.1", &addr);
? ----
+ error err = LookupAddress("127.0.0.1", &addr);
+
- EXPECT_EQ(error::nil, err);
? ----
+ EXPECT_EQ(error::nil, err);
- EXPECT_EQ("127.0.0.1", addr);
? ----
+ EXPECT_EQ("127.0.0.1", addr);
- }
}
TEST(LookupAddress, Nullptr) {
ASSERT_DEATH({ LookupAddress("localhost", nullptr); }, "");
} | 25 | 1.190476 | 13 | 12 |
45e1fc95a0bea2919bf78872062f97f7e999c54a | GUIDELINES.markdown | GUIDELINES.markdown |
- Titles and navigation links should only capitalise first letter, not every word.
- URLs should use hyphens, not underscores.
## Code ##
- Don't commit additional whitespace
- Use ruby 1.9.2 hash syntax wherever possible
- Models should have:
- All associations at the top
- Then any scopes
- Then validations
- Then code
## Testing ##
Write tests.
### Cucumber ###
- Only test the "happy path" behaviour, not exceptional behaviour.
- Only describe things that should *happen*, not things that shouldn't.
- Prefer large descriptive steps to small reusable ones. DRY can be achieved at the Ruby level.
- Prefer steps written at a high level of abstraction.
- Write steps to be independent, not relying on the user being on a certain page.
- Avoid testing negatives; these are better tested in functional/unit tests.
- Avoid testing incidental behaviour (e.g. flash messages); these are better tested in functional/unit tests.
- Never call a cucumber step from within another one; extract the behaviour into a method which can be called from both. |
- Titles and navigation links should only capitalise first letter, not every word.
- URLs should use hyphens, not underscores.
- Follow the [style guide](https://www.gov.uk/designprinciples/styleguide).
## Code ##
- Don't commit additional whitespace
- Use ruby 1.9.2 hash syntax wherever possible
- Models should have:
- All associations at the top
- Then any scopes
- Then validations
- Then code
## Testing ##
Write tests.
### Cucumber ###
- Only test the "happy path" behaviour, not exceptional behaviour.
- Only describe things that should *happen*, not things that shouldn't.
- Prefer large descriptive steps to small reusable ones. DRY can be achieved at the Ruby level.
- Prefer steps written at a high level of abstraction.
- Write steps to be independent, not relying on the user being on a certain page.
- Avoid testing negatives; these are better tested in functional/unit tests.
- Avoid testing incidental behaviour (e.g. flash messages); these are better tested in functional/unit tests.
- Never call a cucumber step from within another one; extract the behaviour into a method which can be called from both. | Add style guide to guidelines | Add style guide to guidelines
| Markdown | mit | askl56/whitehall,robinwhittleton/whitehall,ggoral/whitehall,askl56/whitehall,ggoral/whitehall,askl56/whitehall,robinwhittleton/whitehall,robinwhittleton/whitehall,askl56/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,alphagov/whitehall,YOTOV-LIMITED/whitehall,YOTOV-LIMITED/whitehall,robinwhittleton/whitehall,YOTOV-LIMITED/whitehall,hotvulcan/whitehall,ggoral/whitehall,ggoral/whitehall,alphagov/whitehall,hotvulcan/whitehall,alphagov/whitehall,hotvulcan/whitehall,alphagov/whitehall | markdown | ## Code Before:
- Titles and navigation links should only capitalise first letter, not every word.
- URLs should use hyphens, not underscores.
## Code ##
- Don't commit additional whitespace
- Use ruby 1.9.2 hash syntax wherever possible
- Models should have:
- All associations at the top
- Then any scopes
- Then validations
- Then code
## Testing ##
Write tests.
### Cucumber ###
- Only test the "happy path" behaviour, not exceptional behaviour.
- Only describe things that should *happen*, not things that shouldn't.
- Prefer large descriptive steps to small reusable ones. DRY can be achieved at the Ruby level.
- Prefer steps written at a high level of abstraction.
- Write steps to be independent, not relying on the user being on a certain page.
- Avoid testing negatives; these are better tested in functional/unit tests.
- Avoid testing incidental behaviour (e.g. flash messages); these are better tested in functional/unit tests.
- Never call a cucumber step from within another one; extract the behaviour into a method which can be called from both.
## Instruction:
Add style guide to guidelines
## Code After:
- Titles and navigation links should only capitalise first letter, not every word.
- URLs should use hyphens, not underscores.
- Follow the [style guide](https://www.gov.uk/designprinciples/styleguide).
## Code ##
- Don't commit additional whitespace
- Use ruby 1.9.2 hash syntax wherever possible
- Models should have:
- All associations at the top
- Then any scopes
- Then validations
- Then code
## Testing ##
Write tests.
### Cucumber ###
- Only test the "happy path" behaviour, not exceptional behaviour.
- Only describe things that should *happen*, not things that shouldn't.
- Prefer large descriptive steps to small reusable ones. DRY can be achieved at the Ruby level.
- Prefer steps written at a high level of abstraction.
- Write steps to be independent, not relying on the user being on a certain page.
- Avoid testing negatives; these are better tested in functional/unit tests.
- Avoid testing incidental behaviour (e.g. flash messages); these are better tested in functional/unit tests.
- Never call a cucumber step from within another one; extract the behaviour into a method which can be called from both. |
- Titles and navigation links should only capitalise first letter, not every word.
- URLs should use hyphens, not underscores.
+ - Follow the [style guide](https://www.gov.uk/designprinciples/styleguide).
## Code ##
- Don't commit additional whitespace
- Use ruby 1.9.2 hash syntax wherever possible
- Models should have:
- All associations at the top
- Then any scopes
- Then validations
- Then code
## Testing ##
Write tests.
### Cucumber ###
- Only test the "happy path" behaviour, not exceptional behaviour.
- Only describe things that should *happen*, not things that shouldn't.
- Prefer large descriptive steps to small reusable ones. DRY can be achieved at the Ruby level.
- Prefer steps written at a high level of abstraction.
- Write steps to be independent, not relying on the user being on a certain page.
- Avoid testing negatives; these are better tested in functional/unit tests.
- Avoid testing incidental behaviour (e.g. flash messages); these are better tested in functional/unit tests.
- Never call a cucumber step from within another one; extract the behaviour into a method which can be called from both. | 1 | 0.035714 | 1 | 0 |
f1c9aaf2ca09799f642c404d9c016caee643d47b | src/Installer/DownloadPointers.htm | src/Installer/DownloadPointers.htm | <!DOCTYPE HTML>
<html>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache, no-store" />
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width='150'>CHANNEL_LABEL Version:</td>
<td width='200'><a href="http://bloom.palaso.org/downloads/BloomInstaller.VERSION_NUMBER.msi">Bloom VERSION_NUMBER</a> </td>
<td>RELEASE_DATE</td>
</tr>
</table>
</body>
</html>
| <!DOCTYPE HTML>
<html>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache, no-store" />
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width='150'>CHANNEL_LABEL Version:</td>
<td width='200'><a href="http://bloomlibrary.org/installers/BloomInstaller.VERSION_NUMBER.msi">Bloom VERSION_NUMBER</a> </td>
<td>RELEASE_DATE</td>
</tr>
</table>
</body>
</html>
| Change downloadpointers.htm to the new download url | Change downloadpointers.htm to the new download url
| HTML | mit | andrew-polk/BloomDesktop,gmartin7/myBloomFork,gmartin7/myBloomFork,andrew-polk/BloomDesktop,BloomBooks/BloomDesktop,JohnThomson/BloomDesktop,gmartin7/myBloomFork,andrew-polk/BloomDesktop,BloomBooks/BloomDesktop,BloomBooks/BloomDesktop,gmartin7/myBloomFork,BloomBooks/BloomDesktop,andrew-polk/BloomDesktop,JohnThomson/BloomDesktop,BloomBooks/BloomDesktop,JohnThomson/BloomDesktop,StephenMcConnel/BloomDesktop,gmartin7/myBloomFork,StephenMcConnel/BloomDesktop,andrew-polk/BloomDesktop,BloomBooks/BloomDesktop,andrew-polk/BloomDesktop,StephenMcConnel/BloomDesktop,JohnThomson/BloomDesktop,StephenMcConnel/BloomDesktop,StephenMcConnel/BloomDesktop,JohnThomson/BloomDesktop,StephenMcConnel/BloomDesktop,gmartin7/myBloomFork | html | ## Code Before:
<!DOCTYPE HTML>
<html>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache, no-store" />
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width='150'>CHANNEL_LABEL Version:</td>
<td width='200'><a href="http://bloom.palaso.org/downloads/BloomInstaller.VERSION_NUMBER.msi">Bloom VERSION_NUMBER</a> </td>
<td>RELEASE_DATE</td>
</tr>
</table>
</body>
</html>
## Instruction:
Change downloadpointers.htm to the new download url
## Code After:
<!DOCTYPE HTML>
<html>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache, no-store" />
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width='150'>CHANNEL_LABEL Version:</td>
<td width='200'><a href="http://bloomlibrary.org/installers/BloomInstaller.VERSION_NUMBER.msi">Bloom VERSION_NUMBER</a> </td>
<td>RELEASE_DATE</td>
</tr>
</table>
</body>
</html>
| <!DOCTYPE HTML>
<html>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache, no-store" />
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width='150'>CHANNEL_LABEL Version:</td>
- <td width='200'><a href="http://bloom.palaso.org/downloads/BloomInstaller.VERSION_NUMBER.msi">Bloom VERSION_NUMBER</a> </td>
? ^^ ^^^^ ^^^ ^^^
+ <td width='200'><a href="http://bloomlibrary.org/installers/BloomInstaller.VERSION_NUMBER.msi">Bloom VERSION_NUMBER</a> </td>
? ^^^^ ^^ ^ +++ ^^^
<td>RELEASE_DATE</td>
</tr>
</table>
</body>
</html> | 2 | 0.117647 | 1 | 1 |
f87dce1de79a6d4ef074d30b26a5bc47267de403 | src/public/jitsi-preload.js | src/public/jitsi-preload.js | 'use strict';
const electron = require('electron');
const { remote } = require('electron');
const selfBrowserWindow = remote.getCurrentWindow();
selfBrowserWindow.webContents.openDevTools({ mode: 'detach' });
selfBrowserWindow.webContents.once('dom-ready', () => {
window.JitsiMeetElectron = {
/**
* Get sources available for screensharing. The callback is invoked
* with an array of DesktopCapturerSources.
*
* @param {Function} callback - The success callback.
* @param {Function} errorCallback - The callback for errors.
* @param {Object} options - Configuration for getting sources.
* @param {Array} options.types - Specify the desktop source types
* to get, with valid sources being "window" and "screen".
* @param {Object} options.thumbnailSize - Specify how big the
* preview images for the sources should be. The valid keys are
* height and width, e.g. { height: number, width: number}. By
* default electron will return images with height and width of
* 150px.
*/
obtainDesktopStreams (callback, errorCallback, options = {}) {
electron.desktopCapturer.getSources(options,
(error, sources) => {
if (error) {
errorCallback(error);
return;
}
callback(sources);
});
}
};
}); | 'use strict';
const electron = require('electron');
const { remote } = require('electron');
const selfBrowserWindow = remote.getCurrentWindow();
selfBrowserWindow.webContents.once('dom-ready', () => {
window.JitsiMeetElectron = {
/**
* Get sources available for screensharing. The callback is invoked
* with an array of DesktopCapturerSources.
*
* @param {Function} callback - The success callback.
* @param {Function} errorCallback - The callback for errors.
* @param {Object} options - Configuration for getting sources.
* @param {Array} options.types - Specify the desktop source types
* to get, with valid sources being "window" and "screen".
* @param {Object} options.thumbnailSize - Specify how big the
* preview images for the sources should be. The valid keys are
* height and width, e.g. { height: number, width: number}. By
* default electron will return images with height and width of
* 150px.
*/
obtainDesktopStreams (callback, errorCallback, options = {}) {
electron.desktopCapturer.getSources(options,
(error, sources) => {
if (error) {
errorCallback(error);
return;
}
callback(sources);
});
}
};
});
| Remove developer debug window during screen share | Remove developer debug window during screen share
Right now when you try to share your screen it opens a developer window. | JavaScript | mit | RocketChat/Rocket.Chat.Electron,RocketChat/Rocket.Chat.Electron,RocketChat/Rocket.Chat.Electron | javascript | ## Code Before:
'use strict';
const electron = require('electron');
const { remote } = require('electron');
const selfBrowserWindow = remote.getCurrentWindow();
selfBrowserWindow.webContents.openDevTools({ mode: 'detach' });
selfBrowserWindow.webContents.once('dom-ready', () => {
window.JitsiMeetElectron = {
/**
* Get sources available for screensharing. The callback is invoked
* with an array of DesktopCapturerSources.
*
* @param {Function} callback - The success callback.
* @param {Function} errorCallback - The callback for errors.
* @param {Object} options - Configuration for getting sources.
* @param {Array} options.types - Specify the desktop source types
* to get, with valid sources being "window" and "screen".
* @param {Object} options.thumbnailSize - Specify how big the
* preview images for the sources should be. The valid keys are
* height and width, e.g. { height: number, width: number}. By
* default electron will return images with height and width of
* 150px.
*/
obtainDesktopStreams (callback, errorCallback, options = {}) {
electron.desktopCapturer.getSources(options,
(error, sources) => {
if (error) {
errorCallback(error);
return;
}
callback(sources);
});
}
};
});
## Instruction:
Remove developer debug window during screen share
Right now when you try to share your screen it opens a developer window.
## Code After:
'use strict';
const electron = require('electron');
const { remote } = require('electron');
const selfBrowserWindow = remote.getCurrentWindow();
selfBrowserWindow.webContents.once('dom-ready', () => {
window.JitsiMeetElectron = {
/**
* Get sources available for screensharing. The callback is invoked
* with an array of DesktopCapturerSources.
*
* @param {Function} callback - The success callback.
* @param {Function} errorCallback - The callback for errors.
* @param {Object} options - Configuration for getting sources.
* @param {Array} options.types - Specify the desktop source types
* to get, with valid sources being "window" and "screen".
* @param {Object} options.thumbnailSize - Specify how big the
* preview images for the sources should be. The valid keys are
* height and width, e.g. { height: number, width: number}. By
* default electron will return images with height and width of
* 150px.
*/
obtainDesktopStreams (callback, errorCallback, options = {}) {
electron.desktopCapturer.getSources(options,
(error, sources) => {
if (error) {
errorCallback(error);
return;
}
callback(sources);
});
}
};
});
| 'use strict';
const electron = require('electron');
const { remote } = require('electron');
const selfBrowserWindow = remote.getCurrentWindow();
- selfBrowserWindow.webContents.openDevTools({ mode: 'detach' });
selfBrowserWindow.webContents.once('dom-ready', () => {
window.JitsiMeetElectron = {
/**
* Get sources available for screensharing. The callback is invoked
* with an array of DesktopCapturerSources.
*
* @param {Function} callback - The success callback.
* @param {Function} errorCallback - The callback for errors.
* @param {Object} options - Configuration for getting sources.
* @param {Array} options.types - Specify the desktop source types
* to get, with valid sources being "window" and "screen".
* @param {Object} options.thumbnailSize - Specify how big the
* preview images for the sources should be. The valid keys are
* height and width, e.g. { height: number, width: number}. By
* default electron will return images with height and width of
* 150px.
*/
obtainDesktopStreams (callback, errorCallback, options = {}) {
electron.desktopCapturer.getSources(options,
(error, sources) => {
if (error) {
errorCallback(error);
return;
}
callback(sources);
});
}
};
}); | 1 | 0.027027 | 0 | 1 |
3f236d74615dced53c57628ae1b5f2c74f9e1de5 | examples/rate_limiting_test.py | examples/rate_limiting_test.py | from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(3.5) # The arg is max calls per second
def print_item(self, item):
print(item)
def test_rate_limited_printing(self):
print("\nRunning rate-limited print test:")
for item in xrange(1, 11):
self.print_item(item)
|
import unittest
from seleniumbase.common import decorators
class MyTestClass(unittest.TestCase):
@decorators.rate_limited(3.5) # The arg is max calls per second
def print_item(self, item):
print(item)
def test_rate_limited_printing(self):
print("\nRunning rate-limited print test:")
for item in xrange(1, 11):
self.print_item(item)
| Update the rate_limited decorator test | Update the rate_limited decorator test
| Python | mit | seleniumbase/SeleniumBase,possoumous/Watchers,possoumous/Watchers,mdmintz/SeleniumBase,possoumous/Watchers,ktp420/SeleniumBase,seleniumbase/SeleniumBase,ktp420/SeleniumBase,mdmintz/SeleniumBase,ktp420/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/seleniumspot,ktp420/SeleniumBase,mdmintz/seleniumspot,seleniumbase/SeleniumBase,possoumous/Watchers | python | ## Code Before:
from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(3.5) # The arg is max calls per second
def print_item(self, item):
print(item)
def test_rate_limited_printing(self):
print("\nRunning rate-limited print test:")
for item in xrange(1, 11):
self.print_item(item)
## Instruction:
Update the rate_limited decorator test
## Code After:
import unittest
from seleniumbase.common import decorators
class MyTestClass(unittest.TestCase):
@decorators.rate_limited(3.5) # The arg is max calls per second
def print_item(self, item):
print(item)
def test_rate_limited_printing(self):
print("\nRunning rate-limited print test:")
for item in xrange(1, 11):
self.print_item(item)
| - from seleniumbase import BaseCase
+
+ import unittest
from seleniumbase.common import decorators
- class MyTestClass(BaseCase):
? ^^
+ class MyTestClass(unittest.TestCase):
? ^^^^^^ +++ ++
@decorators.rate_limited(3.5) # The arg is max calls per second
def print_item(self, item):
print(item)
def test_rate_limited_printing(self):
print("\nRunning rate-limited print test:")
for item in xrange(1, 11):
self.print_item(item) | 5 | 0.357143 | 3 | 2 |
6f49a2a5d571021ca8fd390b69278ac48aba360f | opal/opal/nil_class.rb | opal/opal/nil_class.rb | class NilClass
def &(other)
false
end
def |(other)
`other !== false && other != null`
end
def ^(other)
`other !== false && other != null`
end
def ==(other)
`other == null`
end
def as_json
self
end
def dup
raise TypeError
end
def inspect
'nil'
end
def nil?
true
end
def singleton_class
NilClass
end
def to_a
[]
end
def to_h
`__opal.hash()`
end
def to_i
0
end
alias to_f to_i
def to_json
'null'
end
def to_n
`null`
end
def to_s
''
end
end
| class NilClass
def &(other)
false
end
def |(other)
`other !== false && other != null`
end
def ^(other)
`other !== false && other != null`
end
def ==(other)
`other == null`
end
def as_json
self
end
def dup
raise TypeError
end
def inspect
'nil'
end
def nil?
true
end
def singleton_class
NilClass
end
def to_a
[]
end
def to_h
`__opal.hash()`
end
def to_i
0
end
alias to_f to_i
def to_json
'null'
end
def to_n
`null`
end
def to_s
''
end
def object_id
`#{NilClass}._id || (#{NilClass}._id = Opal.uid())`
end
end
| Fix nil.object_id (which is incredibly 4!) | Fix nil.object_id (which is incredibly 4!)
4 is an old friend (note that in ruby 2 became 8).
| Ruby | mit | catprintlabs/opal,castwide/opal,iliabylich/opal,catprintlabs/opal,gabrielrios/opal,merongivian/opal,gausie/opal,kachick/opal,suyesh/opal,merongivian/opal,opal/opal,merongivian/opal,castwide/opal,jgaskins/opal,jannishuebl/opal,iliabylich/opal,fazibear/opal,jannishuebl/opal,bbatsov/opal,wied03/opal,catprintlabs/opal,Flikofbluelight747/opal,Mogztter/opal,suyesh/opal,fazibear/opal,iliabylich/opal,opal/opal,kachick/opal,gausie/opal,wied03/opal,c42engineering/opal,gabrielrios/opal,opal/opal,gabrielrios/opal,Ajedi32/opal,fazibear/opal,jgaskins/opal,castwide/opal,Mogztter/opal,Flikofbluelight747/opal,wied03/opal,domgetter/opal,jannishuebl/opal,Ajedi32/opal,domgetter/opal,Ajedi32/opal,Mogztter/opal,kachick/opal,c42engineering/opal,Mogztter/opal,suyesh/opal,jgaskins/opal,Flikofbluelight747/opal,bbatsov/opal,c42engineering/opal,bbatsov/opal,gausie/opal,kachick/opal,opal/opal | ruby | ## Code Before:
class NilClass
def &(other)
false
end
def |(other)
`other !== false && other != null`
end
def ^(other)
`other !== false && other != null`
end
def ==(other)
`other == null`
end
def as_json
self
end
def dup
raise TypeError
end
def inspect
'nil'
end
def nil?
true
end
def singleton_class
NilClass
end
def to_a
[]
end
def to_h
`__opal.hash()`
end
def to_i
0
end
alias to_f to_i
def to_json
'null'
end
def to_n
`null`
end
def to_s
''
end
end
## Instruction:
Fix nil.object_id (which is incredibly 4!)
4 is an old friend (note that in ruby 2 became 8).
## Code After:
class NilClass
def &(other)
false
end
def |(other)
`other !== false && other != null`
end
def ^(other)
`other !== false && other != null`
end
def ==(other)
`other == null`
end
def as_json
self
end
def dup
raise TypeError
end
def inspect
'nil'
end
def nil?
true
end
def singleton_class
NilClass
end
def to_a
[]
end
def to_h
`__opal.hash()`
end
def to_i
0
end
alias to_f to_i
def to_json
'null'
end
def to_n
`null`
end
def to_s
''
end
def object_id
`#{NilClass}._id || (#{NilClass}._id = Opal.uid())`
end
end
| class NilClass
def &(other)
false
end
def |(other)
`other !== false && other != null`
end
def ^(other)
`other !== false && other != null`
end
def ==(other)
`other == null`
end
def as_json
self
end
def dup
raise TypeError
end
def inspect
'nil'
end
def nil?
true
end
def singleton_class
NilClass
end
def to_a
[]
end
def to_h
`__opal.hash()`
end
def to_i
0
end
alias to_f to_i
def to_json
'null'
end
def to_n
`null`
end
def to_s
''
end
+
+ def object_id
+ `#{NilClass}._id || (#{NilClass}._id = Opal.uid())`
+ end
end | 4 | 0.063492 | 4 | 0 |
b7dc34984b4879e92e27ab1d88f538b653335c73 | README.md | README.md |
- [python3](https://www.python.org/downloads/)
- [python3-gi](https://wiki.gnome.org/Projects/PyGObject/)
- [pypi](https://pypi.python.org/pypi)
### Install packages
Open a terminal and type
```shell
python3 setup.py install
```
### Run
```shell
python3 main.py
```
### Setup a cron job
```shell
crontab -e
# Execute every hour
0 * * * * /usr/bin/python3 /home/user/xfce4-update-manager/main.py
``` |
- [python3](https://www.python.org/downloads/)
- [python3-gi](https://wiki.gnome.org/Projects/PyGObject/)
- [pypi](https://pypi.python.org/pypi)
- [gksu](http://www.nongnu.org/gksu/)
### Install packages
Open a terminal and type
```shell
python3 setup.py install
```
### Run
```shell
python3 main.py
```
### Setup a cron job
```shell
crontab -e
# Execute every hour
0 * * * * /usr/bin/python3 /home/user/xfce4-update-manager/main.py
``` | Add a prerequisite on gksu | Add a prerequisite on gksu
| Markdown | mit | xsellier/xfce4-update-manager,xsellier/xfce4-update-manager | markdown | ## Code Before:
- [python3](https://www.python.org/downloads/)
- [python3-gi](https://wiki.gnome.org/Projects/PyGObject/)
- [pypi](https://pypi.python.org/pypi)
### Install packages
Open a terminal and type
```shell
python3 setup.py install
```
### Run
```shell
python3 main.py
```
### Setup a cron job
```shell
crontab -e
# Execute every hour
0 * * * * /usr/bin/python3 /home/user/xfce4-update-manager/main.py
```
## Instruction:
Add a prerequisite on gksu
## Code After:
- [python3](https://www.python.org/downloads/)
- [python3-gi](https://wiki.gnome.org/Projects/PyGObject/)
- [pypi](https://pypi.python.org/pypi)
- [gksu](http://www.nongnu.org/gksu/)
### Install packages
Open a terminal and type
```shell
python3 setup.py install
```
### Run
```shell
python3 main.py
```
### Setup a cron job
```shell
crontab -e
# Execute every hour
0 * * * * /usr/bin/python3 /home/user/xfce4-update-manager/main.py
``` |
- [python3](https://www.python.org/downloads/)
- [python3-gi](https://wiki.gnome.org/Projects/PyGObject/)
- [pypi](https://pypi.python.org/pypi)
+ - [gksu](http://www.nongnu.org/gksu/)
### Install packages
Open a terminal and type
```shell
python3 setup.py install
```
### Run
```shell
python3 main.py
```
### Setup a cron job
```shell
crontab -e
# Execute every hour
0 * * * * /usr/bin/python3 /home/user/xfce4-update-manager/main.py
``` | 1 | 0.037037 | 1 | 0 |
75ac7463ab5df9186644b74b6182e647e4d9f83d | ansible-tests/validations/undercloud-disk-space.yaml | ansible-tests/validations/undercloud-disk-space.yaml | ---
- hosts: undercloud
vars:
metadata:
name: Disk Size of Undercloud Root Partition
description: >
Make sure that the root partition on the undercloud node is large enough.
groups:
- discovery
# NOTE(shadower): This is slightly lower than the size of the
# Instack VM in the virt environment. I'm assuming that's a good
# aproximation of "large enough". We may need to tweak this later.
minimum_disk_space_gb: 27
tasks:
- name: Get root disk space
debug: msg="The disk space on the root partition is {{ item.size_total }}B"
with_items: "{{ ansible_mounts }}"
when: "'/' == '{{ item.mount }}'" # We only care about root
# NOTE(shadower): 1073741824 == (1024 * 1024 * 1024), i.e. convert GB to bytes
failed_when: "({{ minimum_disk_space_gb }} * 1073741824) >= {{ item.size_total }}"
| ---
- hosts: undercloud
vars:
metadata:
name: Disk Size of Undercloud Root Partition
description: >
Make sure that the root partition on the undercloud node is large enough.
groups:
- discovery
# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Undercloud_Requirements.html
minimum_disk_space_gb: 40
tasks:
- name: Verify root disk space
# NOTE(shadower): 1073741824 == (1024 * 1024 * 1024), i.e. byte to gigabyte ratio
fail: msg="The available space on the root partition is {{ item.size_available|int / 1073741824 }} GB, but it should be at least {{ minimum_disk_space_gb }} GB."
with_items: "{{ ansible_mounts }}"
when: "'/' == '{{ item.mount }}'" # We only care about root
failed_when: "{{ minimum_disk_space_gb|int * 1073741824 }} >= {{ item.size_available|int }}"
| Update the undercloud disk space requirement | Update the undercloud disk space requirement
There should be at least 40 GB of space available:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Undercloud_Requirements.html
The error text has been made clearer.
| YAML | apache-2.0 | rthallisey/clapper,rthallisey/clapper | yaml | ## Code Before:
---
- hosts: undercloud
vars:
metadata:
name: Disk Size of Undercloud Root Partition
description: >
Make sure that the root partition on the undercloud node is large enough.
groups:
- discovery
# NOTE(shadower): This is slightly lower than the size of the
# Instack VM in the virt environment. I'm assuming that's a good
# aproximation of "large enough". We may need to tweak this later.
minimum_disk_space_gb: 27
tasks:
- name: Get root disk space
debug: msg="The disk space on the root partition is {{ item.size_total }}B"
with_items: "{{ ansible_mounts }}"
when: "'/' == '{{ item.mount }}'" # We only care about root
# NOTE(shadower): 1073741824 == (1024 * 1024 * 1024), i.e. convert GB to bytes
failed_when: "({{ minimum_disk_space_gb }} * 1073741824) >= {{ item.size_total }}"
## Instruction:
Update the undercloud disk space requirement
There should be at least 40 GB of space available:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Undercloud_Requirements.html
The error text has been made clearer.
## Code After:
---
- hosts: undercloud
vars:
metadata:
name: Disk Size of Undercloud Root Partition
description: >
Make sure that the root partition on the undercloud node is large enough.
groups:
- discovery
# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Undercloud_Requirements.html
minimum_disk_space_gb: 40
tasks:
- name: Verify root disk space
# NOTE(shadower): 1073741824 == (1024 * 1024 * 1024), i.e. byte to gigabyte ratio
fail: msg="The available space on the root partition is {{ item.size_available|int / 1073741824 }} GB, but it should be at least {{ minimum_disk_space_gb }} GB."
with_items: "{{ ansible_mounts }}"
when: "'/' == '{{ item.mount }}'" # We only care about root
failed_when: "{{ minimum_disk_space_gb|int * 1073741824 }} >= {{ item.size_available|int }}"
| ---
- hosts: undercloud
vars:
metadata:
name: Disk Size of Undercloud Root Partition
description: >
Make sure that the root partition on the undercloud node is large enough.
groups:
- discovery
+ # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Undercloud_Requirements.html
- # NOTE(shadower): This is slightly lower than the size of the
- # Instack VM in the virt environment. I'm assuming that's a good
- # aproximation of "large enough". We may need to tweak this later.
- minimum_disk_space_gb: 27
? ^^
+ minimum_disk_space_gb: 40
? ^^
tasks:
- - name: Get root disk space
? ^ ^
+ - name: Verify root disk space
? ^ ^^^^
- debug: msg="The disk space on the root partition is {{ item.size_total }}B"
+ # NOTE(shadower): 1073741824 == (1024 * 1024 * 1024), i.e. byte to gigabyte ratio
+ fail: msg="The available space on the root partition is {{ item.size_available|int / 1073741824 }} GB, but it should be at least {{ minimum_disk_space_gb }} GB."
with_items: "{{ ansible_mounts }}"
when: "'/' == '{{ item.mount }}'" # We only care about root
- # NOTE(shadower): 1073741824 == (1024 * 1024 * 1024), i.e. convert GB to bytes
- failed_when: "({{ minimum_disk_space_gb }} * 1073741824) >= {{ item.size_total }}"
? - ^^^ ^ ----
+ failed_when: "{{ minimum_disk_space_gb|int * 1073741824 }} >= {{ item.size_available|int }}"
? ^^^^ ^^^ ++++++++++++
| 14 | 0.7 | 6 | 8 |
c4b73acb6f15d376fc366892172f107fee0ee258 | Repository/ProductRepositoryInterface.php | Repository/ProductRepositoryInterface.php | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Product\Repository;
use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
*/
interface ProductRepositoryInterface extends RepositoryInterface
{
/**
* @param string $name
* @param string $locale
*
* @return ProductInterface[]
*/
public function findByName($name, $locale);
/**
* @param string $slug
*
* @return ProductInterface|null
*/
public function findOneBySlug($slug);
}
| <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Product\Repository;
use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
*/
interface ProductRepositoryInterface extends RepositoryInterface
{
/**
* @param string $name
* @param string $locale
*
* @return ProductInterface[]
*/
public function findByName($name, $locale);
}
| Clean up the rest of repositories | [MultipleBundles] Clean up the rest of repositories
| PHP | mit | Sylius/Product | php | ## Code Before:
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Product\Repository;
use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
*/
interface ProductRepositoryInterface extends RepositoryInterface
{
/**
* @param string $name
* @param string $locale
*
* @return ProductInterface[]
*/
public function findByName($name, $locale);
/**
* @param string $slug
*
* @return ProductInterface|null
*/
public function findOneBySlug($slug);
}
## Instruction:
[MultipleBundles] Clean up the rest of repositories
## Code After:
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Product\Repository;
use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
*/
interface ProductRepositoryInterface extends RepositoryInterface
{
/**
* @param string $name
* @param string $locale
*
* @return ProductInterface[]
*/
public function findByName($name, $locale);
}
| <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Product\Repository;
use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
*/
interface ProductRepositoryInterface extends RepositoryInterface
{
/**
* @param string $name
* @param string $locale
*
* @return ProductInterface[]
*/
public function findByName($name, $locale);
-
- /**
- * @param string $slug
- *
- * @return ProductInterface|null
- */
- public function findOneBySlug($slug);
} | 7 | 0.194444 | 0 | 7 |
67c444fb3603c234916b790d3dded3625f0512e5 | pivot/test/test_utils.py | pivot/test/test_utils.py | import os
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
import pivot
from pivot.utils import get_latest_term
TEST_CSV_PATH = os.path.join(os.path.dirname(pivot.__file__),
'test',
'test_resources',
'csvfiles/',)
class UtilsTest(TestCase):
@override_settings(CSV_ROOT=TEST_CSV_PATH)
def test_google_analytics_processor(self):
self.assertEquals(get_latest_term(), 'au12')
| import os
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
import pivot
from pivot.utils import get_latest_term
TEST_CSV_PATH = os.path.join(os.path.dirname(pivot.__file__),
'test',
'test_resources',
'csvfiles/',)
class UtilsTest(TestCase):
@override_settings(CSV_ROOT=TEST_CSV_PATH)
def test_get_latest_term(self):
self.assertEquals(get_latest_term(), 'au12')
| Rename test to something more descriptive. | Rename test to something more descriptive.
| Python | apache-2.0 | uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot | python | ## Code Before:
import os
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
import pivot
from pivot.utils import get_latest_term
TEST_CSV_PATH = os.path.join(os.path.dirname(pivot.__file__),
'test',
'test_resources',
'csvfiles/',)
class UtilsTest(TestCase):
@override_settings(CSV_ROOT=TEST_CSV_PATH)
def test_google_analytics_processor(self):
self.assertEquals(get_latest_term(), 'au12')
## Instruction:
Rename test to something more descriptive.
## Code After:
import os
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
import pivot
from pivot.utils import get_latest_term
TEST_CSV_PATH = os.path.join(os.path.dirname(pivot.__file__),
'test',
'test_resources',
'csvfiles/',)
class UtilsTest(TestCase):
@override_settings(CSV_ROOT=TEST_CSV_PATH)
def test_get_latest_term(self):
self.assertEquals(get_latest_term(), 'au12')
| import os
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
import pivot
from pivot.utils import get_latest_term
TEST_CSV_PATH = os.path.join(os.path.dirname(pivot.__file__),
'test',
'test_resources',
'csvfiles/',)
class UtilsTest(TestCase):
@override_settings(CSV_ROOT=TEST_CSV_PATH)
- def test_google_analytics_processor(self):
+ def test_get_latest_term(self):
self.assertEquals(get_latest_term(), 'au12') | 2 | 0.105263 | 1 | 1 |
afcd3ac9a441b65b74b75c09cce407654d6bad6b | src/prefix.js | src/prefix.js | /**
* Export javascript style and css style vendor prefixes.
* Based on "transform" support test.
*/
import isBrowser from 'is-browser'
let js = ''
let css = ''
// We should not do anything if required serverside.
if (isBrowser) {
const jsCssMap = {
Webkit: '-webkit-',
Moz: '-moz-',
// IE did it wrong again ...
ms: '-ms-',
O: '-o-'
}
// Order matters. We need to check Webkit the last one because
// other vendors use to add Webkit prefixes to some properties
const prefixes = ['Moz', 'ms', 'O', 'Webkit']
const style = document.createElement('p').style
const testProp = 'Transform'
for (let i = 0; i < prefixes.length; i++) {
const prefix = prefixes[i];
if ((prefix + testProp) in style) {
js = prefix
css = jsCssMap[prefix]
break
}
}
}
/**
* Vendor prefix string for the current browser.
*
* @type {{js: String, css: String}}
* @api public
*/
export default {js, css}
| /**
* Export javascript style and css style vendor prefixes.
* Based on "transform" support test.
*/
import isBrowser from 'is-browser'
let js = ''
let css = ''
// We should not do anything if required serverside.
if (isBrowser) {
// Order matters. We need to check Webkit the last one because
// other vendors use to add Webkit prefixes to some properties
const jsCssMap = {
Moz: '-moz-',
// IE did it wrong again ...
ms: '-ms-',
O: '-o-',
Webkit: '-webkit-'
}
const style = document.createElement('p').style
const testProp = 'Transform'
for (const key in jsCssMap) {
if ((key + testProp) in style) {
js = key
css = jsCssMap[key]
break
}
}
}
/**
* Vendor prefix string for the current browser.
*
* @type {{js: String, css: String}}
* @api public
*/
export default {js, css}
| Use the original object instead of array | Use the original object instead of array
| JavaScript | mit | jsstyles/css-vendor,cssinjs/css-vendor,cssinjs/css-vendor,jsstyles/css-vendor | javascript | ## Code Before:
/**
* Export javascript style and css style vendor prefixes.
* Based on "transform" support test.
*/
import isBrowser from 'is-browser'
let js = ''
let css = ''
// We should not do anything if required serverside.
if (isBrowser) {
const jsCssMap = {
Webkit: '-webkit-',
Moz: '-moz-',
// IE did it wrong again ...
ms: '-ms-',
O: '-o-'
}
// Order matters. We need to check Webkit the last one because
// other vendors use to add Webkit prefixes to some properties
const prefixes = ['Moz', 'ms', 'O', 'Webkit']
const style = document.createElement('p').style
const testProp = 'Transform'
for (let i = 0; i < prefixes.length; i++) {
const prefix = prefixes[i];
if ((prefix + testProp) in style) {
js = prefix
css = jsCssMap[prefix]
break
}
}
}
/**
* Vendor prefix string for the current browser.
*
* @type {{js: String, css: String}}
* @api public
*/
export default {js, css}
## Instruction:
Use the original object instead of array
## Code After:
/**
* Export javascript style and css style vendor prefixes.
* Based on "transform" support test.
*/
import isBrowser from 'is-browser'
let js = ''
let css = ''
// We should not do anything if required serverside.
if (isBrowser) {
// Order matters. We need to check Webkit the last one because
// other vendors use to add Webkit prefixes to some properties
const jsCssMap = {
Moz: '-moz-',
// IE did it wrong again ...
ms: '-ms-',
O: '-o-',
Webkit: '-webkit-'
}
const style = document.createElement('p').style
const testProp = 'Transform'
for (const key in jsCssMap) {
if ((key + testProp) in style) {
js = key
css = jsCssMap[key]
break
}
}
}
/**
* Vendor prefix string for the current browser.
*
* @type {{js: String, css: String}}
* @api public
*/
export default {js, css}
| /**
* Export javascript style and css style vendor prefixes.
* Based on "transform" support test.
*/
import isBrowser from 'is-browser'
let js = ''
let css = ''
// We should not do anything if required serverside.
if (isBrowser) {
+ // Order matters. We need to check Webkit the last one because
+ // other vendors use to add Webkit prefixes to some properties
const jsCssMap = {
- Webkit: '-webkit-',
Moz: '-moz-',
// IE did it wrong again ...
ms: '-ms-',
- O: '-o-'
+ O: '-o-',
? +
+ Webkit: '-webkit-'
}
-
- // Order matters. We need to check Webkit the last one because
- // other vendors use to add Webkit prefixes to some properties
- const prefixes = ['Moz', 'ms', 'O', 'Webkit']
-
const style = document.createElement('p').style
const testProp = 'Transform'
+ for (const key in jsCssMap) {
- for (let i = 0; i < prefixes.length; i++) {
- const prefix = prefixes[i];
- if ((prefix + testProp) in style) {
? ^^ ^^^
+ if ((key + testProp) in style) {
? ^ ^
- js = prefix
? ^^ ^^^
+ js = key
? ^ ^
- css = jsCssMap[prefix]
? ^^ ^^^
+ css = jsCssMap[key]
? ^ ^
break
}
}
}
/**
* Vendor prefix string for the current browser.
*
* @type {{js: String, css: String}}
* @api public
*/
export default {js, css} | 20 | 0.454545 | 8 | 12 |
dff029d3cbd50b3f981b90c77c6c4e973ed37bee | browser-sync.config.js | browser-sync.config.js | module.exports = {
port: 3001,
files: [ 'build/*', "src/views/index.html" ]
};
| module.exports = {
port: 3001,
files: [ 'build/*', "src/views/index.html" ],
ghostMode: false,
notify: false
};
| Disable ghostMode (mirroring interactions in different browsers) and notifications (top right corner) | Disable ghostMode (mirroring interactions in different browsers) and
notifications (top right corner)
| JavaScript | mit | PathwayCommons/app-ui,PathwayCommons/app-ui,PathwayCommons/app-ui | javascript | ## Code Before:
module.exports = {
port: 3001,
files: [ 'build/*', "src/views/index.html" ]
};
## Instruction:
Disable ghostMode (mirroring interactions in different browsers) and
notifications (top right corner)
## Code After:
module.exports = {
port: 3001,
files: [ 'build/*', "src/views/index.html" ],
ghostMode: false,
notify: false
};
| module.exports = {
port: 3001,
- files: [ 'build/*', "src/views/index.html" ]
+ files: [ 'build/*', "src/views/index.html" ],
? +
+ ghostMode: false,
+ notify: false
}; | 4 | 1 | 3 | 1 |
b3810d08c0199c35beb871bf55ca09d5578b3919 | lib/easy_resource/actions.rb | lib/easy_resource/actions.rb | module EasyResource
module Actions
# GET /resources
def index
respond_with(collection)
end
# GET /resources/1
def show
respond_with(resource)
end
# GET /resources/new
def new
respond_with(build_resource)
end
# GET /resources/1/edit
def edit
respond_with(resource)
end
# POST /resources
def create
object = build_resource
object.save
respond_with(object, location: redirect_location)
end
# PUT /resources/1
def update
object = resource
object.update_attributes(resource_params)
respond_with(object, location: redirect_location)
end
# DELETE /resources/1
def destroy
object = resource
object.destroy
respond_with(object, location: polymorphic_path([namespace, resource_class]))
end
private
def redirect_location
polymorphic_path([namespace, resource])
end
end
end
| module EasyResource
module Actions
# GET /resources
def index
respond_with(collection)
end
# GET /resources/1
def show
respond_with(resource)
end
# GET /resources/new
def new
respond_with(build_resource)
end
# GET /resources/1/edit
def edit
respond_with(resource)
end
# POST /resources
def create
object = build_resource
object.save
respond_with(object, location: redirect_location)
end
# PUT /resources/1
def update
object = resource
object.update_attributes(resource_params)
respond_with(object, location: redirect_location)
end
# DELETE /resources/1
def destroy
object = resource
object.destroy
respond_with(object, location: redirect_collection)
end
private
def redirect_collection
polymorphic_path([namespace, resource_class])
end
def redirect_location
polymorphic_path([namespace, resource])
end
end
end
| Create method for index path | Create method for index path
| Ruby | mit | ciihla/easy_resource | ruby | ## Code Before:
module EasyResource
module Actions
# GET /resources
def index
respond_with(collection)
end
# GET /resources/1
def show
respond_with(resource)
end
# GET /resources/new
def new
respond_with(build_resource)
end
# GET /resources/1/edit
def edit
respond_with(resource)
end
# POST /resources
def create
object = build_resource
object.save
respond_with(object, location: redirect_location)
end
# PUT /resources/1
def update
object = resource
object.update_attributes(resource_params)
respond_with(object, location: redirect_location)
end
# DELETE /resources/1
def destroy
object = resource
object.destroy
respond_with(object, location: polymorphic_path([namespace, resource_class]))
end
private
def redirect_location
polymorphic_path([namespace, resource])
end
end
end
## Instruction:
Create method for index path
## Code After:
module EasyResource
module Actions
# GET /resources
def index
respond_with(collection)
end
# GET /resources/1
def show
respond_with(resource)
end
# GET /resources/new
def new
respond_with(build_resource)
end
# GET /resources/1/edit
def edit
respond_with(resource)
end
# POST /resources
def create
object = build_resource
object.save
respond_with(object, location: redirect_location)
end
# PUT /resources/1
def update
object = resource
object.update_attributes(resource_params)
respond_with(object, location: redirect_location)
end
# DELETE /resources/1
def destroy
object = resource
object.destroy
respond_with(object, location: redirect_collection)
end
private
def redirect_collection
polymorphic_path([namespace, resource_class])
end
def redirect_location
polymorphic_path([namespace, resource])
end
end
end
| module EasyResource
module Actions
# GET /resources
def index
respond_with(collection)
end
# GET /resources/1
def show
respond_with(resource)
end
# GET /resources/new
def new
respond_with(build_resource)
end
# GET /resources/1/edit
def edit
respond_with(resource)
end
# POST /resources
def create
object = build_resource
object.save
respond_with(object, location: redirect_location)
end
# PUT /resources/1
def update
object = resource
object.update_attributes(resource_params)
respond_with(object, location: redirect_location)
end
# DELETE /resources/1
def destroy
object = resource
object.destroy
- respond_with(object, location: polymorphic_path([namespace, resource_class]))
+ respond_with(object, location: redirect_collection)
end
private
+
+ def redirect_collection
+ polymorphic_path([namespace, resource_class])
+ end
def redirect_location
polymorphic_path([namespace, resource])
end
end
end | 6 | 0.12 | 5 | 1 |
e96bdba890bd88e3304a0eedb37822ee2b7a419e | test/src/ilb2.js | test/src/ilb2.js | function openDemo (browser) {
browser.url("http://localhost:8080/docs/index.html")
}
module.exports = {
"Open demo page" : function (browser) {
openDemo(browser);
browser.assert.elementPresent("#main_content")
.end();
},
"Open lightbox page" : function (browser) {
openDemo(browser);
browser.click('.options_activity li a')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
//.assert.containsText('ol#rso li:first-child', 'Rembrandt - Wikipedia')
.end();
}
};
| function openDemo (browser) {
browser.url("http://localhost:8080/docs/index.html")
}
module.exports = {
"Open demo page" : function (browser) {
openDemo(browser);
browser.assert.elementPresent("#main_content")
.end();
},
"Open lightbox page" : function (browser) {
openDemo(browser);
browser.click('.options_activity li a')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
//.assert.containsText('ol#rso li:first-child', 'Rembrandt - Wikipedia')
.end();
},
"Dynamic add" : function (browser) {
openDemo(browser);
browser.click('#addimage')
.click('[src="images/thumb4.jpg"')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
.assert.elementPresent('img[src$="images/demo4.jpg"]')
.end();
},
"Manual trigger" : function (browser) {
openDemo(browser);
browser.click('.trigger-button')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
.end();
}
};
| Add tests for dynamic add and manual trigger | Add tests for dynamic add and manual trigger
| JavaScript | mit | rejas/imagelightbox | javascript | ## Code Before:
function openDemo (browser) {
browser.url("http://localhost:8080/docs/index.html")
}
module.exports = {
"Open demo page" : function (browser) {
openDemo(browser);
browser.assert.elementPresent("#main_content")
.end();
},
"Open lightbox page" : function (browser) {
openDemo(browser);
browser.click('.options_activity li a')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
//.assert.containsText('ol#rso li:first-child', 'Rembrandt - Wikipedia')
.end();
}
};
## Instruction:
Add tests for dynamic add and manual trigger
## Code After:
function openDemo (browser) {
browser.url("http://localhost:8080/docs/index.html")
}
module.exports = {
"Open demo page" : function (browser) {
openDemo(browser);
browser.assert.elementPresent("#main_content")
.end();
},
"Open lightbox page" : function (browser) {
openDemo(browser);
browser.click('.options_activity li a')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
//.assert.containsText('ol#rso li:first-child', 'Rembrandt - Wikipedia')
.end();
},
"Dynamic add" : function (browser) {
openDemo(browser);
browser.click('#addimage')
.click('[src="images/thumb4.jpg"')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
.assert.elementPresent('img[src$="images/demo4.jpg"]')
.end();
},
"Manual trigger" : function (browser) {
openDemo(browser);
browser.click('.trigger-button')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
.end();
}
};
| function openDemo (browser) {
browser.url("http://localhost:8080/docs/index.html")
}
module.exports = {
"Open demo page" : function (browser) {
openDemo(browser);
browser.assert.elementPresent("#main_content")
.end();
},
"Open lightbox page" : function (browser) {
openDemo(browser);
browser.click('.options_activity li a')
.waitForElementVisible('#imagelightbox', 1000)
.assert.elementPresent("#imagelightbox")
//.assert.containsText('ol#rso li:first-child', 'Rembrandt - Wikipedia')
.end();
+ },
+
+ "Dynamic add" : function (browser) {
+ openDemo(browser);
+ browser.click('#addimage')
+ .click('[src="images/thumb4.jpg"')
+ .waitForElementVisible('#imagelightbox', 1000)
+ .assert.elementPresent("#imagelightbox")
+ .assert.elementPresent('img[src$="images/demo4.jpg"]')
+ .end();
+ },
+
+ "Manual trigger" : function (browser) {
+ openDemo(browser);
+ browser.click('.trigger-button')
+ .waitForElementVisible('#imagelightbox', 1000)
+ .assert.elementPresent("#imagelightbox")
+ .end();
}
}; | 18 | 0.857143 | 18 | 0 |
24231a1a417c0e5de066ff0b430b8a3a9a8e601b | src/router/index.js | src/router/index.js | import Vue from 'vue'
import Router from 'vue-router'
import IndexPage from '@/components/IndexPage'
import NodesPage from '@/components/NodesPage'
import PlatformPage from '@/components/platform/PlatformPage'
Vue.use(Router)
export default new Router({
mode: 'history',
fallback: false,
base: '/',
routes: [
{
path: '/',
component: IndexPage,
},
{
path: '/nodes/',
component: NodesPage,
},
{
path: '/:platform/',
component: PlatformPage,
}
],
})
| import Vue from 'vue'
import Router from 'vue-router'
import IndexPage from '@/components/IndexPage'
import NodesPage from '@/components/NodesPage'
import PlatformPage from '@/components/platform/PlatformPage'
Vue.use(Router)
export default new Router({
mode: 'history',
base: '/',
routes: [
{
path: '/',
component: IndexPage,
},
{
path: '/nodes/',
component: NodesPage,
},
{
path: '/:platform/',
component: PlatformPage,
}
],
})
| Remove Vue router fallback parameter | Remove Vue router fallback parameter
| JavaScript | agpl-3.0 | Flaburgan/the-federation.info,jaywink/diaspora-hub,Flaburgan/diaspora-hub,Flaburgan/diaspora-hub,jaywink/the-federation.info,Flaburgan/diaspora-hub,jaywink/the-federation.info,Flaburgan/the-federation.info,jaywink/diaspora-hub,jaywink/diaspora-hub,Flaburgan/the-federation.info,Flaburgan/the-federation.info,jaywink/the-federation.info | javascript | ## Code Before:
import Vue from 'vue'
import Router from 'vue-router'
import IndexPage from '@/components/IndexPage'
import NodesPage from '@/components/NodesPage'
import PlatformPage from '@/components/platform/PlatformPage'
Vue.use(Router)
export default new Router({
mode: 'history',
fallback: false,
base: '/',
routes: [
{
path: '/',
component: IndexPage,
},
{
path: '/nodes/',
component: NodesPage,
},
{
path: '/:platform/',
component: PlatformPage,
}
],
})
## Instruction:
Remove Vue router fallback parameter
## Code After:
import Vue from 'vue'
import Router from 'vue-router'
import IndexPage from '@/components/IndexPage'
import NodesPage from '@/components/NodesPage'
import PlatformPage from '@/components/platform/PlatformPage'
Vue.use(Router)
export default new Router({
mode: 'history',
base: '/',
routes: [
{
path: '/',
component: IndexPage,
},
{
path: '/nodes/',
component: NodesPage,
},
{
path: '/:platform/',
component: PlatformPage,
}
],
})
| import Vue from 'vue'
import Router from 'vue-router'
import IndexPage from '@/components/IndexPage'
import NodesPage from '@/components/NodesPage'
import PlatformPage from '@/components/platform/PlatformPage'
Vue.use(Router)
export default new Router({
mode: 'history',
- fallback: false,
base: '/',
routes: [
{
path: '/',
component: IndexPage,
},
{
path: '/nodes/',
component: NodesPage,
},
{
path: '/:platform/',
component: PlatformPage,
}
],
}) | 1 | 0.037037 | 0 | 1 |
a1930a4aa9e3b114ab15c94cd0cfbbd17bf1945d | src/browser/audio/Component.tsx | src/browser/audio/Component.tsx | import React, { useState, FunctionComponent, ChangeEvent } from "react";
type Props = {
initialVolume: number;
onChangeVolume: (volume: number) => void;
};
const Component: FunctionComponent<Props> = props => {
const [volume, setVolume] = useState(props.initialVolume);
const onChange = (event: ChangeEvent<HTMLInputElement>) => {
const volume = parseFloat(event.target.value);
setVolume(volume);
props.onChangeVolume(volume);
};
return (
<form id="controls">
Volume{" "}
<input
type="range"
min="0"
max="1"
step="0.01"
value={volume}
onChange={onChange}
/>
</form>
);
};
export default Component;
| import React, { useState, FunctionComponent, ChangeEvent } from "react";
type Props = {
initialVolume: number;
onChangeVolume: (volume: number) => void;
};
const Component: FunctionComponent<Props> = props => {
const [volume, setVolume] = useState(props.initialVolume);
const onChange = (event: ChangeEvent<HTMLInputElement>) => {
const volume = parseFloat(event.target.value);
setVolume(volume);
props.onChangeVolume(volume);
};
return (
<form id="controls">
<label>
Volume{" "}
<input
type="range"
min="0"
max="1"
step="0.01"
value={volume}
onChange={onChange}
/>
</label>
</form>
);
};
export default Component;
| Fix "Form elements do not have associated labels" | Fix "Form elements do not have associated labels"
(from Lighthouse Accessibility audit)
| TypeScript | mit | frosas/lag,frosas/lag,frosas/lag | typescript | ## Code Before:
import React, { useState, FunctionComponent, ChangeEvent } from "react";
type Props = {
initialVolume: number;
onChangeVolume: (volume: number) => void;
};
const Component: FunctionComponent<Props> = props => {
const [volume, setVolume] = useState(props.initialVolume);
const onChange = (event: ChangeEvent<HTMLInputElement>) => {
const volume = parseFloat(event.target.value);
setVolume(volume);
props.onChangeVolume(volume);
};
return (
<form id="controls">
Volume{" "}
<input
type="range"
min="0"
max="1"
step="0.01"
value={volume}
onChange={onChange}
/>
</form>
);
};
export default Component;
## Instruction:
Fix "Form elements do not have associated labels"
(from Lighthouse Accessibility audit)
## Code After:
import React, { useState, FunctionComponent, ChangeEvent } from "react";
type Props = {
initialVolume: number;
onChangeVolume: (volume: number) => void;
};
const Component: FunctionComponent<Props> = props => {
const [volume, setVolume] = useState(props.initialVolume);
const onChange = (event: ChangeEvent<HTMLInputElement>) => {
const volume = parseFloat(event.target.value);
setVolume(volume);
props.onChangeVolume(volume);
};
return (
<form id="controls">
<label>
Volume{" "}
<input
type="range"
min="0"
max="1"
step="0.01"
value={volume}
onChange={onChange}
/>
</label>
</form>
);
};
export default Component;
| import React, { useState, FunctionComponent, ChangeEvent } from "react";
type Props = {
initialVolume: number;
onChangeVolume: (volume: number) => void;
};
const Component: FunctionComponent<Props> = props => {
const [volume, setVolume] = useState(props.initialVolume);
const onChange = (event: ChangeEvent<HTMLInputElement>) => {
const volume = parseFloat(event.target.value);
setVolume(volume);
props.onChangeVolume(volume);
};
return (
<form id="controls">
+ <label>
- Volume{" "}
+ Volume{" "}
? ++
- <input
+ <input
? ++
- type="range"
+ type="range"
? ++
- min="0"
+ min="0"
? ++
- max="1"
+ max="1"
? ++
- step="0.01"
+ step="0.01"
? ++
- value={volume}
+ value={volume}
? ++
- onChange={onChange}
+ onChange={onChange}
? ++
- />
+ />
? ++
+ </label>
</form>
);
};
export default Component; | 20 | 0.625 | 11 | 9 |
0dd65eb0458165877c3c6f7832356db4c48f1f19 | recipes/xorg-lib/libdmx_1.1.0.bb | recipes/xorg-lib/libdmx_1.1.0.bb | require xorg-lib-common.inc
DESCRIPTION = "X11 Distributed Multihead extension library"
DEPENDS += "libxext dmxproto fso-specs"
PR = "r2"
PE = "1"
SRC_URI[archive.md5sum] = "a2fcf0382837888d3781b714489a8999"
SRC_URI[archive.sha256sum] = "1904a8f848cc5d76105cb07707890aca095540a37fb0a63d359f71da51d3e2d5"
| require xorg-lib-common.inc
DESCRIPTION = "X11 Distributed Multihead extension library"
DEPENDS += "libxext dmxproto"
PR = "r3"
PE = "1"
SRC_URI[archive.md5sum] = "a2fcf0382837888d3781b714489a8999"
SRC_URI[archive.sha256sum] = "1904a8f848cc5d76105cb07707890aca095540a37fb0a63d359f71da51d3e2d5"
| Revert "libdmx: Add fso-specs to DEPENDS" | Revert "libdmx: Add fso-specs to DEPENDS"
Mistake on my part from debugging the other issue. Bump PR to keep feeds sane.
This reverts commit ff0e53a12cc2f99f3529e409cbf04950ea7401ca.
| BitBake | mit | JamesAng/goe,John-NY/overo-oe,John-NY/overo-oe,JamesAng/oe,scottellis/overo-oe,JamesAng/goe,sampov2/audio-openembedded,sutajiokousagi/openembedded,mrchapp/arago-oe-dev,anguslees/openembedded-android,SIFTeam/openembedded,buglabs/oe-buglabs,mrchapp/arago-oe-dev,hulifox008/openembedded,libo/openembedded,xifengchuo/openembedded,nx111/openembeded_openpli2.1_nx111,hulifox008/openembedded,nx111/openembeded_openpli2.1_nx111,dave-billin/overo-ui-moos-auv,openembedded/openembedded,nx111/openembeded_openpli2.1_nx111,bticino/openembedded,dave-billin/overo-ui-moos-auv,thebohemian/openembedded,sentient-energy/emsw-oe-mirror,openembedded/openembedded,nx111/openembeded_openpli2.1_nx111,anguslees/openembedded-android,BlackPole/bp-openembedded,openembedded/openembedded,mrchapp/arago-oe-dev,bticino/openembedded,sentient-energy/emsw-oe-mirror,anguslees/openembedded-android,sampov2/audio-openembedded,nx111/openembeded_openpli2.1_nx111,buglabs/oe-buglabs,openembedded/openembedded,sledz/oe,scottellis/overo-oe,trini/openembedded,trini/openembedded,SIFTeam/openembedded,anguslees/openembedded-android,JamesAng/goe,trini/openembedded,hulifox008/openembedded,sutajiokousagi/openembedded,buglabs/oe-buglabs,buglabs/oe-buglabs,dellysunnymtech/sakoman-oe,BlackPole/bp-openembedded,dellysunnymtech/sakoman-oe,crystalfontz/openembedded,JamesAng/goe,Martix/Eonos,rascalmicro/openembedded-rascal,giobauermeister/openembedded,giobauermeister/openembedded,thebohemian/openembedded,dave-billin/overo-ui-moos-auv,BlackPole/bp-openembedded,nx111/openembeded_openpli2.1_nx111,yyli/overo-oe,openembedded/openembedded,openpli-arm/openembedded,hulifox008/openembedded,BlackPole/bp-openembedded,openpli-arm/openembedded,openembedded/openembedded,bticino/openembedded,openembedded/openembedded,xifengchuo/openembedded,scottellis/overo-oe,openpli-arm/openembedded,xifengchuo/openembedded,sutajiokousagi/openembedded,BlackPole/bp-openembedded,sutajiokousagi/openembedded,sledz/oe,libo/openembedded,yyli/overo-oe,scottellis/overo-oe,sledz/oe,JamesAng/oe,Martix/Eonos,openpli-arm/openembedded,xifengchuo/openembedded,anguslees/openembedded-android,dellysunnymtech/sakoman-oe,John-NY/overo-oe,SIFTeam/openembedded,Martix/Eonos,John-NY/overo-oe,openembedded/openembedded,sentient-energy/emsw-oe-mirror,JamesAng/goe,mrchapp/arago-oe-dev,giobauermeister/openembedded,libo/openembedded,rascalmicro/openembedded-rascal,giobauermeister/openembedded,sampov2/audio-openembedded,sentient-energy/emsw-oe-mirror,crystalfontz/openembedded,dellysunnymtech/sakoman-oe,openpli-arm/openembedded,trini/openembedded,mrchapp/arago-oe-dev,bticino/openembedded,sledz/oe,sledz/oe,giobauermeister/openembedded,dellysunnymtech/sakoman-oe,crystalfontz/openembedded,trini/openembedded,thebohemian/openembedded,buglabs/oe-buglabs,bticino/openembedded,Martix/Eonos,sampov2/audio-openembedded,trini/openembedded,yyli/overo-oe,dave-billin/overo-ui-moos-auv,JamesAng/goe,SIFTeam/openembedded,thebohemian/openembedded,JamesAng/goe,xifengchuo/openembedded,dave-billin/overo-ui-moos-auv,xifengchuo/openembedded,Martix/Eonos,dellysunnymtech/sakoman-oe,crystalfontz/openembedded,SIFTeam/openembedded,sledz/oe,libo/openembedded,thebohemian/openembedded,trini/openembedded,buglabs/oe-buglabs,hulifox008/openembedded,rascalmicro/openembedded-rascal,buglabs/oe-buglabs,crystalfontz/openembedded,openembedded/openembedded,libo/openembedded,xifengchuo/openembedded,SIFTeam/openembedded,crystalfontz/openembedded,scottellis/overo-oe,libo/openembedded,rascalmicro/openembedded-rascal,giobauermeister/openembedded,hulifox008/openembedded,JamesAng/oe,rascalmicro/openembedded-rascal,mrchapp/arago-oe-dev,scottellis/overo-oe,sutajiokousagi/openembedded,BlackPole/bp-openembedded,nx111/openembeded_openpli2.1_nx111,bticino/openembedded,bticino/openembedded,sutajiokousagi/openembedded,yyli/overo-oe,giobauermeister/openembedded,giobauermeister/openembedded,John-NY/overo-oe,thebohemian/openembedded,sentient-energy/emsw-oe-mirror,yyli/overo-oe,yyli/overo-oe,sampov2/audio-openembedded,sentient-energy/emsw-oe-mirror,openembedded/openembedded,sutajiokousagi/openembedded,JamesAng/oe,sledz/oe,crystalfontz/openembedded,Martix/Eonos,dellysunnymtech/sakoman-oe,SIFTeam/openembedded,yyli/overo-oe,xifengchuo/openembedded,thebohemian/openembedded,openpli-arm/openembedded,rascalmicro/openembedded-rascal,rascalmicro/openembedded-rascal,sentient-energy/emsw-oe-mirror,anguslees/openembedded-android,giobauermeister/openembedded,dave-billin/overo-ui-moos-auv,sampov2/audio-openembedded,buglabs/oe-buglabs,dellysunnymtech/sakoman-oe,mrchapp/arago-oe-dev,John-NY/overo-oe,hulifox008/openembedded,JamesAng/oe,nx111/openembeded_openpli2.1_nx111,dave-billin/overo-ui-moos-auv,openembedded/openembedded,BlackPole/bp-openembedded,yyli/overo-oe,JamesAng/oe,openpli-arm/openembedded,rascalmicro/openembedded-rascal,JamesAng/oe,Martix/Eonos,sampov2/audio-openembedded,dellysunnymtech/sakoman-oe,scottellis/overo-oe,xifengchuo/openembedded,libo/openembedded,anguslees/openembedded-android,John-NY/overo-oe | bitbake | ## Code Before:
require xorg-lib-common.inc
DESCRIPTION = "X11 Distributed Multihead extension library"
DEPENDS += "libxext dmxproto fso-specs"
PR = "r2"
PE = "1"
SRC_URI[archive.md5sum] = "a2fcf0382837888d3781b714489a8999"
SRC_URI[archive.sha256sum] = "1904a8f848cc5d76105cb07707890aca095540a37fb0a63d359f71da51d3e2d5"
## Instruction:
Revert "libdmx: Add fso-specs to DEPENDS"
Mistake on my part from debugging the other issue. Bump PR to keep feeds sane.
This reverts commit ff0e53a12cc2f99f3529e409cbf04950ea7401ca.
## Code After:
require xorg-lib-common.inc
DESCRIPTION = "X11 Distributed Multihead extension library"
DEPENDS += "libxext dmxproto"
PR = "r3"
PE = "1"
SRC_URI[archive.md5sum] = "a2fcf0382837888d3781b714489a8999"
SRC_URI[archive.sha256sum] = "1904a8f848cc5d76105cb07707890aca095540a37fb0a63d359f71da51d3e2d5"
| require xorg-lib-common.inc
DESCRIPTION = "X11 Distributed Multihead extension library"
- DEPENDS += "libxext dmxproto fso-specs"
? ----------
+ DEPENDS += "libxext dmxproto"
- PR = "r2"
? ^
+ PR = "r3"
? ^
PE = "1"
SRC_URI[archive.md5sum] = "a2fcf0382837888d3781b714489a8999"
SRC_URI[archive.sha256sum] = "1904a8f848cc5d76105cb07707890aca095540a37fb0a63d359f71da51d3e2d5" | 4 | 0.444444 | 2 | 2 |
7b375eb2e0cb28a55c97150a9d964967a6ba6618 | src/lib.rs | src/lib.rs |
pub fn puzzle(input: &str) -> usize {
0
}
#[cfg(test)]
mod test {
use super::*;
}
|
pub fn puzzle(input: &str) -> usize {
let initial_world_state = WorldState {
};
let mut queue = vec![initial_world_state];
while !queue.is_empty() {
let world = queue.remove(0);
}
panic!("Exhausted all possible moves without finding end condition!");
}
pub struct WorldState {
}
#[cfg(test)]
mod test {
use super::*;
}
| Set up a BFS queue | Set up a BFS queue
| Rust | mit | carols10cents/adventofcode-rs | rust | ## Code Before:
pub fn puzzle(input: &str) -> usize {
0
}
#[cfg(test)]
mod test {
use super::*;
}
## Instruction:
Set up a BFS queue
## Code After:
pub fn puzzle(input: &str) -> usize {
let initial_world_state = WorldState {
};
let mut queue = vec![initial_world_state];
while !queue.is_empty() {
let world = queue.remove(0);
}
panic!("Exhausted all possible moves without finding end condition!");
}
pub struct WorldState {
}
#[cfg(test)]
mod test {
use super::*;
}
|
pub fn puzzle(input: &str) -> usize {
+ let initial_world_state = WorldState {
+
+ };
+ let mut queue = vec![initial_world_state];
+ while !queue.is_empty() {
+ let world = queue.remove(0);
+
- 0
? ^
+ }
? ^
+
+ panic!("Exhausted all possible moves without finding end condition!");
+
+ }
+
+ pub struct WorldState {
+
}
#[cfg(test)]
mod test {
use super::*;
} | 16 | 1.6 | 15 | 1 |
d586cd9054723a20a2260944eaaddd17a79abcc2 | package.json | package.json | {
"name": "fake",
"version": "1.0.0",
"description": "",
"author": "Cristi Socea <office@soceacristian.ro>",
"devDependencies": {
"babelify": "^6.1.3",
"browserify": "^11.0.1",
"gulp": "^3.9.0",
"gulp-jasmine": "^2.0.1",
"gulp-karma": "0.0.4",
"gulp-sourcemaps": "^1.5.2",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.1",
"karma-spec-reporter": "0.0.20",
"phantomjs": "^1.9.18",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.3.1"
}
}
| {
"name": "fake",
"version": "1.0.0",
"description": "",
"author": "Cristi Socea <office@soceacristian.ro>",
"devDependencies": {
"babelify": "^6.1.3",
"browserify": "^11.0.1",
"gulp": "^3.9.0",
"gulp-jasmine": "^2.0.1",
"gulp-karma": "0.0.4",
"gulp-preprocess": "^1.2.0",
"gulp-sourcemaps": "^1.5.2",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.1",
"karma-spec-reporter": "0.0.20",
"phantomjs": "^1.9.18",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.3.1"
}
}
| Add gulp preprocess to dev deps | Add gulp preprocess to dev deps
| JSON | mit | chris-equis/angular-fake,chris-equis/angular-fake | json | ## Code Before:
{
"name": "fake",
"version": "1.0.0",
"description": "",
"author": "Cristi Socea <office@soceacristian.ro>",
"devDependencies": {
"babelify": "^6.1.3",
"browserify": "^11.0.1",
"gulp": "^3.9.0",
"gulp-jasmine": "^2.0.1",
"gulp-karma": "0.0.4",
"gulp-sourcemaps": "^1.5.2",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.1",
"karma-spec-reporter": "0.0.20",
"phantomjs": "^1.9.18",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.3.1"
}
}
## Instruction:
Add gulp preprocess to dev deps
## Code After:
{
"name": "fake",
"version": "1.0.0",
"description": "",
"author": "Cristi Socea <office@soceacristian.ro>",
"devDependencies": {
"babelify": "^6.1.3",
"browserify": "^11.0.1",
"gulp": "^3.9.0",
"gulp-jasmine": "^2.0.1",
"gulp-karma": "0.0.4",
"gulp-preprocess": "^1.2.0",
"gulp-sourcemaps": "^1.5.2",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.1",
"karma-spec-reporter": "0.0.20",
"phantomjs": "^1.9.18",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.3.1"
}
}
| {
"name": "fake",
"version": "1.0.0",
"description": "",
"author": "Cristi Socea <office@soceacristian.ro>",
"devDependencies": {
"babelify": "^6.1.3",
"browserify": "^11.0.1",
"gulp": "^3.9.0",
"gulp-jasmine": "^2.0.1",
"gulp-karma": "0.0.4",
+ "gulp-preprocess": "^1.2.0",
"gulp-sourcemaps": "^1.5.2",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.1",
"karma-spec-reporter": "0.0.20",
"phantomjs": "^1.9.18",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.3.1"
}
} | 1 | 0.043478 | 1 | 0 |
b2150d8929d4db80e72d6baafaa38fda28424f7b | score.py | score.py |
import wikipedia
import sys
sample = 'Philosophers'
# help(cat_page)
def getPagesIn(category):
"""Should return the list of pages that the provided category contains"""
page_name = 'Category:' + category
page = wikipedia.page(page_name)
return page.links
def readability_score(page):
summary = wikipedia.summary(page)
return 100./(len(summary)+1) # the shorter the better, but avoid zero
def get_scored_table(category):
print category
pages = getPagesIn(category)
scores = []
for page in pages:
scores.append((page, readability_score(page)))
scores.sort(key=lambda s: s[1])
return scores
if __name__ == "__main__":
categories = sys.argv
del categories[0]
for category in categories:
scores = get_scored_table(category)
for page, score in scores:
print page, score
print '---'
|
import wikipedia
import sys
import os
sample = 'Philosophers'
# help(cat_page)
def getPagesIn(category):
"""Return the list of pages contained in the provided category"""
# wikipedia module doesn't provide category listing, let's retrieve it
# with some quick & dirty shell command for now
cmd = ("wget 'https://en.wikipedia.org/wiki/Category:"
"%(category)s'"
" --quiet -O - " # use standard output quietly
"|grep '<li>' " # get only line with list element
"|grep -v Category" # exclude subcategory
"|sed -e 's/.*title=\"//' -e 's/\">.*//'" # extract title
"") % locals()
fetched_titles = os.popen(cmd)
pages = []
for line in fetched_titles:
pages.append(line[:-1])
return pages
def readability_score(page):
"""Return a readability score for the given page title"""
summary = wikipedia.summary(page)
return 100./(len(summary)+1) # the shorter the better, but avoid zero
def get_scored_table(category):
"""Return an array of (title, score) tuples for pages in category"""
print category
pages = getPagesIn(category)
scores = []
for page in pages:
scores.append((page, readability_score(page)))
scores.sort(key=lambda s: s[1])
return scores
if __name__ == "__main__":
categories = sys.argv
del categories[0]
for category in categories:
scores = get_scored_table(category)
for page, score in scores:
print page, score
print '---'
| Use wget to fetch a list of categories + short description of each function | Use wget to fetch a list of categories + short description of each function
| Python | agpl-3.0 | psychoslave/catscore,psychoslave/catscore | python | ## Code Before:
import wikipedia
import sys
sample = 'Philosophers'
# help(cat_page)
def getPagesIn(category):
"""Should return the list of pages that the provided category contains"""
page_name = 'Category:' + category
page = wikipedia.page(page_name)
return page.links
def readability_score(page):
summary = wikipedia.summary(page)
return 100./(len(summary)+1) # the shorter the better, but avoid zero
def get_scored_table(category):
print category
pages = getPagesIn(category)
scores = []
for page in pages:
scores.append((page, readability_score(page)))
scores.sort(key=lambda s: s[1])
return scores
if __name__ == "__main__":
categories = sys.argv
del categories[0]
for category in categories:
scores = get_scored_table(category)
for page, score in scores:
print page, score
print '---'
## Instruction:
Use wget to fetch a list of categories + short description of each function
## Code After:
import wikipedia
import sys
import os
sample = 'Philosophers'
# help(cat_page)
def getPagesIn(category):
"""Return the list of pages contained in the provided category"""
# wikipedia module doesn't provide category listing, let's retrieve it
# with some quick & dirty shell command for now
cmd = ("wget 'https://en.wikipedia.org/wiki/Category:"
"%(category)s'"
" --quiet -O - " # use standard output quietly
"|grep '<li>' " # get only line with list element
"|grep -v Category" # exclude subcategory
"|sed -e 's/.*title=\"//' -e 's/\">.*//'" # extract title
"") % locals()
fetched_titles = os.popen(cmd)
pages = []
for line in fetched_titles:
pages.append(line[:-1])
return pages
def readability_score(page):
"""Return a readability score for the given page title"""
summary = wikipedia.summary(page)
return 100./(len(summary)+1) # the shorter the better, but avoid zero
def get_scored_table(category):
"""Return an array of (title, score) tuples for pages in category"""
print category
pages = getPagesIn(category)
scores = []
for page in pages:
scores.append((page, readability_score(page)))
scores.sort(key=lambda s: s[1])
return scores
if __name__ == "__main__":
categories = sys.argv
del categories[0]
for category in categories:
scores = get_scored_table(category)
for page, score in scores:
print page, score
print '---'
|
import wikipedia
import sys
+ import os
sample = 'Philosophers'
# help(cat_page)
def getPagesIn(category):
- """Should return the list of pages that the provided category contains"""
? ^^^^^^^^ - ^ ---------
+ """Return the list of pages contained in the provided category"""
? ^ +++ ^^^^^^^
- page_name = 'Category:' + category
- page = wikipedia.page(page_name)
+ # wikipedia module doesn't provide category listing, let's retrieve it
+ # with some quick & dirty shell command for now
+ cmd = ("wget 'https://en.wikipedia.org/wiki/Category:"
+ "%(category)s'"
+ " --quiet -O - " # use standard output quietly
+ "|grep '<li>' " # get only line with list element
+ "|grep -v Category" # exclude subcategory
+ "|sed -e 's/.*title=\"//' -e 's/\">.*//'" # extract title
+ "") % locals()
+ fetched_titles = os.popen(cmd)
+ pages = []
+ for line in fetched_titles:
+ pages.append(line[:-1])
+
- return page.links
? -----
+ return pages
def readability_score(page):
+ """Return a readability score for the given page title"""
summary = wikipedia.summary(page)
return 100./(len(summary)+1) # the shorter the better, but avoid zero
def get_scored_table(category):
+ """Return an array of (title, score) tuples for pages in category"""
print category
pages = getPagesIn(category)
scores = []
for page in pages:
scores.append((page, readability_score(page)))
scores.sort(key=lambda s: s[1])
return scores
if __name__ == "__main__":
categories = sys.argv
del categories[0]
for category in categories:
scores = get_scored_table(category)
for page, score in scores:
print page, score
print '---' | 23 | 0.589744 | 19 | 4 |
c065772746dbde7997ac583bbc49e54f1fed34cd | client/src/js/App.js | client/src/js/App.js | import { Component } from 'react';
import h from 'react-hyperscript';
import Quote from './components/Quote';
import getRandomQuote from './utils/getRandomQuote';
class App extends Component {
constructor(props) {
super(props);
this.state = {
text: 'Loading...',
name: 'website',
};
}
componentDidMount() {
getRandomQuote()
.then(quote => {
const { text, name } = quote;
this.setState({ text, name });
})
.catch(err => {
this.setState({ text: err });
console.error(err);
});
}
render() {
const { text, name } = this.state;
return h(Quote, { text, name });
}
}
export default App;
| import { Component } from 'react';
import h from 'react-hyperscript';
import Quote from './components/Quote';
import getRandomQuote from './utils/getRandomQuote';
class App extends Component {
constructor(props) {
super(props);
this.state = {
text: 'Loading...',
name: 'website',
};
}
componentDidMount() {
getRandomQuote()
.then(quote => {
const { text, name } = quote;
this.setState({ text, name });
})
.catch(err => {
this.setState({
text: err,
name: 'website',
});
console.error(err);
});
}
render() {
const { text, name } = this.state;
return h(Quote, { text, name });
}
}
export default App;
| Revert to name 'website' on error | Revert to name 'website' on error
| JavaScript | mit | richarddewit/random-quotes,richarddewit/random-quotes | javascript | ## Code Before:
import { Component } from 'react';
import h from 'react-hyperscript';
import Quote from './components/Quote';
import getRandomQuote from './utils/getRandomQuote';
class App extends Component {
constructor(props) {
super(props);
this.state = {
text: 'Loading...',
name: 'website',
};
}
componentDidMount() {
getRandomQuote()
.then(quote => {
const { text, name } = quote;
this.setState({ text, name });
})
.catch(err => {
this.setState({ text: err });
console.error(err);
});
}
render() {
const { text, name } = this.state;
return h(Quote, { text, name });
}
}
export default App;
## Instruction:
Revert to name 'website' on error
## Code After:
import { Component } from 'react';
import h from 'react-hyperscript';
import Quote from './components/Quote';
import getRandomQuote from './utils/getRandomQuote';
class App extends Component {
constructor(props) {
super(props);
this.state = {
text: 'Loading...',
name: 'website',
};
}
componentDidMount() {
getRandomQuote()
.then(quote => {
const { text, name } = quote;
this.setState({ text, name });
})
.catch(err => {
this.setState({
text: err,
name: 'website',
});
console.error(err);
});
}
render() {
const { text, name } = this.state;
return h(Quote, { text, name });
}
}
export default App;
| import { Component } from 'react';
import h from 'react-hyperscript';
import Quote from './components/Quote';
import getRandomQuote from './utils/getRandomQuote';
class App extends Component {
constructor(props) {
super(props);
this.state = {
text: 'Loading...',
name: 'website',
};
}
componentDidMount() {
getRandomQuote()
.then(quote => {
const { text, name } = quote;
this.setState({ text, name });
})
.catch(err => {
- this.setState({ text: err });
? --------------
+ this.setState({
+ text: err,
+ name: 'website',
+ });
console.error(err);
});
}
render() {
const { text, name } = this.state;
return h(Quote, { text, name });
}
}
export default App; | 5 | 0.142857 | 4 | 1 |
6c729f74921402a36186aff9f68de71a9d7b20b4 | README.md | README.md | An extension of EditText that has a pin-code style
| PinCodeEditText is and EditText with pin code style, It is easy to use and customizable.
Requirement
--------
Android API 15 or higher
Download
--------
Download the latest version in Gradle:
```groovy
compile 'com.oakkub:pincode-edittext:1.0.1'
```
Or Maven:
```xml
<dependency>
<groupId>com.oakkub</groupId>
<artifactId>pincode-edittext</artifactId>
<version>1.0.1</version>
<type>pom</type>
</dependency>
```
# Usage
--------
Include `PinCodeEditText` in your layout XML
```xml
<com.oakkub.android.PinCodeEditText
android:id="@+id/simplePinCodeEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLength="4"
android:textColor="@android:color/white"
app:pinBackgroundColor="@color/colorPrimary"
app:pinBorderColor="@color/colorPrimary"
app:pinMaskCharacter="#"
app:pinNextPinBackgroundColor="@color/colorAccent"
app:pinNextPinBorderColor="@color/colorAccent"
app:pinShowAsPassword="true"
app:pinShowHighlightNextPin="true"/>
```
License
--------
Copyright 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| Update readme for version 1.0.1 | Update readme for version 1.0.1 | Markdown | apache-2.0 | oakkub/pincode-edittext | markdown | ## Code Before:
An extension of EditText that has a pin-code style
## Instruction:
Update readme for version 1.0.1
## Code After:
PinCodeEditText is and EditText with pin code style, It is easy to use and customizable.
Requirement
--------
Android API 15 or higher
Download
--------
Download the latest version in Gradle:
```groovy
compile 'com.oakkub:pincode-edittext:1.0.1'
```
Or Maven:
```xml
<dependency>
<groupId>com.oakkub</groupId>
<artifactId>pincode-edittext</artifactId>
<version>1.0.1</version>
<type>pom</type>
</dependency>
```
# Usage
--------
Include `PinCodeEditText` in your layout XML
```xml
<com.oakkub.android.PinCodeEditText
android:id="@+id/simplePinCodeEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLength="4"
android:textColor="@android:color/white"
app:pinBackgroundColor="@color/colorPrimary"
app:pinBorderColor="@color/colorPrimary"
app:pinMaskCharacter="#"
app:pinNextPinBackgroundColor="@color/colorAccent"
app:pinNextPinBorderColor="@color/colorAccent"
app:pinShowAsPassword="true"
app:pinShowHighlightNextPin="true"/>
```
License
--------
Copyright 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| - An extension of EditText that has a pin-code style
+ PinCodeEditText is and EditText with pin code style, It is easy to use and customizable.
+
+ Requirement
+ --------
+ Android API 15 or higher
+
+ Download
+ --------
+ Download the latest version in Gradle:
+ ```groovy
+ compile 'com.oakkub:pincode-edittext:1.0.1'
+ ```
+ Or Maven:
+ ```xml
+ <dependency>
+ <groupId>com.oakkub</groupId>
+ <artifactId>pincode-edittext</artifactId>
+ <version>1.0.1</version>
+ <type>pom</type>
+ </dependency>
+ ```
+
+ # Usage
+ --------
+ Include `PinCodeEditText` in your layout XML
+ ```xml
+ <com.oakkub.android.PinCodeEditText
+ android:id="@+id/simplePinCodeEditText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:maxLength="4"
+ android:textColor="@android:color/white"
+ app:pinBackgroundColor="@color/colorPrimary"
+ app:pinBorderColor="@color/colorPrimary"
+ app:pinMaskCharacter="#"
+ app:pinNextPinBackgroundColor="@color/colorAccent"
+ app:pinNextPinBorderColor="@color/colorAccent"
+ app:pinShowAsPassword="true"
+ app:pinShowHighlightNextPin="true"/>
+ ```
+
+
+ License
+ --------
+
+ Copyright 2017
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ | 61 | 61 | 60 | 1 |
c17d2ec6f3d4728829e8f8965f41ef55dc89acb7 | lib/Path.js | lib/Path.js |
const path = require('path')
class Path {
static resolve (pathOrEntity, suffix) {
if (typeof pathOrEntity === 'string') {
return `/api_v1_${pathOrEntity}/${suffix}`
} else {
return path.join(pathOrEntity.path, pathOrEntity.getAsInfo ? 'info' : `${suffix}`)
}
}
}
module.exports = Path
|
const path = require('path')
class Path {
static resolve (pathOrEntity, suffix) {
if (typeof pathOrEntity === 'string') {
return `/api_v1_${pathOrEntity}/${suffix}`
} else if (suffix === 'search') {
return path.join(pathOrEntity.path, pathOrEntity.getAsInfo ? 'info' : suffix)
} else {
return path.join(pathOrEntity.path, suffix)
}
}
}
module.exports = Path
| Convert suffix when suffix is search only | fix: Convert suffix when suffix is search only
| JavaScript | mit | Leko/node-nextengine | javascript | ## Code Before:
const path = require('path')
class Path {
static resolve (pathOrEntity, suffix) {
if (typeof pathOrEntity === 'string') {
return `/api_v1_${pathOrEntity}/${suffix}`
} else {
return path.join(pathOrEntity.path, pathOrEntity.getAsInfo ? 'info' : `${suffix}`)
}
}
}
module.exports = Path
## Instruction:
fix: Convert suffix when suffix is search only
## Code After:
const path = require('path')
class Path {
static resolve (pathOrEntity, suffix) {
if (typeof pathOrEntity === 'string') {
return `/api_v1_${pathOrEntity}/${suffix}`
} else if (suffix === 'search') {
return path.join(pathOrEntity.path, pathOrEntity.getAsInfo ? 'info' : suffix)
} else {
return path.join(pathOrEntity.path, suffix)
}
}
}
module.exports = Path
|
const path = require('path')
class Path {
static resolve (pathOrEntity, suffix) {
if (typeof pathOrEntity === 'string') {
return `/api_v1_${pathOrEntity}/${suffix}`
+ } else if (suffix === 'search') {
+ return path.join(pathOrEntity.path, pathOrEntity.getAsInfo ? 'info' : suffix)
} else {
- return path.join(pathOrEntity.path, pathOrEntity.getAsInfo ? 'info' : `${suffix}`)
+ return path.join(pathOrEntity.path, suffix)
}
}
}
module.exports = Path | 4 | 0.285714 | 3 | 1 |
a692ad6f92035854edaa1ac723ab5fce29f6a986 | README.md | README.md | Maze generator and solver
| Maze generator and solver
For more info please check out the wiki page !
https://github.com/Robert96ionita/Maze.wiki.git
| Update readme to contain wiki | Update readme to contain wiki | Markdown | mit | Robert96ionita/Maze | markdown | ## Code Before:
Maze generator and solver
## Instruction:
Update readme to contain wiki
## Code After:
Maze generator and solver
For more info please check out the wiki page !
https://github.com/Robert96ionita/Maze.wiki.git
| Maze generator and solver
+
+ For more info please check out the wiki page !
+ https://github.com/Robert96ionita/Maze.wiki.git | 3 | 3 | 3 | 0 |
e18925b21822f60d49dfef8a430b72c91d26627f | client/README.md | client/README.md | Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Fixtures
During development phase, server api are simulated.
Fixtures are in `src/app/in-memory-data.service.ts`
| Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Fixtures
During development phase, server api are simulated.
Fixtures are in `src/app/in-memory-data.service.ts`
### Server version vs In-memory-data
Server api can be activated by :
#### 1. in ```src/app/isari-data.service.ts```
* Change an uncomment ```dataUrl```, ```layoutUrl```, ```enumUrl```
* Uncomment / comment response handle in promise return of ```getPeople```, ```getEnum``` and ```getLayout``` methods
#### 2. in ```src/app/app.module.ts```
* Comment usage of ```InMemoryWebApiModule``` : import section of the module ```InMemoryWebApiModule.forRoot(InMemoryDataService)```
| Add information to set server api in front | Add information to set server api in front
| Markdown | agpl-3.0 | SciencesPo/isari,SciencesPo/isari,SciencesPo/isari,SciencesPo/isari | markdown | ## Code Before:
Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Fixtures
During development phase, server api are simulated.
Fixtures are in `src/app/in-memory-data.service.ts`
## Instruction:
Add information to set server api in front
## Code After:
Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Fixtures
During development phase, server api are simulated.
Fixtures are in `src/app/in-memory-data.service.ts`
### Server version vs In-memory-data
Server api can be activated by :
#### 1. in ```src/app/isari-data.service.ts```
* Change an uncomment ```dataUrl```, ```layoutUrl```, ```enumUrl```
* Uncomment / comment response handle in promise return of ```getPeople```, ```getEnum``` and ```getLayout``` methods
#### 2. in ```src/app/app.module.ts```
* Comment usage of ```InMemoryWebApiModule``` : import section of the module ```InMemoryWebApiModule.forRoot(InMemoryDataService)```
| Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Fixtures
During development phase, server api are simulated.
Fixtures are in `src/app/in-memory-data.service.ts`
+
+ ### Server version vs In-memory-data
+
+ Server api can be activated by :
+
+ #### 1. in ```src/app/isari-data.service.ts```
+
+ * Change an uncomment ```dataUrl```, ```layoutUrl```, ```enumUrl```
+ * Uncomment / comment response handle in promise return of ```getPeople```, ```getEnum``` and ```getLayout``` methods
+
+ #### 2. in ```src/app/app.module.ts```
+
+ * Comment usage of ```InMemoryWebApiModule``` : import section of the module ```InMemoryWebApiModule.forRoot(InMemoryDataService)``` | 13 | 1.857143 | 13 | 0 |
ee47331da6a9a88dbef3899050c22d26bf665b8d | _data/events.yml | _data/events.yml | churchwide:
-
date: 2016-07-18
end-date: 2016-07-24
name: Student Mission Trip Summer 2016
grades-6-12:
-
date: 2016-07-18
end-date: 2016-07-24
name: Student Mission Trip Summer 2016
| churchwide:
-
date: 2016-08-13
name: Men's Breakfast and Building Renovation
grades-6-12:
-
| Remove MT from calendar and add men's breakfast | Remove MT from calendar and add men's breakfast | YAML | mit | Mountainview-WebDesign/lifestonechurch,Mountainview-WebDesign/lifestonechurch,Mountainview-WebDesign/lifestonechurch | yaml | ## Code Before:
churchwide:
-
date: 2016-07-18
end-date: 2016-07-24
name: Student Mission Trip Summer 2016
grades-6-12:
-
date: 2016-07-18
end-date: 2016-07-24
name: Student Mission Trip Summer 2016
## Instruction:
Remove MT from calendar and add men's breakfast
## Code After:
churchwide:
-
date: 2016-08-13
name: Men's Breakfast and Building Renovation
grades-6-12:
-
| churchwide:
-
- date: 2016-07-18
? ^ ^
+ date: 2016-08-13
? ^ ^
+ name: Men's Breakfast and Building Renovation
- end-date: 2016-07-24
- name: Student Mission Trip Summer 2016
grades-6-12:
-
- date: 2016-07-18
- end-date: 2016-07-24
- name: Student Mission Trip Summer 2016 | 8 | 0.8 | 2 | 6 |
9d7005fbe7d093099bf9398ce370a74dec9155bd | ckanext/dia_theme/fanstatic/banner.js | ckanext/dia_theme/fanstatic/banner.js | 'use strict';
(function ($) {
var showBanner = function (content) {
if (content) {
$('header').after(content)
}
}
var getBannerHost = function () {
var local = window.location.host.startsWith('ckan-gateway')
if (local) {
return 'http://localhost:8000'
}
var production = window.location.host.startsWith('catalogue')
return production ? '//data.govt.nz' : '//diadata-uat.cwp.govt.nz'
}
var getBanner = function () {
$.ajax({
url: getBannerHost() + '/api/banner',
success: function (banner) {
if (banner.enabled) {
showBanner(banner.content)
}
}
})
}
getBanner();
})($)
| 'use strict';
(function ($) {
var showBanner = function (content) {
if (content) {
$('header.site-header').after(content)
}
}
var getBannerHost = function () {
var local = window.location.host.startsWith('ckan-gateway')
if (local) {
return 'http://localhost:8000'
}
var production = window.location.host.startsWith('catalogue')
return production ? '//data.govt.nz' : '//diadata-uat.cwp.govt.nz'
}
var getBanner = function () {
$.ajax({
url: getBannerHost() + '/api/banner',
success: function (banner) {
if (banner.enabled) {
showBanner(banner.content)
}
}
})
}
getBanner();
})($)
| Fix issue with nested headers on page in admin area | Fix issue with nested headers on page in admin area
| JavaScript | agpl-3.0 | data-govt-nz/ckanext-dia_theme,data-govt-nz/ckanext-dia_theme,data-govt-nz/ckanext-dia_theme | javascript | ## Code Before:
'use strict';
(function ($) {
var showBanner = function (content) {
if (content) {
$('header').after(content)
}
}
var getBannerHost = function () {
var local = window.location.host.startsWith('ckan-gateway')
if (local) {
return 'http://localhost:8000'
}
var production = window.location.host.startsWith('catalogue')
return production ? '//data.govt.nz' : '//diadata-uat.cwp.govt.nz'
}
var getBanner = function () {
$.ajax({
url: getBannerHost() + '/api/banner',
success: function (banner) {
if (banner.enabled) {
showBanner(banner.content)
}
}
})
}
getBanner();
})($)
## Instruction:
Fix issue with nested headers on page in admin area
## Code After:
'use strict';
(function ($) {
var showBanner = function (content) {
if (content) {
$('header.site-header').after(content)
}
}
var getBannerHost = function () {
var local = window.location.host.startsWith('ckan-gateway')
if (local) {
return 'http://localhost:8000'
}
var production = window.location.host.startsWith('catalogue')
return production ? '//data.govt.nz' : '//diadata-uat.cwp.govt.nz'
}
var getBanner = function () {
$.ajax({
url: getBannerHost() + '/api/banner',
success: function (banner) {
if (banner.enabled) {
showBanner(banner.content)
}
}
})
}
getBanner();
})($)
| 'use strict';
(function ($) {
var showBanner = function (content) {
if (content) {
- $('header').after(content)
+ $('header.site-header').after(content)
? ++++++++++++
}
}
var getBannerHost = function () {
var local = window.location.host.startsWith('ckan-gateway')
if (local) {
return 'http://localhost:8000'
}
var production = window.location.host.startsWith('catalogue')
return production ? '//data.govt.nz' : '//diadata-uat.cwp.govt.nz'
}
var getBanner = function () {
$.ajax({
url: getBannerHost() + '/api/banner',
success: function (banner) {
if (banner.enabled) {
showBanner(banner.content)
}
}
})
}
getBanner();
})($) | 2 | 0.0625 | 1 | 1 |
46d90e521b700bb13edff453c6afb9e788ebedfc | vagrant_base/libqt4/recipes/default.rb | vagrant_base/libqt4/recipes/default.rb | case node[:platform]
when "debian", "ubuntu"
package "libqt4-dev"
package "qt4-qmake"
end | case node['platform']
when "ubuntu"
apt_repository "kubuntu-backports-ppa-deb" do
uri "http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu"
distribution node['lsb']['codename']
components ['main']
key "https://raw.github.com/gist/1208649/51c907099ec6f2003c6e120621f069c3cd1a75e6/gistfile1.txt"
action :add
end
# this LWRP seems to ONLY install deb-src repo if deb_src attribute is set,
# so we pretty much duplicate this resource to work around that. MK.
apt_repository "kubuntu-backports-ppa-deb-src" do
uri "http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu"
distribution node['lsb']['codename']
components ['main']
deb_src true
key "https://raw.github.com/gist/1208649/51c907099ec6f2003c6e120621f069c3cd1a75e6/gistfile1.txt"
action :add
end
end
case node[:platform]
when "debian", "ubuntu"
package "libqt4-dev"
package "qt4-qmake"
end | Use Kubuntu Backports PPA to get libqt and qmake 4.7 for Capybara WebKit | Use Kubuntu Backports PPA to get libqt and qmake 4.7 for Capybara WebKit
| Ruby | mit | DanielG/travis-cookbooks,ardock/travis-cookbooks,Acidburn0zzz/travis-cookbooks,bd808/travis-cookbooks,ardock/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,dracos/travis-cookbooks,alex/travis-cookbooks,Acidburn0zzz/travis-cookbooks,Zarthus/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,tianon/travis-cookbooks,DanielG/travis-cookbooks,spurti-chopra/travis-cookbooks,dracos/travis-cookbooks,ardock/travis-cookbooks,0xCCD/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,Zarthus/travis-cookbooks,Distelli/travis-cookbooks,travis-ci/travis-cookbooks,gavioto/travis-cookbooks,dracos/travis-cookbooks,0xCCD/travis-cookbooks,chef/travis-cookbooks,bd808/travis-cookbooks,Acidburn0zzz/travis-cookbooks,ardock/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,gavioto/travis-cookbooks,dstufft/travis-cookbooks,ljharb/travis-cookbooks,Distelli/travis-cookbooks,Distelli/travis-cookbooks,ljharb/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,travis-ci/travis-cookbooks,johanneswuerbach/travis-cookbooks,dracos/travis-cookbooks,gavioto/travis-cookbooks,spurti-chopra/travis-cookbooks,spurti-chopra/travis-cookbooks,dstufft/travis-cookbooks,DanielG/travis-cookbooks,DanielG/travis-cookbooks,Zarthus/travis-cookbooks,travis-ci/travis-cookbooks,tianon/travis-cookbooks,ljharb/travis-cookbooks,tianon/travis-cookbooks,Zarthus/travis-cookbooks,alex/travis-cookbooks,gavioto/travis-cookbooks,johanneswuerbach/travis-cookbooks,tianon/travis-cookbooks,bd808/travis-cookbooks,tianon/travis-cookbooks,johanneswuerbach/travis-cookbooks,Acidburn0zzz/travis-cookbooks,chef/travis-cookbooks,Distelli/travis-cookbooks | ruby | ## Code Before:
case node[:platform]
when "debian", "ubuntu"
package "libqt4-dev"
package "qt4-qmake"
end
## Instruction:
Use Kubuntu Backports PPA to get libqt and qmake 4.7 for Capybara WebKit
## Code After:
case node['platform']
when "ubuntu"
apt_repository "kubuntu-backports-ppa-deb" do
uri "http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu"
distribution node['lsb']['codename']
components ['main']
key "https://raw.github.com/gist/1208649/51c907099ec6f2003c6e120621f069c3cd1a75e6/gistfile1.txt"
action :add
end
# this LWRP seems to ONLY install deb-src repo if deb_src attribute is set,
# so we pretty much duplicate this resource to work around that. MK.
apt_repository "kubuntu-backports-ppa-deb-src" do
uri "http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu"
distribution node['lsb']['codename']
components ['main']
deb_src true
key "https://raw.github.com/gist/1208649/51c907099ec6f2003c6e120621f069c3cd1a75e6/gistfile1.txt"
action :add
end
end
case node[:platform]
when "debian", "ubuntu"
package "libqt4-dev"
package "qt4-qmake"
end | + case node['platform']
+ when "ubuntu"
+ apt_repository "kubuntu-backports-ppa-deb" do
+ uri "http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu"
+ distribution node['lsb']['codename']
+ components ['main']
+ key "https://raw.github.com/gist/1208649/51c907099ec6f2003c6e120621f069c3cd1a75e6/gistfile1.txt"
+ action :add
+ end
+
+ # this LWRP seems to ONLY install deb-src repo if deb_src attribute is set,
+ # so we pretty much duplicate this resource to work around that. MK.
+ apt_repository "kubuntu-backports-ppa-deb-src" do
+ uri "http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu"
+ distribution node['lsb']['codename']
+ components ['main']
+ deb_src true
+ key "https://raw.github.com/gist/1208649/51c907099ec6f2003c6e120621f069c3cd1a75e6/gistfile1.txt"
+ action :add
+ end
+ end
+
case node[:platform]
when "debian", "ubuntu"
package "libqt4-dev"
package "qt4-qmake"
end | 22 | 4.4 | 22 | 0 |
91523d3b7f6b7a76a4bb8db5f5675e16e2841717 | lib/model_patches.rb | lib/model_patches.rb | Rails.configuration.to_prepare do
OutgoingMessage.class_eval do
# Add intro paragraph to new request template
def default_letter
return nil if self.message_type == 'followup'
#"If you uncomment this line, this text will appear as default text in every message"
end
end
end
| Rails.configuration.to_prepare do
end
| Delete OutgoingMessage changes as we don't use these | Delete OutgoingMessage changes as we don't use these
| Ruby | mit | openaustralia/righttoknow,openaustralia/righttoknow,openaustralia/righttoknow | ruby | ## Code Before:
Rails.configuration.to_prepare do
OutgoingMessage.class_eval do
# Add intro paragraph to new request template
def default_letter
return nil if self.message_type == 'followup'
#"If you uncomment this line, this text will appear as default text in every message"
end
end
end
## Instruction:
Delete OutgoingMessage changes as we don't use these
## Code After:
Rails.configuration.to_prepare do
end
| Rails.configuration.to_prepare do
- OutgoingMessage.class_eval do
- # Add intro paragraph to new request template
- def default_letter
- return nil if self.message_type == 'followup'
- #"If you uncomment this line, this text will appear as default text in every message"
- end
- end
end | 7 | 0.777778 | 0 | 7 |
24fc1cb557d2eacafec6d5124f88b3c00eeb984a | builders/pk-builder.js | builders/pk-builder.js | 'use strict';
/**
* Builds the primary key name depending on model configurations
*/
module.exports = class PrimaryKeyBuilder {
constructor(Model) { this.Model = Model; }
build() {
let pk = 'id';
if (!this.Model.settings.idInjection)
for (let key in this.Model.rawProperties)
if (this.Model.rawProperties[key].id) pk = key;
return pk;
}
} | 'use strict';
/**
* Builds the primary key name depending on model configurations
*/
module.exports = class PrimaryKeyBuilder {
constructor(Model) { this.Model = Model; }
build() {
return this.Model.getIdName();
}
}
| Clean pk builder Instead of using manual logic, used method getIdName() | Clean pk builder
Instead of using manual logic, used
method getIdName()
| JavaScript | mit | jonathan-casarrubias/loopback-stats-mixin | javascript | ## Code Before:
'use strict';
/**
* Builds the primary key name depending on model configurations
*/
module.exports = class PrimaryKeyBuilder {
constructor(Model) { this.Model = Model; }
build() {
let pk = 'id';
if (!this.Model.settings.idInjection)
for (let key in this.Model.rawProperties)
if (this.Model.rawProperties[key].id) pk = key;
return pk;
}
}
## Instruction:
Clean pk builder
Instead of using manual logic, used
method getIdName()
## Code After:
'use strict';
/**
* Builds the primary key name depending on model configurations
*/
module.exports = class PrimaryKeyBuilder {
constructor(Model) { this.Model = Model; }
build() {
return this.Model.getIdName();
}
}
| 'use strict';
/**
* Builds the primary key name depending on model configurations
*/
module.exports = class PrimaryKeyBuilder {
constructor(Model) { this.Model = Model; }
build() {
+ return this.Model.getIdName();
- let pk = 'id';
- if (!this.Model.settings.idInjection)
- for (let key in this.Model.rawProperties)
- if (this.Model.rawProperties[key].id) pk = key;
- return pk;
}
} | 6 | 0.428571 | 1 | 5 |
4d57c783d0f9de84a368b03c04c61072a0e45038 | docs/_config.yml | docs/_config.yml | title: Cayman theme
description: Cayman is a clean, responsive theme for GitHub Pages.
show_downloads: true
google_analytics:
theme: jekyll-theme-cayman | title: React Drafts
description: A React-based text editor written using DraftJS
show_downloads: true
google_analytics:
theme: jekyll-theme-cayman | Use real title and description | [docs] Use real title and description
| YAML | mit | crossfield/react-drafts | yaml | ## Code Before:
title: Cayman theme
description: Cayman is a clean, responsive theme for GitHub Pages.
show_downloads: true
google_analytics:
theme: jekyll-theme-cayman
## Instruction:
[docs] Use real title and description
## Code After:
title: React Drafts
description: A React-based text editor written using DraftJS
show_downloads: true
google_analytics:
theme: jekyll-theme-cayman | - title: Cayman theme
- description: Cayman is a clean, responsive theme for GitHub Pages.
+ title: React Drafts
+ description: A React-based text editor written using DraftJS
show_downloads: true
google_analytics:
theme: jekyll-theme-cayman | 4 | 0.8 | 2 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.