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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
63271091c316f74c9825042bac33b536f0b5be38 | composer.json | composer.json | {
"name": "nours/table-bundle",
"type": "library",
"description": "Table bundle for Symfony",
"homepage": "https://github.com/nours/TableBundle",
"license": "MIT",
"authors": [
{
"name": "David Coudrier",
"email": "david.coudrier@gmail.com"
}
],
"require": {
"php": ">=7.2",
"symfony/symfony": "^3.4|^4.4|^5.4|^6.0",
"doctrine/doctrine-bundle" : "^2.5",
"psr/container": "~1.0"
},
"require-dev": {
"ext-sqlite3": "*",
"phpunit/phpunit" : "^8.0",
"symfony/phpunit-bridge": "^3.0",
"symfony/monolog-bundle" : "^3.0",
"sensio/framework-extra-bundle": "^6.0",
"doctrine/annotations": "~1.2",
"doctrine/orm" : "^2.11",
"jms/serializer-bundle" : "^4.0",
"doctrine/data-fixtures": "^1.5",
"beberlei/doctrineextensions": "^1.1",
"twig/twig": "^3.0",
"symfony/doctrine-messenger": "^5.4",
"symfony/asset": "^5.4"
},
"suggest" : {
"doctrine/orm": "Integrated using orm extension"
},
"autoload": {
"psr-4" : {
"Nours\\TableBundle\\" : ""
}
}
}
| {
"name": "nours/table-bundle",
"type": "library",
"description": "Table bundle for Symfony",
"homepage": "https://github.com/nours/TableBundle",
"license": "MIT",
"authors": [
{
"name": "David Coudrier",
"email": "david.coudrier@gmail.com"
}
],
"require": {
"php": ">=7.2",
"symfony/symfony": "^5.4",
"doctrine/doctrine-bundle" : "^2.5",
"psr/container": "~1.0"
},
"require-dev": {
"ext-sqlite3": "*",
"phpunit/phpunit" : "^8.0",
"symfony/phpunit-bridge": "^3.0",
"symfony/monolog-bundle" : "^3.0",
"sensio/framework-extra-bundle": "^6.0",
"doctrine/annotations": "~1.2",
"doctrine/orm" : "^2.11",
"jms/serializer-bundle" : "^4.0",
"doctrine/data-fixtures": "^1.5",
"beberlei/doctrineextensions": "^1.1",
"twig/twig": "^3.0"
},
"suggest" : {
"doctrine/orm": "Integrated using orm extension"
},
"autoload": {
"psr-4" : {
"Nours\\TableBundle\\" : ""
}
}
}
| Drop support for Symfony < 5.4 | Drop support for Symfony < 5.4
| JSON | mit | nours/TableBundle | json | ## Code Before:
{
"name": "nours/table-bundle",
"type": "library",
"description": "Table bundle for Symfony",
"homepage": "https://github.com/nours/TableBundle",
"license": "MIT",
"authors": [
{
"name": "David Coudrier",
"email": "david.coudrier@gmail.com"
}
],
"require": {
"php": ">=7.2",
"symfony/symfony": "^3.4|^4.4|^5.4|^6.0",
"doctrine/doctrine-bundle" : "^2.5",
"psr/container": "~1.0"
},
"require-dev": {
"ext-sqlite3": "*",
"phpunit/phpunit" : "^8.0",
"symfony/phpunit-bridge": "^3.0",
"symfony/monolog-bundle" : "^3.0",
"sensio/framework-extra-bundle": "^6.0",
"doctrine/annotations": "~1.2",
"doctrine/orm" : "^2.11",
"jms/serializer-bundle" : "^4.0",
"doctrine/data-fixtures": "^1.5",
"beberlei/doctrineextensions": "^1.1",
"twig/twig": "^3.0",
"symfony/doctrine-messenger": "^5.4",
"symfony/asset": "^5.4"
},
"suggest" : {
"doctrine/orm": "Integrated using orm extension"
},
"autoload": {
"psr-4" : {
"Nours\\TableBundle\\" : ""
}
}
}
## Instruction:
Drop support for Symfony < 5.4
## Code After:
{
"name": "nours/table-bundle",
"type": "library",
"description": "Table bundle for Symfony",
"homepage": "https://github.com/nours/TableBundle",
"license": "MIT",
"authors": [
{
"name": "David Coudrier",
"email": "david.coudrier@gmail.com"
}
],
"require": {
"php": ">=7.2",
"symfony/symfony": "^5.4",
"doctrine/doctrine-bundle" : "^2.5",
"psr/container": "~1.0"
},
"require-dev": {
"ext-sqlite3": "*",
"phpunit/phpunit" : "^8.0",
"symfony/phpunit-bridge": "^3.0",
"symfony/monolog-bundle" : "^3.0",
"sensio/framework-extra-bundle": "^6.0",
"doctrine/annotations": "~1.2",
"doctrine/orm" : "^2.11",
"jms/serializer-bundle" : "^4.0",
"doctrine/data-fixtures": "^1.5",
"beberlei/doctrineextensions": "^1.1",
"twig/twig": "^3.0"
},
"suggest" : {
"doctrine/orm": "Integrated using orm extension"
},
"autoload": {
"psr-4" : {
"Nours\\TableBundle\\" : ""
}
}
}
| {
"name": "nours/table-bundle",
"type": "library",
"description": "Table bundle for Symfony",
"homepage": "https://github.com/nours/TableBundle",
"license": "MIT",
"authors": [
{
"name": "David Coudrier",
"email": "david.coudrier@gmail.com"
}
],
"require": {
"php": ">=7.2",
- "symfony/symfony": "^3.4|^4.4|^5.4|^6.0",
? ---------- -----
+ "symfony/symfony": "^5.4",
"doctrine/doctrine-bundle" : "^2.5",
"psr/container": "~1.0"
},
"require-dev": {
"ext-sqlite3": "*",
"phpunit/phpunit" : "^8.0",
"symfony/phpunit-bridge": "^3.0",
"symfony/monolog-bundle" : "^3.0",
"sensio/framework-extra-bundle": "^6.0",
"doctrine/annotations": "~1.2",
"doctrine/orm" : "^2.11",
"jms/serializer-bundle" : "^4.0",
"doctrine/data-fixtures": "^1.5",
"beberlei/doctrineextensions": "^1.1",
- "twig/twig": "^3.0",
? -
+ "twig/twig": "^3.0"
- "symfony/doctrine-messenger": "^5.4",
- "symfony/asset": "^5.4"
},
"suggest" : {
"doctrine/orm": "Integrated using orm extension"
},
"autoload": {
"psr-4" : {
"Nours\\TableBundle\\" : ""
}
}
} | 6 | 0.142857 | 2 | 4 |
1e49e2cf8d8218103b051f0092a136392de3da8f | cmd/login.go | cmd/login.go | package cmd
import (
"io/ioutil"
"log"
"github.com/mitchellh/go-homedir"
"github.com/mobingilabs/mocli/pkg/util"
"github.com/spf13/cobra"
)
var loginCmd = &cobra.Command{
Use: "login",
Short: "",
Long: `Placeholder for the documentation.`,
Run: login,
}
func init() {
rootCmd.AddCommand(loginCmd)
loginCmd.Flags().StringP("client-id", "i", "", "client id")
loginCmd.Flags().StringP("client-secret", "s", "", "client secret")
loginCmd.Flags().StringP("grant-type", "g", "client_credentials", "grant type (valid values: 'client_credentials', 'password')")
}
func login(cmd *cobra.Command, args []string) {
log.Println("login here")
hd, _ := homedir.Dir()
log.Println("home:", hd)
cred := hd + `/.mocli/credentials`
token, err := ioutil.ReadFile(cred)
if err != nil {
log.Println(err)
ioutil.WriteFile(hd+`/.mocli/credentials`, []byte("hello"), 0644)
}
log.Println(string(token))
user, pass := util.GetUserPassword()
log.Println(user, pass)
}
| package cmd
import (
"io/ioutil"
"log"
"github.com/mitchellh/go-homedir"
"github.com/mobingilabs/mocli/pkg/util"
"github.com/spf13/cobra"
)
var loginCmd = &cobra.Command{
Use: "login",
Short: "",
Long: `Placeholder for the documentation.`,
Run: login,
}
func init() {
rootCmd.AddCommand(loginCmd)
loginCmd.Flags().StringP("client-id", "i", "", "client id")
loginCmd.Flags().StringP("client-secret", "s", "", "client secret")
loginCmd.Flags().StringP("grant-type", "g", "client_credentials", "grant type (valid values: 'client_credentials', 'password')")
}
func login(cmd *cobra.Command, args []string) {
log.Println("login here")
hd, _ := homedir.Dir()
log.Println("home:", hd)
cred := hd + `/.mocli/credentials`
token, err := ioutil.ReadFile(cred)
if err != nil {
log.Println(err)
err = ioutil.WriteFile(cred, []byte("hello"), 0644)
if err != nil {
log.Println(err)
}
}
log.Println(string(token))
user, pass := util.GetUserPassword()
log.Println(user, pass)
}
| Add error check for Linux check. | Add error check for Linux check.
| Go | mpl-2.0 | mobingi/mobingi-cli | go | ## Code Before:
package cmd
import (
"io/ioutil"
"log"
"github.com/mitchellh/go-homedir"
"github.com/mobingilabs/mocli/pkg/util"
"github.com/spf13/cobra"
)
var loginCmd = &cobra.Command{
Use: "login",
Short: "",
Long: `Placeholder for the documentation.`,
Run: login,
}
func init() {
rootCmd.AddCommand(loginCmd)
loginCmd.Flags().StringP("client-id", "i", "", "client id")
loginCmd.Flags().StringP("client-secret", "s", "", "client secret")
loginCmd.Flags().StringP("grant-type", "g", "client_credentials", "grant type (valid values: 'client_credentials', 'password')")
}
func login(cmd *cobra.Command, args []string) {
log.Println("login here")
hd, _ := homedir.Dir()
log.Println("home:", hd)
cred := hd + `/.mocli/credentials`
token, err := ioutil.ReadFile(cred)
if err != nil {
log.Println(err)
ioutil.WriteFile(hd+`/.mocli/credentials`, []byte("hello"), 0644)
}
log.Println(string(token))
user, pass := util.GetUserPassword()
log.Println(user, pass)
}
## Instruction:
Add error check for Linux check.
## Code After:
package cmd
import (
"io/ioutil"
"log"
"github.com/mitchellh/go-homedir"
"github.com/mobingilabs/mocli/pkg/util"
"github.com/spf13/cobra"
)
var loginCmd = &cobra.Command{
Use: "login",
Short: "",
Long: `Placeholder for the documentation.`,
Run: login,
}
func init() {
rootCmd.AddCommand(loginCmd)
loginCmd.Flags().StringP("client-id", "i", "", "client id")
loginCmd.Flags().StringP("client-secret", "s", "", "client secret")
loginCmd.Flags().StringP("grant-type", "g", "client_credentials", "grant type (valid values: 'client_credentials', 'password')")
}
func login(cmd *cobra.Command, args []string) {
log.Println("login here")
hd, _ := homedir.Dir()
log.Println("home:", hd)
cred := hd + `/.mocli/credentials`
token, err := ioutil.ReadFile(cred)
if err != nil {
log.Println(err)
err = ioutil.WriteFile(cred, []byte("hello"), 0644)
if err != nil {
log.Println(err)
}
}
log.Println(string(token))
user, pass := util.GetUserPassword()
log.Println(user, pass)
}
| package cmd
import (
"io/ioutil"
"log"
"github.com/mitchellh/go-homedir"
"github.com/mobingilabs/mocli/pkg/util"
"github.com/spf13/cobra"
)
var loginCmd = &cobra.Command{
Use: "login",
Short: "",
Long: `Placeholder for the documentation.`,
Run: login,
}
func init() {
rootCmd.AddCommand(loginCmd)
loginCmd.Flags().StringP("client-id", "i", "", "client id")
loginCmd.Flags().StringP("client-secret", "s", "", "client secret")
loginCmd.Flags().StringP("grant-type", "g", "client_credentials", "grant type (valid values: 'client_credentials', 'password')")
}
func login(cmd *cobra.Command, args []string) {
log.Println("login here")
hd, _ := homedir.Dir()
log.Println("home:", hd)
cred := hd + `/.mocli/credentials`
token, err := ioutil.ReadFile(cred)
if err != nil {
log.Println(err)
- ioutil.WriteFile(hd+`/.mocli/credentials`, []byte("hello"), 0644)
? ------------ --------
+ err = ioutil.WriteFile(cred, []byte("hello"), 0644)
? ++++++
+ if err != nil {
+ log.Println(err)
+ }
}
log.Println(string(token))
user, pass := util.GetUserPassword()
log.Println(user, pass)
} | 5 | 0.119048 | 4 | 1 |
7a4c75ba4480040b843ec9755909573f8ef73577 | src/lib.rs | src/lib.rs | // Copyright 2016 Mozilla
//
// 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.
extern crate datomish_query_parser;
extern crate rusqlite;
use rusqlite::Connection;
pub fn get_name() -> String {
return String::from("datomish");
}
// Just an example of using a dependency
pub fn get_parser_name() -> String {
return datomish_query_parser::get_name();
}
// Will ultimately not return the sqlite connection directly
pub fn get_connection() -> Connection {
return Connection::open_in_memory().unwrap();
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn can_import_parser() {
assert_eq!(String::from("datomish-query-parser"), get_parser_name());
}
} | // Copyright 2016 Mozilla
//
// 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.
extern crate mentat_query_parser;
extern crate rusqlite;
use rusqlite::Connection;
pub fn get_name() -> String {
return String::from("mentat");
}
// Just an example of using a dependency
pub fn get_parser_name() -> String {
return mentat_query_parser::get_name();
}
// Will ultimately not return the sqlite connection directly
pub fn get_connection() -> Connection {
return Connection::open_in_memory().unwrap();
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn can_import_parser() {
assert_eq!(String::from("mentat-query-parser"), get_parser_name());
}
}
| Rename to Project Mentat (src). | Rename to Project Mentat (src).
| Rust | apache-2.0 | ncalexan/datomish,ncalexan/mentat,ncalexan/mentat,mozilla/mentat,mozilla/mentat,mozilla/mentat,mozilla/mentat,mozilla/mentat,ncalexan/datomish,ncalexan/mentat,ncalexan/mentat,mozilla/mentat,ncalexan/mentat,ncalexan/mentat | rust | ## Code Before:
// Copyright 2016 Mozilla
//
// 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.
extern crate datomish_query_parser;
extern crate rusqlite;
use rusqlite::Connection;
pub fn get_name() -> String {
return String::from("datomish");
}
// Just an example of using a dependency
pub fn get_parser_name() -> String {
return datomish_query_parser::get_name();
}
// Will ultimately not return the sqlite connection directly
pub fn get_connection() -> Connection {
return Connection::open_in_memory().unwrap();
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn can_import_parser() {
assert_eq!(String::from("datomish-query-parser"), get_parser_name());
}
}
## Instruction:
Rename to Project Mentat (src).
## Code After:
// Copyright 2016 Mozilla
//
// 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.
extern crate mentat_query_parser;
extern crate rusqlite;
use rusqlite::Connection;
pub fn get_name() -> String {
return String::from("mentat");
}
// Just an example of using a dependency
pub fn get_parser_name() -> String {
return mentat_query_parser::get_name();
}
// Will ultimately not return the sqlite connection directly
pub fn get_connection() -> Connection {
return Connection::open_in_memory().unwrap();
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn can_import_parser() {
assert_eq!(String::from("mentat-query-parser"), get_parser_name());
}
}
| // Copyright 2016 Mozilla
//
// 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.
- extern crate datomish_query_parser;
? ^ -----
+ extern crate mentat_query_parser;
? ^^^^
extern crate rusqlite;
use rusqlite::Connection;
pub fn get_name() -> String {
- return String::from("datomish");
? ^ -----
+ return String::from("mentat");
? ^^^^
}
// Just an example of using a dependency
pub fn get_parser_name() -> String {
- return datomish_query_parser::get_name();
? ^ -----
+ return mentat_query_parser::get_name();
? ^^^^
}
// Will ultimately not return the sqlite connection directly
pub fn get_connection() -> Connection {
return Connection::open_in_memory().unwrap();
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn can_import_parser() {
- assert_eq!(String::from("datomish-query-parser"), get_parser_name());
? ^ -----
+ assert_eq!(String::from("mentat-query-parser"), get_parser_name());
? ^^^^
}
} | 8 | 0.210526 | 4 | 4 |
87af79112460adf626d373c3c85c51be8c4c1774 | _config.yml | _config.yml | markdown: redcarpet
highligher: pygments
# Permalinks
permalink: pretty
# Setup
title: Thom Wright
tagline: Because tomwright.co.uk wasn't available...
description: Because tomwright.co.uk wasn't available...
url: http://thomwright.co.uk
shorturl: thomwright.co.uk
baseurl: /
paginate: 5
author:
name: Thom Wright
version: 0.0.1
github:
repo: http://github.com/ThomWright/ThomWright.github.io
source: ./source | markdown: redcarpet
highligher: pygments
# Permalinks
permalink: pretty
# Setup
title: Thom Wright
tagline: Because tomwright.co.uk wasn't available...
description: Because tomwright.co.uk wasn't available...
url: http://thomwright.co.uk
shorturl: thomwright.co.uk
baseurl: /
paginate: 5
author:
name: Thom Wright
version: 0.0.1
github:
repo: http://github.com/ThomWright/ThomWright.github.io
source: ./source
sass:
sass_dir: public/css/_sass
style: compressed | Add sass_dir to Jekyll's config | Add sass_dir to Jekyll's config
| YAML | mit | ThomWright/ThomWright.github.io,ThomWright/ThomWright.github.io,ThomWright/ThomWright.github.io | yaml | ## Code Before:
markdown: redcarpet
highligher: pygments
# Permalinks
permalink: pretty
# Setup
title: Thom Wright
tagline: Because tomwright.co.uk wasn't available...
description: Because tomwright.co.uk wasn't available...
url: http://thomwright.co.uk
shorturl: thomwright.co.uk
baseurl: /
paginate: 5
author:
name: Thom Wright
version: 0.0.1
github:
repo: http://github.com/ThomWright/ThomWright.github.io
source: ./source
## Instruction:
Add sass_dir to Jekyll's config
## Code After:
markdown: redcarpet
highligher: pygments
# Permalinks
permalink: pretty
# Setup
title: Thom Wright
tagline: Because tomwright.co.uk wasn't available...
description: Because tomwright.co.uk wasn't available...
url: http://thomwright.co.uk
shorturl: thomwright.co.uk
baseurl: /
paginate: 5
author:
name: Thom Wright
version: 0.0.1
github:
repo: http://github.com/ThomWright/ThomWright.github.io
source: ./source
sass:
sass_dir: public/css/_sass
style: compressed | markdown: redcarpet
highligher: pygments
# Permalinks
permalink: pretty
# Setup
title: Thom Wright
tagline: Because tomwright.co.uk wasn't available...
description: Because tomwright.co.uk wasn't available...
url: http://thomwright.co.uk
shorturl: thomwright.co.uk
baseurl: /
paginate: 5
author:
name: Thom Wright
version: 0.0.1
github:
repo: http://github.com/ThomWright/ThomWright.github.io
source: ./source
+
+ sass:
+ sass_dir: public/css/_sass
+ style: compressed | 4 | 0.153846 | 4 | 0 |
284aff32125618a99015da958004f5bc1c5c8c1e | src/main/java/session/XaJpaDemoBean.java | src/main/java/session/XaJpaDemoBean.java | package session;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import domain.Customer;
import domain.Order;
public class XaJpaDemoBean {
@PersistenceContext(name="customer") EntityManager customerEntityManager;
@PersistenceContext(name="orders") EntityManager orderEntityManager;
public void saveCustomerOrder(Customer c, Order o, Boolean succeeds) {
try {
EntityTransaction customerTransaction = customerEntityManager.getTransaction();
customerTransaction.begin();
// Update the customer entity in the database.
customerEntityManager.merge(c);
c.setNumberOfOrders(c.getNumberOfOrders() + 1);
customerTransaction.commit();
int cid = c.getId();
System.out.println("Updated Customer with Id " + cid);
EntityTransaction orderTransaction = orderEntityManager.getTransaction();
orderTransaction.begin();
// Insert the order entity in the database.
orderEntityManager.persist(c);
orderTransaction.commit();
int oid = o.getId();
System.out.println("Created order with Id " + oid);
Query query = customerEntityManager.createQuery("select c from Customer c order by c.name");
List<Customer> list = query.getResultList();
System.out.println("There are " + list.size() + " persons:");
for (Customer p : list) {
System.out.println(p.getName());
}
System.out.println();
} finally {
if (!succeeds) {
throw new RuntimeException("Simulated failure!");
}
}
}
}
| package session;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceContext;
import domain.Customer;
import domain.Order;
@Stateless
public class XaJpaDemoBean {
@PersistenceContext(name="customer") EntityManager customerEntityManager;
@PersistenceContext(name="orders") EntityManager orderEntityManager;
public void saveCustomerOrder(Customer c, Order o, Boolean succeeds) {
try {
EntityTransaction customerTransaction = customerEntityManager.getTransaction();
customerTransaction.begin();
// Update the customer entity in the database.
customerEntityManager.merge(c);
c.setNumberOfOrders(c.getNumberOfOrders() + 1);
customerTransaction.commit();
int cid = c.getId();
System.out.println("XaJpaDemoBean.saveCustomerOrder(): Updated Customer with Id " + cid);
EntityTransaction orderTransaction = orderEntityManager.getTransaction();
orderTransaction.begin();
// Insert the order entity in the database.
orderEntityManager.persist(c);
orderTransaction.commit();
int oid = o.getId();
System.out.println("XaJpaDemoBean.saveCustomerOrder(): Created order with Id " + oid);
} finally {
if (!succeeds) {
throw new RuntimeException("XaJpaDemoBean.saveCustomerOrder(): Simulated failure!");
}
}
}
}
| Annotate correctly (@Stateless). Correct several printouts. | Annotate correctly (@Stateless). Correct several printouts.
| Java | bsd-2-clause | IanDarwin/eedemo-xa,IanDarwin/eedemo-xa | java | ## Code Before:
package session;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import domain.Customer;
import domain.Order;
public class XaJpaDemoBean {
@PersistenceContext(name="customer") EntityManager customerEntityManager;
@PersistenceContext(name="orders") EntityManager orderEntityManager;
public void saveCustomerOrder(Customer c, Order o, Boolean succeeds) {
try {
EntityTransaction customerTransaction = customerEntityManager.getTransaction();
customerTransaction.begin();
// Update the customer entity in the database.
customerEntityManager.merge(c);
c.setNumberOfOrders(c.getNumberOfOrders() + 1);
customerTransaction.commit();
int cid = c.getId();
System.out.println("Updated Customer with Id " + cid);
EntityTransaction orderTransaction = orderEntityManager.getTransaction();
orderTransaction.begin();
// Insert the order entity in the database.
orderEntityManager.persist(c);
orderTransaction.commit();
int oid = o.getId();
System.out.println("Created order with Id " + oid);
Query query = customerEntityManager.createQuery("select c from Customer c order by c.name");
List<Customer> list = query.getResultList();
System.out.println("There are " + list.size() + " persons:");
for (Customer p : list) {
System.out.println(p.getName());
}
System.out.println();
} finally {
if (!succeeds) {
throw new RuntimeException("Simulated failure!");
}
}
}
}
## Instruction:
Annotate correctly (@Stateless). Correct several printouts.
## Code After:
package session;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceContext;
import domain.Customer;
import domain.Order;
@Stateless
public class XaJpaDemoBean {
@PersistenceContext(name="customer") EntityManager customerEntityManager;
@PersistenceContext(name="orders") EntityManager orderEntityManager;
public void saveCustomerOrder(Customer c, Order o, Boolean succeeds) {
try {
EntityTransaction customerTransaction = customerEntityManager.getTransaction();
customerTransaction.begin();
// Update the customer entity in the database.
customerEntityManager.merge(c);
c.setNumberOfOrders(c.getNumberOfOrders() + 1);
customerTransaction.commit();
int cid = c.getId();
System.out.println("XaJpaDemoBean.saveCustomerOrder(): Updated Customer with Id " + cid);
EntityTransaction orderTransaction = orderEntityManager.getTransaction();
orderTransaction.begin();
// Insert the order entity in the database.
orderEntityManager.persist(c);
orderTransaction.commit();
int oid = o.getId();
System.out.println("XaJpaDemoBean.saveCustomerOrder(): Created order with Id " + oid);
} finally {
if (!succeeds) {
throw new RuntimeException("XaJpaDemoBean.saveCustomerOrder(): Simulated failure!");
}
}
}
}
| package session;
+ import javax.ejb.Stateless;
- import java.util.List;
-
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceContext;
- import javax.persistence.Query;
import domain.Customer;
import domain.Order;
-
+ @Stateless
public class XaJpaDemoBean {
@PersistenceContext(name="customer") EntityManager customerEntityManager;
@PersistenceContext(name="orders") EntityManager orderEntityManager;
public void saveCustomerOrder(Customer c, Order o, Boolean succeeds) {
try {
EntityTransaction customerTransaction = customerEntityManager.getTransaction();
customerTransaction.begin();
// Update the customer entity in the database.
customerEntityManager.merge(c);
c.setNumberOfOrders(c.getNumberOfOrders() + 1);
customerTransaction.commit();
int cid = c.getId();
- System.out.println("Updated Customer with Id " + cid);
+ System.out.println("XaJpaDemoBean.saveCustomerOrder(): Updated Customer with Id " + cid);
? +++++++++++++++++++++++++++++++++++
EntityTransaction orderTransaction = orderEntityManager.getTransaction();
orderTransaction.begin();
// Insert the order entity in the database.
orderEntityManager.persist(c);
orderTransaction.commit();
int oid = o.getId();
- System.out.println("Created order with Id " + oid);
+ System.out.println("XaJpaDemoBean.saveCustomerOrder(): Created order with Id " + oid);
? +++++++++++++++++++++++++++++++++++
- Query query = customerEntityManager.createQuery("select c from Customer c order by c.name");
-
- List<Customer> list = query.getResultList();
- System.out.println("There are " + list.size() + " persons:");
- for (Customer p : list) {
- System.out.println(p.getName());
- }
- System.out.println();
} finally {
if (!succeeds) {
- throw new RuntimeException("Simulated failure!");
+ throw new RuntimeException("XaJpaDemoBean.saveCustomerOrder(): Simulated failure!");
? +++++++++++++++++++++++++++++++++++
}
}
}
} | 20 | 0.357143 | 5 | 15 |
667192822fdcf0b06dab59457d0956fb81d17818 | gh-pages-template.html | gh-pages-template.html | <html>
<head>
<meta charset="UTF-8">
<style>
body {
margin: 50px 10% 50px 10%;
min-width: 400px;
}
</style>
<link rel="stylesheet" href="github-markdown.css">
</head>
<body class="markdown-body">
<a href="https://github.com/c24w/try-catch-finally.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/52760788cde945287fbb584134c4cbc2bc36f904/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>
{{MARKDOWN}}
</body>
</html>
| <html>
<head>
<meta charset="UTF-8">
<style>
body {
margin: 50px 10% 50px 10%;
min-width: 400px;
}
</style>
<link rel="stylesheet" href="github-markdown.css">
</head>
<body class="markdown-body">
<a href="https://github.com/c24w/try-catch-finally.js"><img style="position:absolute;top:0;right:0;border:0;width:149px;height:149px;" src="http://aral.github.com/fork-me-on-github-retina-ribbons/right-cerulean@2x.png" alt="Fork me on GitHub"></a>
{{MARKDOWN}}
</body>
</html>
| Use high res 'fork me' ribbon 🍴 | Use high res 'fork me' ribbon 🍴 | HTML | isc | c24w/try-catch-finally.js,c24w/try-catch-finally.js,c24w/try-catch-finally.js | html | ## Code Before:
<html>
<head>
<meta charset="UTF-8">
<style>
body {
margin: 50px 10% 50px 10%;
min-width: 400px;
}
</style>
<link rel="stylesheet" href="github-markdown.css">
</head>
<body class="markdown-body">
<a href="https://github.com/c24w/try-catch-finally.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/52760788cde945287fbb584134c4cbc2bc36f904/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>
{{MARKDOWN}}
</body>
</html>
## Instruction:
Use high res 'fork me' ribbon 🍴
## Code After:
<html>
<head>
<meta charset="UTF-8">
<style>
body {
margin: 50px 10% 50px 10%;
min-width: 400px;
}
</style>
<link rel="stylesheet" href="github-markdown.css">
</head>
<body class="markdown-body">
<a href="https://github.com/c24w/try-catch-finally.js"><img style="position:absolute;top:0;right:0;border:0;width:149px;height:149px;" src="http://aral.github.com/fork-me-on-github-retina-ribbons/right-cerulean@2x.png" alt="Fork me on GitHub"></a>
{{MARKDOWN}}
</body>
</html>
| <html>
<head>
<meta charset="UTF-8">
<style>
body {
margin: 50px 10% 50px 10%;
min-width: 400px;
}
</style>
<link rel="stylesheet" href="github-markdown.css">
</head>
<body class="markdown-body">
- <a href="https://github.com/c24w/try-catch-finally.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/52760788cde945287fbb584134c4cbc2bc36f904/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>
+ <a href="https://github.com/c24w/try-catch-finally.js"><img style="position:absolute;top:0;right:0;border:0;width:149px;height:149px;" src="http://aral.github.com/fork-me-on-github-retina-ribbons/right-cerulean@2x.png" alt="Fork me on GitHub"></a>
{{MARKDOWN}}
</body>
</html> | 2 | 0.125 | 1 | 1 |
068311de8ac0681866eb4697bf19406cb5e36011 | packages/gi/github-tools.yaml | packages/gi/github-tools.yaml | homepage: https://toktok.github.io/
changelog-type: ''
hash: 7e49d311b7b53e726c732eb2c3ff0c14c3d68d514a3a40c42ca89443a1613d9d
test-bench-deps: {}
maintainer: iphydf@users.noreply.github.com
synopsis: Various Github helper utilities.
changelog: ''
basic-deps:
http-client: ! '>=0.4.30'
exceptions: -any
bytestring: -any
base: ==4.*
time: -any
text: -any
groom: -any
containers: -any
monad-parallel: -any
http-client-tls: -any
html: -any
tabular: -any
github: ! '>=0.15.0'
tagsoup: -any
vector: -any
all-versions:
- '0.1.0'
author: iphydf
latest: '0.1.0'
description-type: haddock
description: ! '- Pull Request status tool.
- Change log generator.'
license-name: AGPL-3
| homepage: https://toktok.github.io/
changelog-type: ''
hash: 4d51a86dfeadc5a9c59e351cd537b825a95d792fa10cfa68b47b8000e69be85e
test-bench-deps: {}
maintainer: iphydf@users.noreply.github.com
synopsis: Various Github helper utilities.
changelog: ''
basic-deps:
http-client: ! '>=0.4.30'
exceptions: -any
bytestring: -any
base: ==4.*
time: -any
text: -any
groom: -any
containers: -any
monad-parallel: -any
http-client-tls: -any
html: -any
tabular: -any
github: ! '>=0.15.0'
tagsoup: -any
vector: -any
all-versions:
- '0.1.0'
- '0.1.1'
author: iphydf
latest: '0.1.1'
description-type: haddock
description: ! '- Pull Request status tool.
- Change log generator.'
license-name: AGPL-3
| Update from Hackage at 2016-12-11T15:51:53Z | Update from Hackage at 2016-12-11T15:51:53Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://toktok.github.io/
changelog-type: ''
hash: 7e49d311b7b53e726c732eb2c3ff0c14c3d68d514a3a40c42ca89443a1613d9d
test-bench-deps: {}
maintainer: iphydf@users.noreply.github.com
synopsis: Various Github helper utilities.
changelog: ''
basic-deps:
http-client: ! '>=0.4.30'
exceptions: -any
bytestring: -any
base: ==4.*
time: -any
text: -any
groom: -any
containers: -any
monad-parallel: -any
http-client-tls: -any
html: -any
tabular: -any
github: ! '>=0.15.0'
tagsoup: -any
vector: -any
all-versions:
- '0.1.0'
author: iphydf
latest: '0.1.0'
description-type: haddock
description: ! '- Pull Request status tool.
- Change log generator.'
license-name: AGPL-3
## Instruction:
Update from Hackage at 2016-12-11T15:51:53Z
## Code After:
homepage: https://toktok.github.io/
changelog-type: ''
hash: 4d51a86dfeadc5a9c59e351cd537b825a95d792fa10cfa68b47b8000e69be85e
test-bench-deps: {}
maintainer: iphydf@users.noreply.github.com
synopsis: Various Github helper utilities.
changelog: ''
basic-deps:
http-client: ! '>=0.4.30'
exceptions: -any
bytestring: -any
base: ==4.*
time: -any
text: -any
groom: -any
containers: -any
monad-parallel: -any
http-client-tls: -any
html: -any
tabular: -any
github: ! '>=0.15.0'
tagsoup: -any
vector: -any
all-versions:
- '0.1.0'
- '0.1.1'
author: iphydf
latest: '0.1.1'
description-type: haddock
description: ! '- Pull Request status tool.
- Change log generator.'
license-name: AGPL-3
| homepage: https://toktok.github.io/
changelog-type: ''
- hash: 7e49d311b7b53e726c732eb2c3ff0c14c3d68d514a3a40c42ca89443a1613d9d
+ hash: 4d51a86dfeadc5a9c59e351cd537b825a95d792fa10cfa68b47b8000e69be85e
test-bench-deps: {}
maintainer: iphydf@users.noreply.github.com
synopsis: Various Github helper utilities.
changelog: ''
basic-deps:
http-client: ! '>=0.4.30'
exceptions: -any
bytestring: -any
base: ==4.*
time: -any
text: -any
groom: -any
containers: -any
monad-parallel: -any
http-client-tls: -any
html: -any
tabular: -any
github: ! '>=0.15.0'
tagsoup: -any
vector: -any
all-versions:
- '0.1.0'
+ - '0.1.1'
author: iphydf
- latest: '0.1.0'
? ^
+ latest: '0.1.1'
? ^
description-type: haddock
description: ! '- Pull Request status tool.
- Change log generator.'
license-name: AGPL-3 | 5 | 0.15625 | 3 | 2 |
abea08b9335f66e69404c0dbdedd8f97c07b658f | app/models/user.rb | app/models/user.rb | class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:omniauthable, :omniauth_providers => [:facebook]
def self.from_omniauth(auth)
where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
user.email = auth.info.email
user.password = Devise.friendly_token[0,20]
end
end
end
| class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:omniauthable, :omniauth_providers => [:facebook]
has_many :collections
has_many :comments
validates_uniqueness_of :username, :email
validates_presence_of :username, :name
def self.from_omniauth(auth)
where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
user.email = auth.info.email
user.password = Devise.friendly_token[0,20]
end
end
end
| Add activerecord relationship and validations | Add activerecord relationship and validations
| Ruby | mit | evanscloud/monocle,evanscloud/monocle,evanscloud/monocle | ruby | ## Code Before:
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:omniauthable, :omniauth_providers => [:facebook]
def self.from_omniauth(auth)
where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
user.email = auth.info.email
user.password = Devise.friendly_token[0,20]
end
end
end
## Instruction:
Add activerecord relationship and validations
## Code After:
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:omniauthable, :omniauth_providers => [:facebook]
has_many :collections
has_many :comments
validates_uniqueness_of :username, :email
validates_presence_of :username, :name
def self.from_omniauth(auth)
where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
user.email = auth.info.email
user.password = Devise.friendly_token[0,20]
end
end
end
| class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:omniauthable, :omniauth_providers => [:facebook]
+
+ has_many :collections
+ has_many :comments
+ validates_uniqueness_of :username, :email
+ validates_presence_of :username, :name
def self.from_omniauth(auth)
where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
user.email = auth.info.email
user.password = Devise.friendly_token[0,20]
end
end
end | 5 | 0.333333 | 5 | 0 |
c1cd938d70f007fc660e563d8985671aca01d7fd | package.json | package.json | {
"name": "regard",
"version": "1.0.3",
"description": "Website for regard",
"main": "index.js",
"author": "",
"license": "Apache v2",
"repository": "https://github.com/with-regard/regard-website.git",
"dependencies": {
"gulp": "~3.5.2",
"gulp-sass": "~0.6.0",
"gulp-watch": "~0.5.0",
"gulp-autoprefixer": "0.0.6",
"gulp-minify-css": "~0.3.0",
"tiny-lr": "0.0.5",
"gulp-livereload": "~1.0.1",
"gulp-jade": "~0.4.1",
"gulp-uglify": "~0.2.1",
"gulp-plumber": "~0.5.6",
"express": "~3.4.8",
"path": "~0.4.9",
"gulp-util": "~2.2.14",
"gulp-nodemon": "~1.0.2",
"jade": "~1.3.0",
"connect-multiparty": "~1.0.3",
"request": "~2.34.0",
"connect-flash": "~0.1.1",
"gulp-svg-sprites": "https://github.com/davidblurton/gulp-svg-sprites/archive/fix-element-names-on-windows.tar.gz"
}
}
| {
"name": "regard",
"version": "1.0.3",
"description": "Website for regard",
"main": "index.js",
"author": "",
"license": "Apache v2",
"repository": "https://github.com/with-regard/regard-website.git",
"dependencies": {
"gulp": "~3.5.2",
"gulp-sass": "~0.6.0",
"gulp-watch": "~0.5.0",
"gulp-autoprefixer": "0.0.6",
"gulp-minify-css": "~0.3.0",
"tiny-lr": "0.0.5",
"gulp-livereload": "~1.0.1",
"gulp-jade": "~0.4.1",
"gulp-uglify": "~0.2.1",
"gulp-plumber": "~0.5.6",
"express": "~3.4.8",
"path": "~0.4.9",
"gulp-util": "~2.2.14",
"gulp-nodemon": "~1.0.2",
"jade": "~1.3.0",
"connect-multiparty": "~1.0.3",
"request": "~2.34.0",
"connect-flash": "~0.1.1",
"gulp-svg-sprites": "~0.0.6"
}
}
| Fix merged and on npm now | Fix merged and on npm now
| JSON | apache-2.0 | with-regard/regard-website | json | ## Code Before:
{
"name": "regard",
"version": "1.0.3",
"description": "Website for regard",
"main": "index.js",
"author": "",
"license": "Apache v2",
"repository": "https://github.com/with-regard/regard-website.git",
"dependencies": {
"gulp": "~3.5.2",
"gulp-sass": "~0.6.0",
"gulp-watch": "~0.5.0",
"gulp-autoprefixer": "0.0.6",
"gulp-minify-css": "~0.3.0",
"tiny-lr": "0.0.5",
"gulp-livereload": "~1.0.1",
"gulp-jade": "~0.4.1",
"gulp-uglify": "~0.2.1",
"gulp-plumber": "~0.5.6",
"express": "~3.4.8",
"path": "~0.4.9",
"gulp-util": "~2.2.14",
"gulp-nodemon": "~1.0.2",
"jade": "~1.3.0",
"connect-multiparty": "~1.0.3",
"request": "~2.34.0",
"connect-flash": "~0.1.1",
"gulp-svg-sprites": "https://github.com/davidblurton/gulp-svg-sprites/archive/fix-element-names-on-windows.tar.gz"
}
}
## Instruction:
Fix merged and on npm now
## Code After:
{
"name": "regard",
"version": "1.0.3",
"description": "Website for regard",
"main": "index.js",
"author": "",
"license": "Apache v2",
"repository": "https://github.com/with-regard/regard-website.git",
"dependencies": {
"gulp": "~3.5.2",
"gulp-sass": "~0.6.0",
"gulp-watch": "~0.5.0",
"gulp-autoprefixer": "0.0.6",
"gulp-minify-css": "~0.3.0",
"tiny-lr": "0.0.5",
"gulp-livereload": "~1.0.1",
"gulp-jade": "~0.4.1",
"gulp-uglify": "~0.2.1",
"gulp-plumber": "~0.5.6",
"express": "~3.4.8",
"path": "~0.4.9",
"gulp-util": "~2.2.14",
"gulp-nodemon": "~1.0.2",
"jade": "~1.3.0",
"connect-multiparty": "~1.0.3",
"request": "~2.34.0",
"connect-flash": "~0.1.1",
"gulp-svg-sprites": "~0.0.6"
}
}
| {
"name": "regard",
"version": "1.0.3",
"description": "Website for regard",
"main": "index.js",
"author": "",
"license": "Apache v2",
"repository": "https://github.com/with-regard/regard-website.git",
"dependencies": {
"gulp": "~3.5.2",
"gulp-sass": "~0.6.0",
"gulp-watch": "~0.5.0",
"gulp-autoprefixer": "0.0.6",
"gulp-minify-css": "~0.3.0",
"tiny-lr": "0.0.5",
"gulp-livereload": "~1.0.1",
"gulp-jade": "~0.4.1",
"gulp-uglify": "~0.2.1",
"gulp-plumber": "~0.5.6",
"express": "~3.4.8",
"path": "~0.4.9",
"gulp-util": "~2.2.14",
"gulp-nodemon": "~1.0.2",
"jade": "~1.3.0",
"connect-multiparty": "~1.0.3",
"request": "~2.34.0",
"connect-flash": "~0.1.1",
- "gulp-svg-sprites": "https://github.com/davidblurton/gulp-svg-sprites/archive/fix-element-names-on-windows.tar.gz"
+ "gulp-svg-sprites": "~0.0.6"
}
} | 2 | 0.066667 | 1 | 1 |
1cdbc64f9bdf286affb77534fbcf52cc9d4049e8 | .travis.yml | .travis.yml | language: python
python:
- "2.7"
- "3.3"
- "3.4"
services:
- elasticsearch
install:
- "pip install webtest coverage nose-cov flake8 python-coveralls --use-mirrors"
- "pip install -e . --use-mirrors"
before_script: "flake8"
script: "nosetests"
after_success:
- coveralls
| language: python
python:
- "2.7"
- "3.3"
- "3.4"
services:
- elasticsearch
before_install:
- "wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.deb && sudo dpkg -i --force-confnew elasticsearch-1.4.4.deb"
install:
- "pip install webtest coverage nose-cov flake8 python-coveralls --use-mirrors"
- "pip install -e . --use-mirrors"
before_script: "flake8"
script: "nosetests"
after_success:
- coveralls
| Use a more recent version of elasticsearch | Use a more recent version of elasticsearch
| YAML | mit | storborg/pyramid_es | yaml | ## Code Before:
language: python
python:
- "2.7"
- "3.3"
- "3.4"
services:
- elasticsearch
install:
- "pip install webtest coverage nose-cov flake8 python-coveralls --use-mirrors"
- "pip install -e . --use-mirrors"
before_script: "flake8"
script: "nosetests"
after_success:
- coveralls
## Instruction:
Use a more recent version of elasticsearch
## Code After:
language: python
python:
- "2.7"
- "3.3"
- "3.4"
services:
- elasticsearch
before_install:
- "wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.deb && sudo dpkg -i --force-confnew elasticsearch-1.4.4.deb"
install:
- "pip install webtest coverage nose-cov flake8 python-coveralls --use-mirrors"
- "pip install -e . --use-mirrors"
before_script: "flake8"
script: "nosetests"
after_success:
- coveralls
| language: python
python:
- "2.7"
- "3.3"
- "3.4"
services:
- elasticsearch
+
+ before_install:
+ - "wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.deb && sudo dpkg -i --force-confnew elasticsearch-1.4.4.deb"
install:
- "pip install webtest coverage nose-cov flake8 python-coveralls --use-mirrors"
- "pip install -e . --use-mirrors"
before_script: "flake8"
script: "nosetests"
after_success:
- coveralls | 3 | 0.15 | 3 | 0 |
f1ac2a903488e5276ef6fffdd634e10b54951f0f | meetups/ostatni.yml | meetups/ostatni.yml | []
| - name: PyLadies Olomouc <br> začátečnický kurz
registration:
url: https://forms.gle/74qRf346E7YRT1Kr5
end: 2019-08-01
start: 2019-09-01
end: 2019-12-31
place: &rc-hermanek
name: RC Heřmánek
address: Náves Svobody 41, Olomouc - Holice
url: https://goo.gl/maps/z7PT3QtNBj42VurX6
| Add first PyLadies course for beginners | Olomouc: Add first PyLadies course for beginners
| YAML | mit | PyLadiesCZ/pyladies.cz,PyLadiesCZ/pyladies.cz,PyLadiesCZ/pyladies.cz | yaml | ## Code Before:
[]
## Instruction:
Olomouc: Add first PyLadies course for beginners
## Code After:
- name: PyLadies Olomouc <br> začátečnický kurz
registration:
url: https://forms.gle/74qRf346E7YRT1Kr5
end: 2019-08-01
start: 2019-09-01
end: 2019-12-31
place: &rc-hermanek
name: RC Heřmánek
address: Náves Svobody 41, Olomouc - Holice
url: https://goo.gl/maps/z7PT3QtNBj42VurX6
| - []
+ - name: PyLadies Olomouc <br> začátečnický kurz
+ registration:
+ url: https://forms.gle/74qRf346E7YRT1Kr5
+ end: 2019-08-01
+ start: 2019-09-01
+ end: 2019-12-31
+ place: &rc-hermanek
+ name: RC Heřmánek
+ address: Náves Svobody 41, Olomouc - Holice
+ url: https://goo.gl/maps/z7PT3QtNBj42VurX6 | 11 | 11 | 10 | 1 |
e7558bf1739ca39d8ffc7a1276afaf4cf1066dfc | tests/resources/modelflattening/import_for_importedunitswithnameclashes.xml | tests/resources/modelflattening/import_for_importedunitswithnameclashes.xml | <?xml version="1.0"?>
<model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="reusable_model">
<units name="common_units">
<unit units="second"/>
</units>
<component name="reusable_component">
<variable name="v" units="common_units" interface="public_and_private"/>
</component>
</model>
| <?xml version="1.0"?>
<model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="reusable_model">
<units name="common_units">
<unit units="second" prefix="hecto"/>
</units>
<component name="reusable_component">
<variable name="v" units="common_units" interface="public_and_private"/>
</component>
</model>
| Make the units 'common_units' dimensionally different so forcing a name change for the imported units. | Make the units 'common_units' dimensionally different so forcing a name change for the imported units.
| XML | apache-2.0 | nickerso/libcellml,hsorby/libcellml,cellml/libcellml,cellml/libcellml,MichaelClerx/libcellml,nickerso/libcellml,hsorby/libcellml,cellml/libcellml,MichaelClerx/libcellml,MichaelClerx/libcellml,hsorby/libcellml,nickerso/libcellml,hsorby/libcellml,nickerso/libcellml,cellml/libcellml | xml | ## Code Before:
<?xml version="1.0"?>
<model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="reusable_model">
<units name="common_units">
<unit units="second"/>
</units>
<component name="reusable_component">
<variable name="v" units="common_units" interface="public_and_private"/>
</component>
</model>
## Instruction:
Make the units 'common_units' dimensionally different so forcing a name change for the imported units.
## Code After:
<?xml version="1.0"?>
<model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="reusable_model">
<units name="common_units">
<unit units="second" prefix="hecto"/>
</units>
<component name="reusable_component">
<variable name="v" units="common_units" interface="public_and_private"/>
</component>
</model>
| <?xml version="1.0"?>
<model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="reusable_model">
<units name="common_units">
- <unit units="second"/>
+ <unit units="second" prefix="hecto"/>
? +++++++++++++++
</units>
<component name="reusable_component">
<variable name="v" units="common_units" interface="public_and_private"/>
</component>
</model> | 2 | 0.222222 | 1 | 1 |
68be3f9fb56263d9896da6087d476b875dc8ee7d | app/controllers/users_controller.rb | app/controllers/users_controller.rb | class UsersController < ApplicationController
before_action :authenticate_user!, only: [:new, :create, :update, :edit]
def index
@users = User.all
end
def show
@user = User.find(params[:id])
@connection = Connection.find_by(initializer_id:current_user.id, receiver_id: @user.id) || @connection = Connection.find_by(initializer_id:@user.id, receiver_id: current_user.id)
@connections = @user.initializer_connections + @user.receiver_connections
end
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
if @user.update(user_params)
redirect_to users_path
else
render 'edit'
end
end
def create
@user = User.new(user_params)
if @user.save(user_params)
redirect_to users_path
else
render 'new'
end
end
def new
@user = User.new(user_params)
render 'new'
end
private
def user_params
params.require(:user).permit(:all)
end
end
| class UsersController < ApplicationController
before_action :authenticate_user!, only: [:new, :create, :update, :edit]
def index
@users = User.all
end
def show
@user = User.find(params[:id])
if current_user
@connection = Connection.find_by(initializer_id:current_user.id, receiver_id: @user.id) || @connection = Connection.find_by(initializer_id:@user.id, receiver_id: current_user.id)
@connections = @user.initializer_connections + @user.receiver_connections
end
end
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
if @user.update(user_params)
redirect_to users_path
else
render 'edit'
end
end
def create
@user = User.new(user_params)
if @user.save(user_params)
redirect_to users_path
else
render 'new'
end
end
def new
@user = User.new(user_params)
render 'new'
end
private
def user_params
params.require(:user).permit(:all)
end
end
| Add check to see if user is signed in | Add check to see if user is signed in
| Ruby | mit | raquelxmoss/learning_connect,raquelxmoss/learning_connect,raquelxmoss/learning_connect | ruby | ## Code Before:
class UsersController < ApplicationController
before_action :authenticate_user!, only: [:new, :create, :update, :edit]
def index
@users = User.all
end
def show
@user = User.find(params[:id])
@connection = Connection.find_by(initializer_id:current_user.id, receiver_id: @user.id) || @connection = Connection.find_by(initializer_id:@user.id, receiver_id: current_user.id)
@connections = @user.initializer_connections + @user.receiver_connections
end
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
if @user.update(user_params)
redirect_to users_path
else
render 'edit'
end
end
def create
@user = User.new(user_params)
if @user.save(user_params)
redirect_to users_path
else
render 'new'
end
end
def new
@user = User.new(user_params)
render 'new'
end
private
def user_params
params.require(:user).permit(:all)
end
end
## Instruction:
Add check to see if user is signed in
## Code After:
class UsersController < ApplicationController
before_action :authenticate_user!, only: [:new, :create, :update, :edit]
def index
@users = User.all
end
def show
@user = User.find(params[:id])
if current_user
@connection = Connection.find_by(initializer_id:current_user.id, receiver_id: @user.id) || @connection = Connection.find_by(initializer_id:@user.id, receiver_id: current_user.id)
@connections = @user.initializer_connections + @user.receiver_connections
end
end
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
if @user.update(user_params)
redirect_to users_path
else
render 'edit'
end
end
def create
@user = User.new(user_params)
if @user.save(user_params)
redirect_to users_path
else
render 'new'
end
end
def new
@user = User.new(user_params)
render 'new'
end
private
def user_params
params.require(:user).permit(:all)
end
end
| class UsersController < ApplicationController
before_action :authenticate_user!, only: [:new, :create, :update, :edit]
def index
@users = User.all
end
def show
@user = User.find(params[:id])
+ if current_user
@connection = Connection.find_by(initializer_id:current_user.id, receiver_id: @user.id) || @connection = Connection.find_by(initializer_id:@user.id, receiver_id: current_user.id)
@connections = @user.initializer_connections + @user.receiver_connections
+ end
end
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
if @user.update(user_params)
redirect_to users_path
else
render 'edit'
end
end
def create
@user = User.new(user_params)
if @user.save(user_params)
redirect_to users_path
else
render 'new'
end
end
def new
@user = User.new(user_params)
render 'new'
end
private
def user_params
params.require(:user).permit(:all)
end
end | 2 | 0.043478 | 2 | 0 |
9ed33188bebf52de4cab14bb6c8a9c83f013959d | .travis.yml | .travis.yml | language: java
compiler:
- gcc
script: LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build" make test && make clean && make bindings
| language: java
compiler:
- gcc
addons:
apt:
packages:
- erlang
- erlang-dev
script: LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build" make test && make clean && make bindings
| Add missing packages for Erlang. | [test]: Add missing packages for Erlang.
| YAML | apache-2.0 | chrismoos/hash-ring,chrismoos/hash-ring,chrismoos/hash-ring,chrismoos/hash-ring | yaml | ## Code Before:
language: java
compiler:
- gcc
script: LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build" make test && make clean && make bindings
## Instruction:
[test]: Add missing packages for Erlang.
## Code After:
language: java
compiler:
- gcc
addons:
apt:
packages:
- erlang
- erlang-dev
script: LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build" make test && make clean && make bindings
| language: java
compiler:
- gcc
+ addons:
+ apt:
+ packages:
+ - erlang
+ - erlang-dev
script: LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build" make test && make clean && make bindings | 5 | 1.25 | 5 | 0 |
56c39c8ca77004ae8fb801832153fa892d95d7b0 | kura/org.eclipse.kura.camel/src/main/java/org/eclipse/kura/camel/runner/RoutesProvider.java | kura/org.eclipse.kura.camel/src/main/java/org/eclipse/kura/camel/runner/RoutesProvider.java | /*******************************************************************************
* Copyright (c) 2016 Red Hat Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat Inc - initial API and implementation
*******************************************************************************/
package org.eclipse.kura.camel.runner;
import org.apache.camel.CamelContext;
public interface RoutesProvider {
/**
* Apply the desired state of camel routes to the context
* <p>
* <strong>Note: </strong> This method may need to stop and remove
* routes which are no longer used
* </p>
*
* @param camelContext
* the context the routes should by applied to
* @throws Exception
* if anything goes wrong
*/
public void applyRoutes(CamelContext camelContext) throws Exception;
} | /*******************************************************************************
* Copyright (c) 2016, 2017 Red Hat Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat Inc - initial API and implementation
*******************************************************************************/
package org.eclipse.kura.camel.runner;
import org.apache.camel.CamelContext;
@FunctionalInterface
public interface RoutesProvider {
/**
* Apply the desired state of camel routes to the context
* <p>
* <strong>Note: </strong> This method may need to stop and remove
* routes which are no longer used
* </p>
*
* @param camelContext
* the context the routes should by applied to
* @throws Exception
* if anything goes wrong
*/
public void applyRoutes(CamelContext camelContext) throws Exception;
} | Make it a functional interface | Make it a functional interface
Signed-off-by: Jens Reimann <d1bf62d29e711fdf0a5795916341a7b53d204e2a@redhat.com> | Java | epl-1.0 | darionct/kura,nicolatimeus/kura,gavinying/kura,ctron/kura,cdealti/kura,markoer/kura,ymai/kura,ctron/kura,gavinying/kura,darionct/kura,markoer/kura,amitjoy/kura,darionct/kura,amitjoy/kura,ymai/kura,MMaiero/kura,gavinying/kura,markoer/kura,darionct/kura,ymai/kura,amitjoy/kura,cdealti/kura,cdealti/kura,markoer/kura,gavinying/kura,markoer/kura,MMaiero/kura,ymai/kura,cdealti/kura,amitjoy/kura,ymai/kura,ctron/kura,darionct/kura,nicolatimeus/kura,MMaiero/kura,MMaiero/kura,cdealti/kura,markoer/kura,MMaiero/kura,ymai/kura,nicolatimeus/kura,ctron/kura,gavinying/kura,cdealti/kura,nicolatimeus/kura,ctron/kura,nicolatimeus/kura,amitjoy/kura,gavinying/kura,nicolatimeus/kura,MMaiero/kura,darionct/kura,amitjoy/kura,ctron/kura | java | ## Code Before:
/*******************************************************************************
* Copyright (c) 2016 Red Hat Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat Inc - initial API and implementation
*******************************************************************************/
package org.eclipse.kura.camel.runner;
import org.apache.camel.CamelContext;
public interface RoutesProvider {
/**
* Apply the desired state of camel routes to the context
* <p>
* <strong>Note: </strong> This method may need to stop and remove
* routes which are no longer used
* </p>
*
* @param camelContext
* the context the routes should by applied to
* @throws Exception
* if anything goes wrong
*/
public void applyRoutes(CamelContext camelContext) throws Exception;
}
## Instruction:
Make it a functional interface
Signed-off-by: Jens Reimann <d1bf62d29e711fdf0a5795916341a7b53d204e2a@redhat.com>
## Code After:
/*******************************************************************************
* Copyright (c) 2016, 2017 Red Hat Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat Inc - initial API and implementation
*******************************************************************************/
package org.eclipse.kura.camel.runner;
import org.apache.camel.CamelContext;
@FunctionalInterface
public interface RoutesProvider {
/**
* Apply the desired state of camel routes to the context
* <p>
* <strong>Note: </strong> This method may need to stop and remove
* routes which are no longer used
* </p>
*
* @param camelContext
* the context the routes should by applied to
* @throws Exception
* if anything goes wrong
*/
public void applyRoutes(CamelContext camelContext) throws Exception;
} | /*******************************************************************************
- * Copyright (c) 2016 Red Hat Inc and others.
+ * Copyright (c) 2016, 2017 Red Hat Inc and others.
? ++++++
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat Inc - initial API and implementation
*******************************************************************************/
package org.eclipse.kura.camel.runner;
import org.apache.camel.CamelContext;
+ @FunctionalInterface
public interface RoutesProvider {
/**
* Apply the desired state of camel routes to the context
* <p>
* <strong>Note: </strong> This method may need to stop and remove
* routes which are no longer used
* </p>
*
* @param camelContext
* the context the routes should by applied to
* @throws Exception
* if anything goes wrong
*/
public void applyRoutes(CamelContext camelContext) throws Exception;
} | 3 | 0.1 | 2 | 1 |
e69a4df879a60584eb3dfaabbb852698594e9362 | models/src/main/java/com/vimeo/networking2/enums/BillingStatusType.kt | models/src/main/java/com/vimeo/networking2/enums/BillingStatusType.kt | package com.vimeo.networking2.enums
/**
* The status of this user's billing information.
*/
enum class BillingStatusType(override val value: String?) : StringValue {
/**
* The user's billing information is active.
*/
ACTIVE("active"),
/**
* The user's billing information has been canceled.
*/
CANCELED("canceled"),
/**
* The user's billing information has expired.
*/
EXPIRED("expired"),
/**
* The user's billing information is in a grace period before it's put on hold.
*/
GRACE_PERIOD("grace_period"),
/**
* The user's billing information is currently on hold.
*/
ON_HOLD("on_hold"),
/**
* Unknown billing status.
*/
UNKNOWN(null)
}
| package com.vimeo.networking2.enums
/**
* The status of this user's billing information.
*/
enum class BillingStatusType(override val value: String?) : StringValue {
/**
* The user's billing information is active and will auto-renew.
*/
ACTIVE("active"),
/**
* The user's billing information has been canceled, but the subscription could still be active depending
* on if the expiration date has passed.
*/
CANCELED("canceled"),
/**
* The user's billing information is in a pending state and is likely to change.
*/
PENDING("pending"),
/**
* The user's billing information is in a grace period before it's put on hold while the auto-renew
* charge is retried.
*/
GRACE_PERIOD("grace_period"),
/**
* The user's billing information is currently on hold due to a payment failure and the grace period expiring.
* (Google Play only)
*/
ON_HOLD("on_hold"),
/**
* Unknown billing status.
*/
UNKNOWN(null)
}
| Change expired to pending and updated comments | Change expired to pending and updated comments
| Kotlin | mit | vimeo/vimeo-networking-java,vimeo/vimeo-networking-java,vimeo/vimeo-networking-java | kotlin | ## Code Before:
package com.vimeo.networking2.enums
/**
* The status of this user's billing information.
*/
enum class BillingStatusType(override val value: String?) : StringValue {
/**
* The user's billing information is active.
*/
ACTIVE("active"),
/**
* The user's billing information has been canceled.
*/
CANCELED("canceled"),
/**
* The user's billing information has expired.
*/
EXPIRED("expired"),
/**
* The user's billing information is in a grace period before it's put on hold.
*/
GRACE_PERIOD("grace_period"),
/**
* The user's billing information is currently on hold.
*/
ON_HOLD("on_hold"),
/**
* Unknown billing status.
*/
UNKNOWN(null)
}
## Instruction:
Change expired to pending and updated comments
## Code After:
package com.vimeo.networking2.enums
/**
* The status of this user's billing information.
*/
enum class BillingStatusType(override val value: String?) : StringValue {
/**
* The user's billing information is active and will auto-renew.
*/
ACTIVE("active"),
/**
* The user's billing information has been canceled, but the subscription could still be active depending
* on if the expiration date has passed.
*/
CANCELED("canceled"),
/**
* The user's billing information is in a pending state and is likely to change.
*/
PENDING("pending"),
/**
* The user's billing information is in a grace period before it's put on hold while the auto-renew
* charge is retried.
*/
GRACE_PERIOD("grace_period"),
/**
* The user's billing information is currently on hold due to a payment failure and the grace period expiring.
* (Google Play only)
*/
ON_HOLD("on_hold"),
/**
* Unknown billing status.
*/
UNKNOWN(null)
}
| package com.vimeo.networking2.enums
/**
* The status of this user's billing information.
*/
enum class BillingStatusType(override val value: String?) : StringValue {
/**
- * The user's billing information is active.
+ * The user's billing information is active and will auto-renew.
? ++++++++++++++++++++
*/
ACTIVE("active"),
/**
- * The user's billing information has been canceled.
+ * The user's billing information has been canceled, but the subscription could still be active depending
+ * on if the expiration date has passed.
*/
CANCELED("canceled"),
/**
- * The user's billing information has expired.
+ * The user's billing information is in a pending state and is likely to change.
*/
- EXPIRED("expired"),
+ PENDING("pending"),
/**
- * The user's billing information is in a grace period before it's put on hold.
? ^
+ * The user's billing information is in a grace period before it's put on hold while the auto-renew
? ^^^^^^^^^^^^^^^^^^^^^
+ * charge is retried.
*/
GRACE_PERIOD("grace_period"),
/**
- * The user's billing information is currently on hold.
+ * The user's billing information is currently on hold due to a payment failure and the grace period expiring.
+ * (Google Play only)
*/
ON_HOLD("on_hold"),
/**
* Unknown billing status.
*/
UNKNOWN(null)
} | 15 | 0.405405 | 9 | 6 |
3aa86255b37c98419a07be0b5eb58b9c10a49502 | packages/ha/haskell-tools-ast.yaml | packages/ha/haskell-tools-ast.yaml | homepage: https://github.com/nboldi/haskell-tools
changelog-type: ''
hash: 342809b3c3ca3ab99373e3c4293cd1653e247d2197516b4f89fade979e03fa97
test-bench-deps: {}
maintainer: nboldi@elte.hu
synopsis: Haskell AST for efficient tooling
changelog: ''
basic-deps:
ghc: ! '>=8.0 && <8.1'
base: ! '>=4.9 && <5.0'
references: ! '>=0.3.2 && <1.0'
uniplate: ! '>=1.6 && <2.0'
structural-traversal: ! '>=0.1 && <0.2'
all-versions:
- '0.1.2.0'
author: Boldizsar Nemeth
latest: '0.1.2.0'
description-type: haddock
description: A representation of a Haskell Syntax tree that contain source-related
and semantic annotations. These annotations help developer tools to work with the
defined program. The source information enables refactoring and program transformation
tools to change the source code without losing the original format (layout, comments)
of the source. Semantic information helps analyzing the program. The representation
is different from the GHC's syntax tree. It contains information from all representations
in GHC (different version of syntax trees, lexical and module-level information).
license-name: BSD3
| homepage: https://github.com/nboldi/haskell-tools
changelog-type: ''
hash: 6664c01ba1f873109b096d93321f1c16b2fcd35da4cc9f97ed622fad053867c7
test-bench-deps: {}
maintainer: nboldi@elte.hu
synopsis: Haskell AST for efficient tooling
changelog: ''
basic-deps:
ghc: ! '>=8.0 && <8.1'
base: ! '>=4.9 && <5.0'
references: ! '>=0.3.2 && <1.0'
uniplate: ! '>=1.6 && <2.0'
structural-traversal: ! '>=0.1 && <0.2'
all-versions:
- '0.1.2.0'
- '0.1.2.1'
author: Boldizsar Nemeth
latest: '0.1.2.1'
description-type: haddock
description: A representation of a Haskell Syntax tree that contain source-related
and semantic annotations. These annotations help developer tools to work with the
defined program. The source information enables refactoring and program transformation
tools to change the source code without losing the original format (layout, comments)
of the source. Semantic information helps analyzing the program. The representation
is different from the GHC's syntax tree. It contains information from all representations
in GHC (different version of syntax trees, lexical and module-level information).
license-name: BSD3
| Update from Hackage at 2016-07-01T12:53:52+0000 | Update from Hackage at 2016-07-01T12:53:52+0000
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/nboldi/haskell-tools
changelog-type: ''
hash: 342809b3c3ca3ab99373e3c4293cd1653e247d2197516b4f89fade979e03fa97
test-bench-deps: {}
maintainer: nboldi@elte.hu
synopsis: Haskell AST for efficient tooling
changelog: ''
basic-deps:
ghc: ! '>=8.0 && <8.1'
base: ! '>=4.9 && <5.0'
references: ! '>=0.3.2 && <1.0'
uniplate: ! '>=1.6 && <2.0'
structural-traversal: ! '>=0.1 && <0.2'
all-versions:
- '0.1.2.0'
author: Boldizsar Nemeth
latest: '0.1.2.0'
description-type: haddock
description: A representation of a Haskell Syntax tree that contain source-related
and semantic annotations. These annotations help developer tools to work with the
defined program. The source information enables refactoring and program transformation
tools to change the source code without losing the original format (layout, comments)
of the source. Semantic information helps analyzing the program. The representation
is different from the GHC's syntax tree. It contains information from all representations
in GHC (different version of syntax trees, lexical and module-level information).
license-name: BSD3
## Instruction:
Update from Hackage at 2016-07-01T12:53:52+0000
## Code After:
homepage: https://github.com/nboldi/haskell-tools
changelog-type: ''
hash: 6664c01ba1f873109b096d93321f1c16b2fcd35da4cc9f97ed622fad053867c7
test-bench-deps: {}
maintainer: nboldi@elte.hu
synopsis: Haskell AST for efficient tooling
changelog: ''
basic-deps:
ghc: ! '>=8.0 && <8.1'
base: ! '>=4.9 && <5.0'
references: ! '>=0.3.2 && <1.0'
uniplate: ! '>=1.6 && <2.0'
structural-traversal: ! '>=0.1 && <0.2'
all-versions:
- '0.1.2.0'
- '0.1.2.1'
author: Boldizsar Nemeth
latest: '0.1.2.1'
description-type: haddock
description: A representation of a Haskell Syntax tree that contain source-related
and semantic annotations. These annotations help developer tools to work with the
defined program. The source information enables refactoring and program transformation
tools to change the source code without losing the original format (layout, comments)
of the source. Semantic information helps analyzing the program. The representation
is different from the GHC's syntax tree. It contains information from all representations
in GHC (different version of syntax trees, lexical and module-level information).
license-name: BSD3
| homepage: https://github.com/nboldi/haskell-tools
changelog-type: ''
- hash: 342809b3c3ca3ab99373e3c4293cd1653e247d2197516b4f89fade979e03fa97
+ hash: 6664c01ba1f873109b096d93321f1c16b2fcd35da4cc9f97ed622fad053867c7
test-bench-deps: {}
maintainer: nboldi@elte.hu
synopsis: Haskell AST for efficient tooling
changelog: ''
basic-deps:
ghc: ! '>=8.0 && <8.1'
base: ! '>=4.9 && <5.0'
references: ! '>=0.3.2 && <1.0'
uniplate: ! '>=1.6 && <2.0'
structural-traversal: ! '>=0.1 && <0.2'
all-versions:
- '0.1.2.0'
+ - '0.1.2.1'
author: Boldizsar Nemeth
- latest: '0.1.2.0'
? ^
+ latest: '0.1.2.1'
? ^
description-type: haddock
description: A representation of a Haskell Syntax tree that contain source-related
and semantic annotations. These annotations help developer tools to work with the
defined program. The source information enables refactoring and program transformation
tools to change the source code without losing the original format (layout, comments)
of the source. Semantic information helps analyzing the program. The representation
is different from the GHC's syntax tree. It contains information from all representations
in GHC (different version of syntax trees, lexical and module-level information).
license-name: BSD3 | 5 | 0.192308 | 3 | 2 |
2d4411ab33899dd7cb1f4f911f9d59e28d5423e3 | lib/development_tasks/rspec.rake | lib/development_tasks/rspec.rake | if defined?(RSpec)
require 'rspec/core/rake_task'
namespace :spec do
desc "Preparing test env"
task :prepare do
tmp_env = Rails.env
Rails.env = "test"
Rake::Task["ffcrm:config:copy_database_yml"].invoke
puts "Preparing test database..."
Rake::Task["db:schema:load"].invoke
Rails.env = tmp_env
end
end
Rake::Task["spec"].prerequisites.clear
Rake::Task["spec"].prerequisites.push("spec:prepare")
desc 'Run the acceptance specs in ./acceptance'
RSpec::Core::RakeTask.new(:acceptance => 'spec:prepare') do |t|
t.pattern = 'acceptance/**/*_spec.rb'
end
end
| if defined?(RSpec)
require 'rspec/core/rake_task'
namespace :spec do
desc "Preparing test env"
task :prepare do
tmp_env = Rails.env
Rails.env = "test"
Rake::Task["ffcrm:config:copy_database_yml"].invoke
puts "Preparing test database..."
Rake::Task["db:schema:load"].invoke
Rails.env = tmp_env
end
end
Rake::Task["spec"].prerequisites.clear
Rake::Task["spec"].prerequisites.push("spec:prepare")
end
| Remove old 'rake acceptance' task | Remove old 'rake acceptance' task
| Ruby | mit | fkoessler/fat_free_crm,chickensmitten/ffcrm,yhourdel/fat_free_crm,aniltimt/fat_free_crm,sustainableharvest/fat_free_crm,pklauac/fat_free_crm,DakotaLMartinez/fat_free_crm,ianrtracey/fat,reubenjs/fat_free_crm,hunterlive/hdrive,chickensmitten/workcrm,Lumbe/lcrm-app,DakotaLMartinez/fat_free_crm,hunterlive/hdrive,ivanbenko/fat_free_crm,chickensmitten/workcrm,Rvor/crm,Scosentino/fat_free_crm,yhourdel/fat_free_crm,aarting/heat-wave-crm-mel,hunterlive/hdrive,stanleylhs/fat_free_crm,unboxed/fat_free_crm,ivanbenko/fat_free_crm,dalegregory/fat_free_crm,dp4rk/fat_free_crm,StudioMelipone/fat_free_crm,aniltimt/fat_free_crm,rovin100/fat_free_crm,reduced-fat-crm/fat_free_crm,ianrtracey/fat,AntonioRossi/fat_free_crm,mmalivuk/homiecrm,Phaya-nmt/ffcm,dalegregory/fat_free_crm,sustainableharvest/fat_free_crm,CloCkWeRX/fat_free_crm,sideci-sample/sideci-sample-fat_free_crm,ych06/fat_free_crm,jay3126/fat_free_crm_rails_4,stanleylhs/fat_free_crm,mojacc/fat_free_crm,AntonioRossi/fat_free_crm,jeanmatheussouto/fat_free_crm,rovin100/fat_free_crm,fkoessler/fat_free_crm,mojacc/fat_free_crm,williammoraes/fat_free_crm,Damo1223/CRM,arboradalaci/fatfreecrm,Rvor/crm,StudioMelipone/fat_free_crm,asadakbar/halaljerkycrm,turingschool/crm,leikir/fat_free_crm,CloCkWeRX/fat_free_crm,pklauac/fat_free_crm,dp4rk/fat_free_crm,unboxed/fat_free_crm,danjohnson3141/fat_free_crm,leikir/fat_free_crm,badseeds/fat_free_crm,williammoraes/fat_free_crm,Damo1223/CRM,badseeds/fatfreecrm,karabitski/fat_crm,turingschool/crm,jeanmatheussouto/fat_free_crm,Phaya-nmt/ffcm,Scosentino/fat_free_crm,reubenjs/fat_free_crm,neo4jrb/neo4j_fat_free_crm,reduced-fat-crm/fat_free_crm,Lumbe/lcrm-app,ych06/fat_free_crm | ruby | ## Code Before:
if defined?(RSpec)
require 'rspec/core/rake_task'
namespace :spec do
desc "Preparing test env"
task :prepare do
tmp_env = Rails.env
Rails.env = "test"
Rake::Task["ffcrm:config:copy_database_yml"].invoke
puts "Preparing test database..."
Rake::Task["db:schema:load"].invoke
Rails.env = tmp_env
end
end
Rake::Task["spec"].prerequisites.clear
Rake::Task["spec"].prerequisites.push("spec:prepare")
desc 'Run the acceptance specs in ./acceptance'
RSpec::Core::RakeTask.new(:acceptance => 'spec:prepare') do |t|
t.pattern = 'acceptance/**/*_spec.rb'
end
end
## Instruction:
Remove old 'rake acceptance' task
## Code After:
if defined?(RSpec)
require 'rspec/core/rake_task'
namespace :spec do
desc "Preparing test env"
task :prepare do
tmp_env = Rails.env
Rails.env = "test"
Rake::Task["ffcrm:config:copy_database_yml"].invoke
puts "Preparing test database..."
Rake::Task["db:schema:load"].invoke
Rails.env = tmp_env
end
end
Rake::Task["spec"].prerequisites.clear
Rake::Task["spec"].prerequisites.push("spec:prepare")
end
| if defined?(RSpec)
require 'rspec/core/rake_task'
-
+
namespace :spec do
desc "Preparing test env"
task :prepare do
tmp_env = Rails.env
Rails.env = "test"
Rake::Task["ffcrm:config:copy_database_yml"].invoke
puts "Preparing test database..."
Rake::Task["db:schema:load"].invoke
Rails.env = tmp_env
end
end
Rake::Task["spec"].prerequisites.clear
Rake::Task["spec"].prerequisites.push("spec:prepare")
- desc 'Run the acceptance specs in ./acceptance'
- RSpec::Core::RakeTask.new(:acceptance => 'spec:prepare') do |t|
- t.pattern = 'acceptance/**/*_spec.rb'
- end
end | 6 | 0.26087 | 1 | 5 |
577c910f89f34c35674389ed84b4311d5fe8e4e9 | app/controllers/hook_controller.rb | app/controllers/hook_controller.rb | class HookController < ActionController::Base
MAX_SIZE = 100 * 1024
def digest
status = :ok
json = {}
if request.body.length > MAX_SIZE
status = :bad_request
json[:error] = 'Data is too long'
else
unless (token = params[:access_token])
if (auth_header = request.headers['Authorization'])
token_type, token = auth_header.to_s.squeeze(' ').strip.split(' ')
token = nil unless token_type == 'Bearer' && token.present?
end
end
if token
begin
if Cenit::Hook.digest(token, params[:slug], request.body.read, request.content_type)
json[:status] = :ok
else
json[:error] = "Hook token is invalid"
status = :unauthorized
end
rescue Exception => ex
report = Setup::SystemNotification.create_from(ex)
json[:error] = "Ask for support by supplying this code: #{report.id}"
status = :internal_server_error
end
else
json[:error] = "Authorization token is malformed or missing"
status = :unauthorized
end
end
render json: json, status: status
end
end
| class HookController < ActionController::Base
MAX_SIZE = 100 * 1024
def digest
status = :accepted
json = {}
if request.body.length > MAX_SIZE
status = :bad_request
json[:error] = 'Data is too long'
else
unless (token = params[:access_token])
if (auth_header = request.headers['Authorization'])
token_type, token = auth_header.to_s.squeeze(' ').strip.split(' ')
token = nil unless token_type == 'Bearer' && token.present?
end
end
if token
begin
if Cenit::Hook.digest(token, params[:slug], request.body.read, request.content_type)
json[:status] = :accepted
else
json[:error] = "Hook token is invalid"
status = :unauthorized
end
rescue Exception => ex
report = Setup::SystemNotification.create_from(ex)
json[:error] = "Ask for support by supplying this code: #{report.id}"
status = :internal_server_error
end
else
json[:error] = "Authorization token is malformed or missing"
status = :unauthorized
end
end
render json: json, status: status
end
end
| Add | Responding hook requests with Accepted status code | Add | Responding hook requests with Accepted status code
| Ruby | mit | cenit-io/cenit,cenit-io/cenit,cenit-io/cenit,cenit-io/cenit | ruby | ## Code Before:
class HookController < ActionController::Base
MAX_SIZE = 100 * 1024
def digest
status = :ok
json = {}
if request.body.length > MAX_SIZE
status = :bad_request
json[:error] = 'Data is too long'
else
unless (token = params[:access_token])
if (auth_header = request.headers['Authorization'])
token_type, token = auth_header.to_s.squeeze(' ').strip.split(' ')
token = nil unless token_type == 'Bearer' && token.present?
end
end
if token
begin
if Cenit::Hook.digest(token, params[:slug], request.body.read, request.content_type)
json[:status] = :ok
else
json[:error] = "Hook token is invalid"
status = :unauthorized
end
rescue Exception => ex
report = Setup::SystemNotification.create_from(ex)
json[:error] = "Ask for support by supplying this code: #{report.id}"
status = :internal_server_error
end
else
json[:error] = "Authorization token is malformed or missing"
status = :unauthorized
end
end
render json: json, status: status
end
end
## Instruction:
Add | Responding hook requests with Accepted status code
## Code After:
class HookController < ActionController::Base
MAX_SIZE = 100 * 1024
def digest
status = :accepted
json = {}
if request.body.length > MAX_SIZE
status = :bad_request
json[:error] = 'Data is too long'
else
unless (token = params[:access_token])
if (auth_header = request.headers['Authorization'])
token_type, token = auth_header.to_s.squeeze(' ').strip.split(' ')
token = nil unless token_type == 'Bearer' && token.present?
end
end
if token
begin
if Cenit::Hook.digest(token, params[:slug], request.body.read, request.content_type)
json[:status] = :accepted
else
json[:error] = "Hook token is invalid"
status = :unauthorized
end
rescue Exception => ex
report = Setup::SystemNotification.create_from(ex)
json[:error] = "Ask for support by supplying this code: #{report.id}"
status = :internal_server_error
end
else
json[:error] = "Authorization token is malformed or missing"
status = :unauthorized
end
end
render json: json, status: status
end
end
| class HookController < ActionController::Base
MAX_SIZE = 100 * 1024
def digest
- status = :ok
+ status = :accepted
json = {}
if request.body.length > MAX_SIZE
status = :bad_request
json[:error] = 'Data is too long'
else
unless (token = params[:access_token])
if (auth_header = request.headers['Authorization'])
token_type, token = auth_header.to_s.squeeze(' ').strip.split(' ')
token = nil unless token_type == 'Bearer' && token.present?
end
end
if token
begin
if Cenit::Hook.digest(token, params[:slug], request.body.read, request.content_type)
- json[:status] = :ok
? ^^
+ json[:status] = :accepted
? ^^^^^^^^
else
json[:error] = "Hook token is invalid"
status = :unauthorized
end
rescue Exception => ex
report = Setup::SystemNotification.create_from(ex)
json[:error] = "Ask for support by supplying this code: #{report.id}"
status = :internal_server_error
end
else
json[:error] = "Authorization token is malformed or missing"
status = :unauthorized
end
end
render json: json, status: status
end
end | 4 | 0.102564 | 2 | 2 |
188de577159de8c53e5af0b04e01596a89b07b5d | dot.config/fish/config.fish | dot.config/fish/config.fish | set -gx LANGUAGE en_US.UTF-8
set -gx LANG $LANGUAGE
set -gx LC_ALL $LANGUAGE
set -gx LC_CTYPE $LANGUAGE
# Editor
set -gx EDITOR vim
set -gx CVSEDITOR $EDITOR
set -gx SVN_EDITOR $EDITOR
set -gx GIT_EDITOR $EDITOR
# Pager
set -gx PAGER less
# XDG
set -gx XDG_CACHE_HOME $HOME/.cache
set -gx XDG_CONFIG_HOME $HOME/.config
set -gx XDG_DATA_HOME $HOME/.local/share
# Golang
set -gx GOPATH $HOME/work
set -gx PATH $PATH $GOPATH/bin
# fzf
set -gx FZF_DEFAULT_OPTS --reverse
set -gx FZF_LEGACY_KEYBINDINGS 1
set -gx FZF_TMUX 1
# ghq
set -gx GHQ_SELECTOR fzf
# nodebrew
set -gx PATH $HOME/.nodebrew/current/bin $PATH
# rbenv
rbenv init - | source
# pyenv
status --is-interactive; and source (pyenv init -|psub)
# direnv
eval (direnv hook fish)
# Aliases
alias be "bundle exec"
alias bi "bundle install"
alias bo "bundle open"
alias bu "bundle update"
alias du "du -h"
alias g git
alias r rails
alias vi vim
| set -gx LANGUAGE en_US.UTF-8
set -gx LANG $LANGUAGE
set -gx LC_ALL $LANGUAGE
set -gx LC_CTYPE $LANGUAGE
# Editor
set -gx EDITOR vim
set -gx CVSEDITOR $EDITOR
set -gx SVN_EDITOR $EDITOR
set -gx GIT_EDITOR $EDITOR
# Pager
set -gx PAGER less
# XDG
set -gx XDG_CACHE_HOME $HOME/.cache
set -gx XDG_CONFIG_HOME $HOME/.config
set -gx XDG_DATA_HOME $HOME/.local/share
# Golang
set -gx GOPATH $HOME/work
set -gx PATH $PATH $GOPATH/bin
# fzf
set -gx FZF_DEFAULT_OPTS --reverse
set -gx FZF_LEGACY_KEYBINDINGS 1
set -gx FZF_TMUX 1
# ghq
set -gx GHQ_SELECTOR fzf
# nodebrew
set -gx PATH $HOME/.nodebrew/current/bin $PATH
# direnv
eval (direnv hook fish)
# Aliases
alias be "bundle exec"
alias bi "bundle install"
alias bo "bundle open"
alias bu "bundle update"
alias du "du -h"
alias g git
alias r rails
alias vi vim
| Remove unnecessary setting on fish | Remove unnecessary setting on fish
| fish | mit | ojiry/dotfiles | fish | ## Code Before:
set -gx LANGUAGE en_US.UTF-8
set -gx LANG $LANGUAGE
set -gx LC_ALL $LANGUAGE
set -gx LC_CTYPE $LANGUAGE
# Editor
set -gx EDITOR vim
set -gx CVSEDITOR $EDITOR
set -gx SVN_EDITOR $EDITOR
set -gx GIT_EDITOR $EDITOR
# Pager
set -gx PAGER less
# XDG
set -gx XDG_CACHE_HOME $HOME/.cache
set -gx XDG_CONFIG_HOME $HOME/.config
set -gx XDG_DATA_HOME $HOME/.local/share
# Golang
set -gx GOPATH $HOME/work
set -gx PATH $PATH $GOPATH/bin
# fzf
set -gx FZF_DEFAULT_OPTS --reverse
set -gx FZF_LEGACY_KEYBINDINGS 1
set -gx FZF_TMUX 1
# ghq
set -gx GHQ_SELECTOR fzf
# nodebrew
set -gx PATH $HOME/.nodebrew/current/bin $PATH
# rbenv
rbenv init - | source
# pyenv
status --is-interactive; and source (pyenv init -|psub)
# direnv
eval (direnv hook fish)
# Aliases
alias be "bundle exec"
alias bi "bundle install"
alias bo "bundle open"
alias bu "bundle update"
alias du "du -h"
alias g git
alias r rails
alias vi vim
## Instruction:
Remove unnecessary setting on fish
## Code After:
set -gx LANGUAGE en_US.UTF-8
set -gx LANG $LANGUAGE
set -gx LC_ALL $LANGUAGE
set -gx LC_CTYPE $LANGUAGE
# Editor
set -gx EDITOR vim
set -gx CVSEDITOR $EDITOR
set -gx SVN_EDITOR $EDITOR
set -gx GIT_EDITOR $EDITOR
# Pager
set -gx PAGER less
# XDG
set -gx XDG_CACHE_HOME $HOME/.cache
set -gx XDG_CONFIG_HOME $HOME/.config
set -gx XDG_DATA_HOME $HOME/.local/share
# Golang
set -gx GOPATH $HOME/work
set -gx PATH $PATH $GOPATH/bin
# fzf
set -gx FZF_DEFAULT_OPTS --reverse
set -gx FZF_LEGACY_KEYBINDINGS 1
set -gx FZF_TMUX 1
# ghq
set -gx GHQ_SELECTOR fzf
# nodebrew
set -gx PATH $HOME/.nodebrew/current/bin $PATH
# direnv
eval (direnv hook fish)
# Aliases
alias be "bundle exec"
alias bi "bundle install"
alias bo "bundle open"
alias bu "bundle update"
alias du "du -h"
alias g git
alias r rails
alias vi vim
| set -gx LANGUAGE en_US.UTF-8
set -gx LANG $LANGUAGE
set -gx LC_ALL $LANGUAGE
set -gx LC_CTYPE $LANGUAGE
# Editor
set -gx EDITOR vim
set -gx CVSEDITOR $EDITOR
set -gx SVN_EDITOR $EDITOR
set -gx GIT_EDITOR $EDITOR
# Pager
set -gx PAGER less
# XDG
set -gx XDG_CACHE_HOME $HOME/.cache
set -gx XDG_CONFIG_HOME $HOME/.config
set -gx XDG_DATA_HOME $HOME/.local/share
# Golang
set -gx GOPATH $HOME/work
set -gx PATH $PATH $GOPATH/bin
# fzf
set -gx FZF_DEFAULT_OPTS --reverse
set -gx FZF_LEGACY_KEYBINDINGS 1
set -gx FZF_TMUX 1
# ghq
set -gx GHQ_SELECTOR fzf
# nodebrew
set -gx PATH $HOME/.nodebrew/current/bin $PATH
- # rbenv
- rbenv init - | source
-
- # pyenv
- status --is-interactive; and source (pyenv init -|psub)
-
# direnv
eval (direnv hook fish)
# Aliases
alias be "bundle exec"
alias bi "bundle install"
alias bo "bundle open"
alias bu "bundle update"
alias du "du -h"
alias g git
alias r rails
alias vi vim | 6 | 0.115385 | 0 | 6 |
7f3804a1da20276ad309fa6554cca329f296ff64 | app/assets/javascripts/districts/controllers/sister_modal_controller.js | app/assets/javascripts/districts/controllers/sister_modal_controller.js | VtTracker.SisterModalController = Ember.ObjectController.extend({
needs: ['districtSistersIndex', 'application'],
districts: Ember.computed.alias('controllers.application.model'),
modalTitle: function() {
if (this.get('isNew')) {
return 'New Sister';
} else {
return 'Edit Sister';
}
}.property('isNew'),
actions: {
save: function() {
var _self = this;
var isNew = _self.get('model.isNew');
var district = _self.get('model.district');
_self.get('model').save().then(function() {
if (isNew) {
_self.set('controllers.districtSistersIndex.newSister', _self.store.createRecord('sister', {
district: district
}));
}
});
}
}
});
| VtTracker.SisterModalController = Ember.ObjectController.extend({
needs: ['districtSistersIndex', 'application'],
districts: Ember.computed.alias('controllers.application.model'),
modalTitle: function() {
if (this.get('isNew')) {
return 'New Sister';
} else {
return 'Edit Sister';
}
}.property('isNew'),
actions: {
removeModal: function() {
this.get('model').rollback();
return true;
},
save: function() {
var _self = this;
var isNew = _self.get('model.isNew');
var district = _self.get('model.district');
_self.get('model').save().then(function() {
if (isNew) {
_self.set('controllers.districtSistersIndex.newSister', _self.store.createRecord('sister', {
district: district
}));
}
});
}
}
});
| Rollback model when modal is closed | Rollback model when modal is closed | JavaScript | mit | bfcoder/vt-ht-tracker,bfcoder/vt-ht-tracker,bfcoder/vt-ht-tracker | javascript | ## Code Before:
VtTracker.SisterModalController = Ember.ObjectController.extend({
needs: ['districtSistersIndex', 'application'],
districts: Ember.computed.alias('controllers.application.model'),
modalTitle: function() {
if (this.get('isNew')) {
return 'New Sister';
} else {
return 'Edit Sister';
}
}.property('isNew'),
actions: {
save: function() {
var _self = this;
var isNew = _self.get('model.isNew');
var district = _self.get('model.district');
_self.get('model').save().then(function() {
if (isNew) {
_self.set('controllers.districtSistersIndex.newSister', _self.store.createRecord('sister', {
district: district
}));
}
});
}
}
});
## Instruction:
Rollback model when modal is closed
## Code After:
VtTracker.SisterModalController = Ember.ObjectController.extend({
needs: ['districtSistersIndex', 'application'],
districts: Ember.computed.alias('controllers.application.model'),
modalTitle: function() {
if (this.get('isNew')) {
return 'New Sister';
} else {
return 'Edit Sister';
}
}.property('isNew'),
actions: {
removeModal: function() {
this.get('model').rollback();
return true;
},
save: function() {
var _self = this;
var isNew = _self.get('model.isNew');
var district = _self.get('model.district');
_self.get('model').save().then(function() {
if (isNew) {
_self.set('controllers.districtSistersIndex.newSister', _self.store.createRecord('sister', {
district: district
}));
}
});
}
}
});
| VtTracker.SisterModalController = Ember.ObjectController.extend({
needs: ['districtSistersIndex', 'application'],
districts: Ember.computed.alias('controllers.application.model'),
modalTitle: function() {
if (this.get('isNew')) {
return 'New Sister';
} else {
return 'Edit Sister';
}
}.property('isNew'),
actions: {
+ removeModal: function() {
+ this.get('model').rollback();
+ return true;
+ },
+
save: function() {
var _self = this;
var isNew = _self.get('model.isNew');
var district = _self.get('model.district');
_self.get('model').save().then(function() {
if (isNew) {
_self.set('controllers.districtSistersIndex.newSister', _self.store.createRecord('sister', {
district: district
}));
}
});
}
}
}); | 5 | 0.178571 | 5 | 0 |
e95daeac684175b15be088cd4a3f92f8a19c3045 | .travis.yml | .travis.yml | language: node_js
node_js:
- 0.10
sudo: false
cache:
directories:
- bower_components
- node_modules
install:
- npm install
- npm install -g bower broccoli-cli karma-cli
- bower install --config.interactive=false
script:
- BROCCOLI_ENV=production broccoli build release
- npm test
after_success: .travis/after_success
| language: node_js
node_js:
- 0.10
sudo: false
cache:
directories:
- bower_components
- node_modules
env:
global:
secure: "d9Lws27Y4WkxV3PlRbACsBj2JIJNw5sNbDe0VZRXlQKFyWt3WO2gAR/+P+/dTnFu8XwD15XC7KL6BLPh2IFAv3YWK2Se/xGSsHSWgP8k+PVTn9t8Rs4Q0IcF3aJ8tzdqN0cY14+9yRN2w7HpJQripCjnZHIgbkgA3/rATtxbhG0="
install:
- npm install
- npm install -g bower broccoli-cli karma-cli
- bower install --config.interactive=false
script:
- BROCCOLI_ENV=production broccoli build release
- npm test
after_success: .travis/after_success
| Add GH_TOKEN for pushing to astrifex.github.io | Add GH_TOKEN for pushing to astrifex.github.io
| YAML | mit | astrifex/astrifex,astrifex/astrifex | yaml | ## Code Before:
language: node_js
node_js:
- 0.10
sudo: false
cache:
directories:
- bower_components
- node_modules
install:
- npm install
- npm install -g bower broccoli-cli karma-cli
- bower install --config.interactive=false
script:
- BROCCOLI_ENV=production broccoli build release
- npm test
after_success: .travis/after_success
## Instruction:
Add GH_TOKEN for pushing to astrifex.github.io
## Code After:
language: node_js
node_js:
- 0.10
sudo: false
cache:
directories:
- bower_components
- node_modules
env:
global:
secure: "d9Lws27Y4WkxV3PlRbACsBj2JIJNw5sNbDe0VZRXlQKFyWt3WO2gAR/+P+/dTnFu8XwD15XC7KL6BLPh2IFAv3YWK2Se/xGSsHSWgP8k+PVTn9t8Rs4Q0IcF3aJ8tzdqN0cY14+9yRN2w7HpJQripCjnZHIgbkgA3/rATtxbhG0="
install:
- npm install
- npm install -g bower broccoli-cli karma-cli
- bower install --config.interactive=false
script:
- BROCCOLI_ENV=production broccoli build release
- npm test
after_success: .travis/after_success
| language: node_js
node_js:
- 0.10
sudo: false
cache:
directories:
- bower_components
- node_modules
+ env:
+ global:
+ secure: "d9Lws27Y4WkxV3PlRbACsBj2JIJNw5sNbDe0VZRXlQKFyWt3WO2gAR/+P+/dTnFu8XwD15XC7KL6BLPh2IFAv3YWK2Se/xGSsHSWgP8k+PVTn9t8Rs4Q0IcF3aJ8tzdqN0cY14+9yRN2w7HpJQripCjnZHIgbkgA3/rATtxbhG0="
+
install:
- npm install
- npm install -g bower broccoli-cli karma-cli
- bower install --config.interactive=false
script:
- BROCCOLI_ENV=production broccoli build release
- npm test
after_success: .travis/after_success | 4 | 0.181818 | 4 | 0 |
07c8d79f1427751dea28007b2d10238b039485ec | src/gphoto2-sync.sh | src/gphoto2-sync.sh |
srcdir=`dirname $0`
# Get sources from gphoto2 SVN
WGET=`which wget`
if [ "x$WGET" != "x" ]; then
wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.c
mv tmpfile ptp.c.gphoto2
wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.h
mv tmpfile ptp.h.gphoto2
wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp-pack.c
mv tmpfile ptp-pack.c.gphoto2
wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/library.c
mv tmpfile library.c.gphoto2
else
echo "Could not sync to gphoto2. No WGET."
fi
echo "Finished!"
|
srcdir=`dirname $0`
# Get sources from gphoto2 SVN
WGET=`which wget`
if [ "x$WGET" != "x" ]; then
wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.c
mv tmpfile ptp.c.gphoto2
wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.h
mv tmpfile ptp.h.gphoto2
wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp-pack.c
mv tmpfile ptp-pack.c.gphoto2
wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/library.c
mv tmpfile library.c.gphoto2
else
echo "Could not sync to gphoto2. No WGET."
fi
echo "Finished!"
| Update script used for sync script to viewvc | Update script used for sync script to viewvc
| Shell | lgpl-2.1 | mmalecki/libmtp,reverendhomer/libmtp,libmtp/libmtp,Bluerise/libmtp,olunx/libmtp,yifanlu/libMTP,philipl/libmtp,vmandela/libmtp,reverendhomer/libmtp,Bluerise/libmtp,yifanlu/libMTP,vmandela/libmtp,olunx/libmtp,philipl/libmtp,pierrezurek/libmtp,reverendhomer/libmtp,philipl/libmtp,mmalecki/libmtp,jemc/libmtp,olunx/libmtp,kbhomes/libmtp-zune,kbhomes/libmtp-zune,libmtp/libmtp,jemc/libmtp,libmtp/libmtp,jemc/libmtp,reverendhomer/libmtp,pierrezurek/libmtp,mmalecki/libmtp,Bluerise/libmtp,jemc/libmtp | shell | ## Code Before:
srcdir=`dirname $0`
# Get sources from gphoto2 SVN
WGET=`which wget`
if [ "x$WGET" != "x" ]; then
wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.c
mv tmpfile ptp.c.gphoto2
wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.h
mv tmpfile ptp.h.gphoto2
wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp-pack.c
mv tmpfile ptp-pack.c.gphoto2
wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/library.c
mv tmpfile library.c.gphoto2
else
echo "Could not sync to gphoto2. No WGET."
fi
echo "Finished!"
## Instruction:
Update script used for sync script to viewvc
## Code After:
srcdir=`dirname $0`
# Get sources from gphoto2 SVN
WGET=`which wget`
if [ "x$WGET" != "x" ]; then
wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.c
mv tmpfile ptp.c.gphoto2
wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.h
mv tmpfile ptp.h.gphoto2
wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp-pack.c
mv tmpfile ptp-pack.c.gphoto2
wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/library.c
mv tmpfile library.c.gphoto2
else
echo "Could not sync to gphoto2. No WGET."
fi
echo "Finished!"
|
srcdir=`dirname $0`
# Get sources from gphoto2 SVN
WGET=`which wget`
if [ "x$WGET" != "x" ]; then
- wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.c
? ------
+ wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.c
? +++++++ +
mv tmpfile ptp.c.gphoto2
- wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.h
? ------
+ wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.h
? +++++++ +
mv tmpfile ptp.h.gphoto2
- wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp-pack.c
? ------
+ wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp-pack.c
? +++++++ +
mv tmpfile ptp-pack.c.gphoto2
- wget -O tmpfile http://svn.sourceforge.net/viewcvs.cgi/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/library.c
? ------
+ wget -O tmpfile http://gphoto.svn.sourceforge.net/viewvc/*checkout*/gphoto/trunk/libgphoto2/camlibs/ptp2/library.c
? +++++++ +
mv tmpfile library.c.gphoto2
else
echo "Could not sync to gphoto2. No WGET."
fi
echo "Finished!"
| 8 | 0.4 | 4 | 4 |
c0fa72095a90e885aae10dca6fe2bfbe172245f7 | super-super-release.sh | super-super-release.sh | gulp --env=production
git commit -am 'make dist/'
npm version patch
sh super-release.sh
| gulp --env=production
git add .
git commit -am 'make dist/'
npm version patch
sh super-release.sh
| Update super release with git add . | Update super release with git add .
| Shell | agpl-3.0 | ddmck/Quill-Grammar,empirical-org/Quill-Grammar,ddmck/Quill-Grammar,empirical-org/Quill-Grammar,ddmck/Quill-Grammar,empirical-org/Quill-Grammar | shell | ## Code Before:
gulp --env=production
git commit -am 'make dist/'
npm version patch
sh super-release.sh
## Instruction:
Update super release with git add .
## Code After:
gulp --env=production
git add .
git commit -am 'make dist/'
npm version patch
sh super-release.sh
| gulp --env=production
+ git add .
git commit -am 'make dist/'
npm version patch
sh super-release.sh | 1 | 0.25 | 1 | 0 |
b22c6affa2254429f0fbc46e443cacdcd1ebbc19 | zsh/prompt.zsh | zsh/prompt.zsh | PURE_CMD_MAX_EXEC_TIME=1
PROMPT='%(?.%F{green}.%F{red})❯%f '
| PURE_CMD_MAX_EXEC_TIME=1
PROMPT='%(?.%F{green}.%F{red})❯%f '
RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}' | Add k8s context to terminal | Add k8s context to terminal
| Shell | unknown | netalpha/dotfiles,netalpha/dotfiles,marceldiass/dotfiles,marceldiass/dotfiles | shell | ## Code Before:
PURE_CMD_MAX_EXEC_TIME=1
PROMPT='%(?.%F{green}.%F{red})❯%f '
## Instruction:
Add k8s context to terminal
## Code After:
PURE_CMD_MAX_EXEC_TIME=1
PROMPT='%(?.%F{green}.%F{red})❯%f '
RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}' | PURE_CMD_MAX_EXEC_TIME=1
PROMPT='%(?.%F{green}.%F{red})❯%f '
+ RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}' | 1 | 0.5 | 1 | 0 |
3cca173ec9f398db0b76e04848a98608367fb685 | README.md | README.md | - Develop modular and testable Node.js applications
- Separate configuration and implementation of modules
- Allow to define configurations depends on the environment
- Service container to use services from other modules or define own services in the modules
- Allow to mock standard libraries and services for testing modules as independent units
- Share: Publish own modules or use distributed modules from other developers
## Installation
- Fork and/or clone the skeleton repository
## Define new modules
- Add new file or directory to the module directory with the name of the new module, for example "./modules/module.js":
```javascript
/**
* Module for the application server
* @param services
* @param module
*/
module.exports = function(services, module) {
// Implementation for the module
};
```
- Add the configuration for the different environments, for example "./configs/development.js":
```javascript
/**
* Development configuration for the application server
* @type {{libraries: {}, directory: string, modules: {npm: {}, directory: {}}}}
*/
module.exports = {
libraries: {},
directory: './modules',
modules: {
npm: {},
directory: {
module: {
// Configuration for the module
}
}
}
};
```
## Define new environments
- Add new configuration with the environment name into the "./configs" directory
- Start the application with the new environment
```
NODE_ENV=environment npm start
```
| 
# DragonNodejs
- Develop modular and testable Node.js applications
- Separate configuration and implementation of modules
- Allow to define configurations depends on the environment
- Service container to use services from other modules or define own services in the modules
- Allow to mock standard libraries and services for testing modules as independent units
- Share: Publish own modules or use distributed modules from other developers
## Installation
- Fork and/or clone the skeleton repository
## Define new modules
- Add new file or directory to the module directory with the name of the new module, for example "./modules/module.js":
```javascript
/**
* Module for the application server
* @param services
* @param module
*/
module.exports = function(services, module) {
// Implementation for the module
};
```
- Add the configuration for the different environments, for example "./configs/development.js":
```javascript
/**
* Development configuration for the application server
* @type {{libraries: {}, directory: string, modules: {npm: {}, directory: {}}}}
*/
module.exports = {
libraries: {},
directory: './modules',
modules: {
npm: {},
directory: {
module: {
// Configuration for the module
}
}
}
};
```
## Define new environments
- Add new configuration with the environment name into the "./configs" directory
- Start the application with the new environment
```
NODE_ENV=environment npm start
```
| Add Travis CI image for the current state | Add Travis CI image for the current state
| Markdown | mit | dragonnodejs/app-skeleton | markdown | ## Code Before:
- Develop modular and testable Node.js applications
- Separate configuration and implementation of modules
- Allow to define configurations depends on the environment
- Service container to use services from other modules or define own services in the modules
- Allow to mock standard libraries and services for testing modules as independent units
- Share: Publish own modules or use distributed modules from other developers
## Installation
- Fork and/or clone the skeleton repository
## Define new modules
- Add new file or directory to the module directory with the name of the new module, for example "./modules/module.js":
```javascript
/**
* Module for the application server
* @param services
* @param module
*/
module.exports = function(services, module) {
// Implementation for the module
};
```
- Add the configuration for the different environments, for example "./configs/development.js":
```javascript
/**
* Development configuration for the application server
* @type {{libraries: {}, directory: string, modules: {npm: {}, directory: {}}}}
*/
module.exports = {
libraries: {},
directory: './modules',
modules: {
npm: {},
directory: {
module: {
// Configuration for the module
}
}
}
};
```
## Define new environments
- Add new configuration with the environment name into the "./configs" directory
- Start the application with the new environment
```
NODE_ENV=environment npm start
```
## Instruction:
Add Travis CI image for the current state
## Code After:

# DragonNodejs
- Develop modular and testable Node.js applications
- Separate configuration and implementation of modules
- Allow to define configurations depends on the environment
- Service container to use services from other modules or define own services in the modules
- Allow to mock standard libraries and services for testing modules as independent units
- Share: Publish own modules or use distributed modules from other developers
## Installation
- Fork and/or clone the skeleton repository
## Define new modules
- Add new file or directory to the module directory with the name of the new module, for example "./modules/module.js":
```javascript
/**
* Module for the application server
* @param services
* @param module
*/
module.exports = function(services, module) {
// Implementation for the module
};
```
- Add the configuration for the different environments, for example "./configs/development.js":
```javascript
/**
* Development configuration for the application server
* @type {{libraries: {}, directory: string, modules: {npm: {}, directory: {}}}}
*/
module.exports = {
libraries: {},
directory: './modules',
modules: {
npm: {},
directory: {
module: {
// Configuration for the module
}
}
}
};
```
## Define new environments
- Add new configuration with the environment name into the "./configs" directory
- Start the application with the new environment
```
NODE_ENV=environment npm start
```
| + 
+
+ # DragonNodejs
- Develop modular and testable Node.js applications
- Separate configuration and implementation of modules
- Allow to define configurations depends on the environment
- Service container to use services from other modules or define own services in the modules
- Allow to mock standard libraries and services for testing modules as independent units
- Share: Publish own modules or use distributed modules from other developers
## Installation
- Fork and/or clone the skeleton repository
## Define new modules
- Add new file or directory to the module directory with the name of the new module, for example "./modules/module.js":
```javascript
/**
* Module for the application server
* @param services
* @param module
*/
module.exports = function(services, module) {
// Implementation for the module
};
```
- Add the configuration for the different environments, for example "./configs/development.js":
```javascript
/**
* Development configuration for the application server
* @type {{libraries: {}, directory: string, modules: {npm: {}, directory: {}}}}
*/
module.exports = {
libraries: {},
directory: './modules',
modules: {
npm: {},
directory: {
module: {
// Configuration for the module
}
}
}
};
```
## Define new environments
- Add new configuration with the environment name into the "./configs" directory
- Start the application with the new environment
```
NODE_ENV=environment npm start
``` | 3 | 0.0625 | 3 | 0 |
bc62204ebf9a5c584210d354c78ddae1b9384c73 | demo/UserDAO.js | demo/UserDAO.js | "use strict";
var loki = require('lokijs');
var _ = require('lodash');
var Q = require('q');
// variable to hold the singleton instance, if used in that manner
var userDAOInstance = undefined;
//
// User Data Access Object
//
// Constructor
function UserDAO(dbName) {
// Define database name
dbName = (dbName != '') ? dbName : 'janux.people.db';
// Create db
this._db = new loki(dbName);
// Add users collection
this._users = this._db.addCollection('users');
}
// Get User Object by id
UserDAO.prototype.getUserById = function (userId, callback) {
return Q.when( this._users.findOne( { userId:userId } ) );
};
// Get User Object by username
UserDAO.prototype.getUserByName = function (userName) {
return Q.when( this._users.findOne( { username:userName } ) );
};
// Add new User Object
UserDAO.prototype.addUser = function (aUserObj) {
this._users.insert(aUserObj);
};
exports.createInstance = function() {
return new UserDAO();
};
exports.singleton = function() {
// if the singleton has not yet been instantiated, do so
if ( !_.isObject(userDAOInstance) ) {
userDAOInstance = new UserDAO();
}
return userDAOInstance;
}; | "use strict";
var loki = require('lokijs');
var _ = require('lodash');
var Promise = require('bluebird');
// variable to hold the singleton instance, if used in that manner
var userDAOInstance = undefined;
//
// User Data Access Object
//
// Constructor
function UserDAO(dbName) {
// Define database name
dbName = (dbName != '') ? dbName : 'janux.people.db';
// Create db
this._db = new loki(dbName);
// Add users collection
this._users = this._db.addCollection('users');
}
// Get User Object by id
UserDAO.prototype.findUserById = function (userId, callback) {
var users = this._users.findOne( { userId:userId });
return new Promise(function(resolve){
resolve( users );
}).asCallback(callback);
};
// Get User Object by username
UserDAO.prototype.findUserByName = function (userName, callback) {
var users = this._users.findOne( { username:userName } );
return new Promise(function(resolve){
resolve( users );
}).asCallback(callback);
};
// Add new User Object
UserDAO.prototype.addUser = function (aUserObj) {
this._users.insert(aUserObj);
};
exports.createInstance = function() {
return new UserDAO();
};
exports.singleton = function() {
// if the singleton has not yet been instantiated, do so
if ( !_.isObject(userDAOInstance) ) {
userDAOInstance = new UserDAO();
}
return userDAOInstance;
}; | Implement bluebird instead of Q inside demo userDAO | Implement bluebird instead of Q inside demo userDAO
| JavaScript | mit | janux/janux-people.js,janux/janux-people.js | javascript | ## Code Before:
"use strict";
var loki = require('lokijs');
var _ = require('lodash');
var Q = require('q');
// variable to hold the singleton instance, if used in that manner
var userDAOInstance = undefined;
//
// User Data Access Object
//
// Constructor
function UserDAO(dbName) {
// Define database name
dbName = (dbName != '') ? dbName : 'janux.people.db';
// Create db
this._db = new loki(dbName);
// Add users collection
this._users = this._db.addCollection('users');
}
// Get User Object by id
UserDAO.prototype.getUserById = function (userId, callback) {
return Q.when( this._users.findOne( { userId:userId } ) );
};
// Get User Object by username
UserDAO.prototype.getUserByName = function (userName) {
return Q.when( this._users.findOne( { username:userName } ) );
};
// Add new User Object
UserDAO.prototype.addUser = function (aUserObj) {
this._users.insert(aUserObj);
};
exports.createInstance = function() {
return new UserDAO();
};
exports.singleton = function() {
// if the singleton has not yet been instantiated, do so
if ( !_.isObject(userDAOInstance) ) {
userDAOInstance = new UserDAO();
}
return userDAOInstance;
};
## Instruction:
Implement bluebird instead of Q inside demo userDAO
## Code After:
"use strict";
var loki = require('lokijs');
var _ = require('lodash');
var Promise = require('bluebird');
// variable to hold the singleton instance, if used in that manner
var userDAOInstance = undefined;
//
// User Data Access Object
//
// Constructor
function UserDAO(dbName) {
// Define database name
dbName = (dbName != '') ? dbName : 'janux.people.db';
// Create db
this._db = new loki(dbName);
// Add users collection
this._users = this._db.addCollection('users');
}
// Get User Object by id
UserDAO.prototype.findUserById = function (userId, callback) {
var users = this._users.findOne( { userId:userId });
return new Promise(function(resolve){
resolve( users );
}).asCallback(callback);
};
// Get User Object by username
UserDAO.prototype.findUserByName = function (userName, callback) {
var users = this._users.findOne( { username:userName } );
return new Promise(function(resolve){
resolve( users );
}).asCallback(callback);
};
// Add new User Object
UserDAO.prototype.addUser = function (aUserObj) {
this._users.insert(aUserObj);
};
exports.createInstance = function() {
return new UserDAO();
};
exports.singleton = function() {
// if the singleton has not yet been instantiated, do so
if ( !_.isObject(userDAOInstance) ) {
userDAOInstance = new UserDAO();
}
return userDAOInstance;
}; | "use strict";
var loki = require('lokijs');
var _ = require('lodash');
- var Q = require('q');
+ var Promise = require('bluebird');
// variable to hold the singleton instance, if used in that manner
var userDAOInstance = undefined;
//
// User Data Access Object
//
// Constructor
function UserDAO(dbName) {
// Define database name
dbName = (dbName != '') ? dbName : 'janux.people.db';
// Create db
this._db = new loki(dbName);
// Add users collection
this._users = this._db.addCollection('users');
}
// Get User Object by id
- UserDAO.prototype.getUserById = function (userId, callback) {
? ^^^
+ UserDAO.prototype.findUserById = function (userId, callback) {
? ^^^^
+
- return Q.when( this._users.findOne( { userId:userId } ) );
? -- ^ ^^^^^^^ ---
+ var users = this._users.findOne( { userId:userId });
? ++ +++ ^ ^
+ return new Promise(function(resolve){
+ resolve( users );
+ }).asCallback(callback);
};
// Get User Object by username
- UserDAO.prototype.getUserByName = function (userName) {
? ^^^
+ UserDAO.prototype.findUserByName = function (userName, callback) {
? ^^^^ ++++++++++
+
- return Q.when( this._users.findOne( { username:userName } ) );
? -- ^ ^^^^^^^ --
+ var users = this._users.findOne( { username:userName } );
? ++ +++ ^ ^
+ return new Promise(function(resolve){
+ resolve( users );
+ }).asCallback(callback);
};
// Add new User Object
UserDAO.prototype.addUser = function (aUserObj) {
this._users.insert(aUserObj);
};
exports.createInstance = function() {
return new UserDAO();
};
exports.singleton = function() {
// if the singleton has not yet been instantiated, do so
if ( !_.isObject(userDAOInstance) ) {
userDAOInstance = new UserDAO();
}
return userDAOInstance;
}; | 18 | 0.36 | 13 | 5 |
e6ff5ebf48f88d5a66c357c2b081a6dd7dbf19d5 | package.json | package.json | {
"name": "@sanity/storybook",
"version": "1.0.10",
"description": "Sanity wrapper for Kadira's Storybook",
"main": "index.js",
"author": "Sanity.io <hello@sanity.io>",
"license": "MIT",
"scripts": {
"prepublish": "npm run test",
"test": "eslint ."
},
"keywords": [
"sanity"
],
"dependencies": {
"@kadira/storybook": "^1.36.0",
"@sanity/react-storybook-addon-info": "^3.1.3",
"express": "^4.14.0",
"in-publish": "^2.0.0"
},
"peerDependencies": {
"@sanity/server": "^1.2.28"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.12.0",
"eslint-config-sanity": "^1.1.1"
},
"repository": {
"type": "git",
"url": "git@github.com:sanity-io/storybook.git"
}
}
| {
"name": "@sanity/storybook",
"version": "1.0.10",
"description": "Sanity wrapper for Kadira's Storybook",
"main": "index.js",
"author": "Sanity.io <hello@sanity.io>",
"license": "MIT",
"scripts": {
"prepublish": "npm run test",
"test": "eslint ."
},
"keywords": [
"sanity"
],
"dependencies": {
"@kadira/storybook": "^1.36.0",
"@sanity/react-storybook-addon-info": "^3.1.3",
"express": "^4.14.0",
"in-publish": "^2.0.0"
},
"peerDependencies": {
"@sanity/server": "^1.2.28"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"babel-preset-react-hmre": "^1.1.1",
"eslint": "^2.12.0",
"eslint-config-sanity": "^1.1.1"
},
"repository": {
"type": "git",
"url": "git@github.com:sanity-io/storybook.git"
}
}
| Add hmre preset to dev dependencies | Add hmre preset to dev dependencies
| JSON | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity | json | ## Code Before:
{
"name": "@sanity/storybook",
"version": "1.0.10",
"description": "Sanity wrapper for Kadira's Storybook",
"main": "index.js",
"author": "Sanity.io <hello@sanity.io>",
"license": "MIT",
"scripts": {
"prepublish": "npm run test",
"test": "eslint ."
},
"keywords": [
"sanity"
],
"dependencies": {
"@kadira/storybook": "^1.36.0",
"@sanity/react-storybook-addon-info": "^3.1.3",
"express": "^4.14.0",
"in-publish": "^2.0.0"
},
"peerDependencies": {
"@sanity/server": "^1.2.28"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.12.0",
"eslint-config-sanity": "^1.1.1"
},
"repository": {
"type": "git",
"url": "git@github.com:sanity-io/storybook.git"
}
}
## Instruction:
Add hmre preset to dev dependencies
## Code After:
{
"name": "@sanity/storybook",
"version": "1.0.10",
"description": "Sanity wrapper for Kadira's Storybook",
"main": "index.js",
"author": "Sanity.io <hello@sanity.io>",
"license": "MIT",
"scripts": {
"prepublish": "npm run test",
"test": "eslint ."
},
"keywords": [
"sanity"
],
"dependencies": {
"@kadira/storybook": "^1.36.0",
"@sanity/react-storybook-addon-info": "^3.1.3",
"express": "^4.14.0",
"in-publish": "^2.0.0"
},
"peerDependencies": {
"@sanity/server": "^1.2.28"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"babel-preset-react-hmre": "^1.1.1",
"eslint": "^2.12.0",
"eslint-config-sanity": "^1.1.1"
},
"repository": {
"type": "git",
"url": "git@github.com:sanity-io/storybook.git"
}
}
| {
"name": "@sanity/storybook",
"version": "1.0.10",
"description": "Sanity wrapper for Kadira's Storybook",
"main": "index.js",
"author": "Sanity.io <hello@sanity.io>",
"license": "MIT",
"scripts": {
"prepublish": "npm run test",
"test": "eslint ."
},
"keywords": [
"sanity"
],
"dependencies": {
"@kadira/storybook": "^1.36.0",
"@sanity/react-storybook-addon-info": "^3.1.3",
"express": "^4.14.0",
"in-publish": "^2.0.0"
},
"peerDependencies": {
"@sanity/server": "^1.2.28"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
+ "babel-preset-react-hmre": "^1.1.1",
"eslint": "^2.12.0",
"eslint-config-sanity": "^1.1.1"
},
"repository": {
"type": "git",
"url": "git@github.com:sanity-io/storybook.git"
}
} | 1 | 0.030303 | 1 | 0 |
0db1eb56523929e74b9cdbcf44b6292f46e6f3b3 | build-scripts/showrev.sh | build-scripts/showrev.sh | hg tip --template 'hg-{rev}:{node|short}' || echo "hg-0:baadf00d"
| hg tip --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1)
| Return an error code if Mercurial isn't installed | Return an error code if Mercurial isn't installed
| Shell | lgpl-2.1 | cebash/SDL_PSL1GHT,cebash/SDL_PSL1GHT,aduros/SDL,aduros/SDL,cebash/SDL_PSL1GHT,aduros/SDL,cebash/SDL_PSL1GHT,aduros/SDL,cebash/SDL_PSL1GHT,aduros/SDL | shell | ## Code Before:
hg tip --template 'hg-{rev}:{node|short}' || echo "hg-0:baadf00d"
## Instruction:
Return an error code if Mercurial isn't installed
## Code After:
hg tip --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1)
| - hg tip --template 'hg-{rev}:{node|short}' || echo "hg-0:baadf00d"
+ hg tip --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1)
? + +++++++++
| 2 | 2 | 1 | 1 |
d1e6ebef7bac7e1a94bf4119e489d558cc5e650c | roles/slurm_rpms/tasks/main.yml | roles/slurm_rpms/tasks/main.yml | ---
- name: build slurm RPM files
become: true
block:
- name: install development tools
dnf:
name: "@Development Tools"
- name: install slurm build requirements
dnf:
name:
- hwloc
- hwloc-devel
- libibmad
- libibumad
- lua
- lua-devel
- man2html
- mariadb-server
- mariadb-devel
- munge-devel
- ncurses-devel
- numactl
- numactl-devel
- openssl
- openssl-devel
- pam-devel
- perl-devel
- readline-devel
- rpm-build
- rrdtool-devel
- name: create temporary build directory
file:
path: "{{ slurmbuilddir }}"
state: directory
- name: fetch slurm source files
get_url:
url: "https://download.schedmd.com/slurm/slurm-20.02.2.tar.bz2"
dest: "{{ slurmbuilddir }}/slurm-20.02.2.tar.bz2"
- name: build slurm rpm file
command:
cmd: rpmbuild -ta slurm-20.02.2.tar.bz2
chdir: "{{ slurmbuilddir }}"
creates: "{{ slurmbuilddir }}/rpmbuild/" | ---
- name: build slurm RPM files
become: true
block:
- name: install development tools
dnf:
update_cache: yes
name: "@Development Tools"
- name: install slurm build requirements
dnf:
name:
- hwloc
- hwloc-devel
- libibmad
- libibumad
- lua
- lua-devel
- man2html
- mariadb-server
- mariadb-devel
- munge-devel
- ncurses-devel
- numactl
- numactl-devel
- openssl
- openssl-devel
- pam-devel
- perl-devel
- readline-devel
- rpm-build
- rrdtool-devel
- name: create temporary build directory
file:
path: "{{ slurmbuilddir }}"
state: directory
- name: fetch slurm source files
get_url:
url: "https://download.schedmd.com/slurm/slurm-20.02.2.tar.bz2"
dest: "{{ slurmbuilddir }}/slurm-20.02.2.tar.bz2"
- name: build slurm rpm file
command:
cmd: rpmbuild -ta slurm-20.02.2.tar.bz2
chdir: "{{ slurmbuilddir }}"
creates: "{{ slurmbuilddir }}/rpmbuild/" | Update dnf cache before installing packages with ansible. | Update dnf cache before installing packages with ansible.
| YAML | bsd-3-clause | cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive | yaml | ## Code Before:
---
- name: build slurm RPM files
become: true
block:
- name: install development tools
dnf:
name: "@Development Tools"
- name: install slurm build requirements
dnf:
name:
- hwloc
- hwloc-devel
- libibmad
- libibumad
- lua
- lua-devel
- man2html
- mariadb-server
- mariadb-devel
- munge-devel
- ncurses-devel
- numactl
- numactl-devel
- openssl
- openssl-devel
- pam-devel
- perl-devel
- readline-devel
- rpm-build
- rrdtool-devel
- name: create temporary build directory
file:
path: "{{ slurmbuilddir }}"
state: directory
- name: fetch slurm source files
get_url:
url: "https://download.schedmd.com/slurm/slurm-20.02.2.tar.bz2"
dest: "{{ slurmbuilddir }}/slurm-20.02.2.tar.bz2"
- name: build slurm rpm file
command:
cmd: rpmbuild -ta slurm-20.02.2.tar.bz2
chdir: "{{ slurmbuilddir }}"
creates: "{{ slurmbuilddir }}/rpmbuild/"
## Instruction:
Update dnf cache before installing packages with ansible.
## Code After:
---
- name: build slurm RPM files
become: true
block:
- name: install development tools
dnf:
update_cache: yes
name: "@Development Tools"
- name: install slurm build requirements
dnf:
name:
- hwloc
- hwloc-devel
- libibmad
- libibumad
- lua
- lua-devel
- man2html
- mariadb-server
- mariadb-devel
- munge-devel
- ncurses-devel
- numactl
- numactl-devel
- openssl
- openssl-devel
- pam-devel
- perl-devel
- readline-devel
- rpm-build
- rrdtool-devel
- name: create temporary build directory
file:
path: "{{ slurmbuilddir }}"
state: directory
- name: fetch slurm source files
get_url:
url: "https://download.schedmd.com/slurm/slurm-20.02.2.tar.bz2"
dest: "{{ slurmbuilddir }}/slurm-20.02.2.tar.bz2"
- name: build slurm rpm file
command:
cmd: rpmbuild -ta slurm-20.02.2.tar.bz2
chdir: "{{ slurmbuilddir }}"
creates: "{{ slurmbuilddir }}/rpmbuild/" | ---
- name: build slurm RPM files
become: true
block:
- name: install development tools
dnf:
+ update_cache: yes
name: "@Development Tools"
- name: install slurm build requirements
dnf:
name:
- hwloc
- hwloc-devel
- libibmad
- libibumad
- lua
- lua-devel
- man2html
- mariadb-server
- mariadb-devel
- munge-devel
- ncurses-devel
- numactl
- numactl-devel
- openssl
- openssl-devel
- pam-devel
- perl-devel
- readline-devel
- rpm-build
- rrdtool-devel
- name: create temporary build directory
file:
path: "{{ slurmbuilddir }}"
state: directory
- name: fetch slurm source files
get_url:
url: "https://download.schedmd.com/slurm/slurm-20.02.2.tar.bz2"
dest: "{{ slurmbuilddir }}/slurm-20.02.2.tar.bz2"
- name: build slurm rpm file
command:
cmd: rpmbuild -ta slurm-20.02.2.tar.bz2
chdir: "{{ slurmbuilddir }}"
creates: "{{ slurmbuilddir }}/rpmbuild/" | 1 | 0.022727 | 1 | 0 |
2552fc940a02e1d1aca1578044bf83dac559d2b9 | 3-way-merge/README.md | 3-way-merge/README.md | Run ./setup.sh && cd exercise
## The task
You again live in your own branch, this time we will be doing a bit of juggling with branches, to show how lightweight branches are in git.
1. Create a branch called greeting and check it out
1. Edit the greeting.txt to contain an oslo-specific greeting
1. Add greeting.txt files to staging area using patch mode
1. Commit
1. Switch back to the master branch
1. Create a file README.md with information about this repository
1. Try adding README.md file to staging area using patch mode (it wont work)
1. What is the output of `git status`?
1. Add the README.md file to staging area and make the commit
1. What is the output of `git log --oneline --decorate --graph --all`
1. Diff the branches
1. Merge the greeting branch into master
## Useful commands
- `git branch`
- `git branch <branch-name>`
- `git branch -d <branch-name>`
- `git checkout <branch-name>`
- `git checkout -b <branch-name>`
- `git branch -v`
- `git add`
- `git add -p`
- `git commit`
- `git commit -m`
- `git merge <branchA> <branchB>`
- `git diff <branchA> <branchB>`
- `git log --oneline --decorate --graph --all`
| Run ./setup.sh && cd exercise
## The task
You again live in your own branch, this time we will be doing a bit of juggling with branches, to show how lightweight branches are in git.
1. Create a branch called greeting and check it out
1. Edit the greeting.txt to contain your favorite greeting
1. Add greeting.txt files to staging area using patch mode
1. Commit
1. Switch back to the master branch
1. Create a file README.md with information about this repository
1. Try adding README.md file to staging area using patch mode (it wont work)
1. What is the output of `git status`?
1. Add the README.md file to staging area and make the commit
1. What is the output of `git log --oneline --decorate --graph --all`?
1. Diff the branches
1. Merge the greeting branch into master
## Useful commands
- `git branch`
- `git branch <branch-name>`
- `git branch -d <branch-name>`
- `git checkout <branch-name>`
- `git checkout -b <branch-name>`
- `git branch -v`
- `git add`
- `git add -p`
- `git commit`
- `git commit -m`
- `git merge <branchA> <branchB>`
- `git diff <branchA> <branchB>`
- `git log --oneline --decorate --graph --all`
| Make 3-way exercise text more generic | Make 3-way exercise text more generic
| Markdown | mit | praqma-training/gitkatas,praqma-training/gitkatas | markdown | ## Code Before:
Run ./setup.sh && cd exercise
## The task
You again live in your own branch, this time we will be doing a bit of juggling with branches, to show how lightweight branches are in git.
1. Create a branch called greeting and check it out
1. Edit the greeting.txt to contain an oslo-specific greeting
1. Add greeting.txt files to staging area using patch mode
1. Commit
1. Switch back to the master branch
1. Create a file README.md with information about this repository
1. Try adding README.md file to staging area using patch mode (it wont work)
1. What is the output of `git status`?
1. Add the README.md file to staging area and make the commit
1. What is the output of `git log --oneline --decorate --graph --all`
1. Diff the branches
1. Merge the greeting branch into master
## Useful commands
- `git branch`
- `git branch <branch-name>`
- `git branch -d <branch-name>`
- `git checkout <branch-name>`
- `git checkout -b <branch-name>`
- `git branch -v`
- `git add`
- `git add -p`
- `git commit`
- `git commit -m`
- `git merge <branchA> <branchB>`
- `git diff <branchA> <branchB>`
- `git log --oneline --decorate --graph --all`
## Instruction:
Make 3-way exercise text more generic
## Code After:
Run ./setup.sh && cd exercise
## The task
You again live in your own branch, this time we will be doing a bit of juggling with branches, to show how lightweight branches are in git.
1. Create a branch called greeting and check it out
1. Edit the greeting.txt to contain your favorite greeting
1. Add greeting.txt files to staging area using patch mode
1. Commit
1. Switch back to the master branch
1. Create a file README.md with information about this repository
1. Try adding README.md file to staging area using patch mode (it wont work)
1. What is the output of `git status`?
1. Add the README.md file to staging area and make the commit
1. What is the output of `git log --oneline --decorate --graph --all`?
1. Diff the branches
1. Merge the greeting branch into master
## Useful commands
- `git branch`
- `git branch <branch-name>`
- `git branch -d <branch-name>`
- `git checkout <branch-name>`
- `git checkout -b <branch-name>`
- `git branch -v`
- `git add`
- `git add -p`
- `git commit`
- `git commit -m`
- `git merge <branchA> <branchB>`
- `git diff <branchA> <branchB>`
- `git log --oneline --decorate --graph --all`
| Run ./setup.sh && cd exercise
## The task
You again live in your own branch, this time we will be doing a bit of juggling with branches, to show how lightweight branches are in git.
1. Create a branch called greeting and check it out
- 1. Edit the greeting.txt to contain an oslo-specific greeting
? ^^ ^^^^^^ -----
+ 1. Edit the greeting.txt to contain your favorite greeting
? ++++++ ^ ^^^
1. Add greeting.txt files to staging area using patch mode
1. Commit
1. Switch back to the master branch
1. Create a file README.md with information about this repository
1. Try adding README.md file to staging area using patch mode (it wont work)
1. What is the output of `git status`?
1. Add the README.md file to staging area and make the commit
- 1. What is the output of `git log --oneline --decorate --graph --all`
+ 1. What is the output of `git log --oneline --decorate --graph --all`?
? +
1. Diff the branches
1. Merge the greeting branch into master
## Useful commands
- `git branch`
- `git branch <branch-name>`
- `git branch -d <branch-name>`
- `git checkout <branch-name>`
- `git checkout -b <branch-name>`
- `git branch -v`
- `git add`
- `git add -p`
- `git commit`
- `git commit -m`
- `git merge <branchA> <branchB>`
- `git diff <branchA> <branchB>`
- `git log --oneline --decorate --graph --all` | 4 | 0.121212 | 2 | 2 |
f371c34d37a326278f8e348b8e3abc1a9fe2a765 | .github/PULL_REQUEST_TEMPLATE.md | .github/PULL_REQUEST_TEMPLATE.md | Jira: KBC-XXX
Before asking for review make sure that:
- [ ] New client method(s) has tests
- [ ] Apiary file is updated
- [ ] You declared if there is a BC break or not (will affect next release of a client)
---
| Jira: KBC-XXX
Before asking for review make sure that:
## Checklist
- [ ] New client method(s) has tests
- [ ] Apiary file is updated
## Release
- [ ] major (BC break)
- [ ] minor (new feature)
- [ ] patch (backwards compatible fix)
- [ ] no release (just test changes)
| Make it obvious what should be released | Make it obvious what should be released | Markdown | mit | keboola/storage-api-php-client,keboola/storage-api-php-client | markdown | ## Code Before:
Jira: KBC-XXX
Before asking for review make sure that:
- [ ] New client method(s) has tests
- [ ] Apiary file is updated
- [ ] You declared if there is a BC break or not (will affect next release of a client)
---
## Instruction:
Make it obvious what should be released
## Code After:
Jira: KBC-XXX
Before asking for review make sure that:
## Checklist
- [ ] New client method(s) has tests
- [ ] Apiary file is updated
## Release
- [ ] major (BC break)
- [ ] minor (new feature)
- [ ] patch (backwards compatible fix)
- [ ] no release (just test changes)
| Jira: KBC-XXX
Before asking for review make sure that:
+ ## Checklist
+
- [ ] New client method(s) has tests
- [ ] Apiary file is updated
- - [ ] You declared if there is a BC break or not (will affect next release of a client)
- ---
+ ## Release
+
+ - [ ] major (BC break)
+ - [ ] minor (new feature)
+ - [ ] patch (backwards compatible fix)
+ - [ ] no release (just test changes) | 10 | 1.111111 | 8 | 2 |
7cb0acc985ccb49c65c0529dab1d111165e8a1b9 | lib/geocoder/lookups/nominatim.rb | lib/geocoder/lookups/nominatim.rb | require 'geocoder/lookups/base'
require "geocoder/results/nominatim"
module Geocoder::Lookup
class Nominatim < Base
def name
"Nominatim"
end
def map_link_url(coordinates)
"http://www.openstreetmap.org/?lat=#{coordinates[0]}&lon=#{coordinates[1]}&zoom=15&layers=M"
end
def query_url(query)
method = query.reverse_geocode? ? "reverse" : "search"
host = configuration[:host] || "nominatim.openstreetmap.org"
"#{protocol}://#{host}/#{method}?" + url_query_string(query)
end
private # ---------------------------------------------------------------
def results(query)
return [] unless doc = fetch_data(query)
doc.is_a?(Array) ? doc : [doc]
end
def parse_raw_data(raw_data)
if raw_data.include?("Bandwidth limit exceeded")
raise_error(Geocoder::OverQueryLimitError) || Geocoder.log(:warn, "Over API query limit.")
else
super(raw_data)
end
end
def query_url_params(query)
params = {
:format => "json",
:addressdetails => "1",
:"accept-language" => (query.language || configuration.language)
}.merge(super)
if query.reverse_geocode?
lat,lon = query.coordinates
params[:lat] = lat
params[:lon] = lon
else
params[:q] = query.sanitized_text
end
params
end
end
end
| require 'geocoder/lookups/base'
require "geocoder/results/nominatim"
module Geocoder::Lookup
class Nominatim < Base
def name
"Nominatim"
end
def map_link_url(coordinates)
"https://www.openstreetmap.org/?lat=#{coordinates[0]}&lon=#{coordinates[1]}&zoom=15&layers=M"
end
def query_url(query)
method = query.reverse_geocode? ? "reverse" : "search"
host = configuration[:host] || "nominatim.openstreetmap.org"
"#{protocol}://#{host}/#{method}?" + url_query_string(query)
end
def supported_protocols
[:https]
end
private # ---------------------------------------------------------------
def results(query)
return [] unless doc = fetch_data(query)
doc.is_a?(Array) ? doc : [doc]
end
def parse_raw_data(raw_data)
if raw_data.include?("Bandwidth limit exceeded")
raise_error(Geocoder::OverQueryLimitError) || Geocoder.log(:warn, "Over API query limit.")
else
super(raw_data)
end
end
def query_url_params(query)
params = {
:format => "json",
:addressdetails => "1",
:"accept-language" => (query.language || configuration.language)
}.merge(super)
if query.reverse_geocode?
lat,lon = query.coordinates
params[:lat] = lat
params[:lon] = lon
else
params[:q] = query.sanitized_text
end
params
end
end
end
| Use HTTPS for all Nominatim requests. | Use HTTPS for all Nominatim requests.
HTTP support will be discontinued according to this:
https://lists.openstreetmap.org/pipermail/geocoding/2018-January/001918.html
Fixes #1267
| Ruby | mit | aceunreal/geocoder,alexreisner/geocoder,Devetzis/geocoder,tiramizoo/geocoder,rdlugosz/geocoder,ankane/geocoder | ruby | ## Code Before:
require 'geocoder/lookups/base'
require "geocoder/results/nominatim"
module Geocoder::Lookup
class Nominatim < Base
def name
"Nominatim"
end
def map_link_url(coordinates)
"http://www.openstreetmap.org/?lat=#{coordinates[0]}&lon=#{coordinates[1]}&zoom=15&layers=M"
end
def query_url(query)
method = query.reverse_geocode? ? "reverse" : "search"
host = configuration[:host] || "nominatim.openstreetmap.org"
"#{protocol}://#{host}/#{method}?" + url_query_string(query)
end
private # ---------------------------------------------------------------
def results(query)
return [] unless doc = fetch_data(query)
doc.is_a?(Array) ? doc : [doc]
end
def parse_raw_data(raw_data)
if raw_data.include?("Bandwidth limit exceeded")
raise_error(Geocoder::OverQueryLimitError) || Geocoder.log(:warn, "Over API query limit.")
else
super(raw_data)
end
end
def query_url_params(query)
params = {
:format => "json",
:addressdetails => "1",
:"accept-language" => (query.language || configuration.language)
}.merge(super)
if query.reverse_geocode?
lat,lon = query.coordinates
params[:lat] = lat
params[:lon] = lon
else
params[:q] = query.sanitized_text
end
params
end
end
end
## Instruction:
Use HTTPS for all Nominatim requests.
HTTP support will be discontinued according to this:
https://lists.openstreetmap.org/pipermail/geocoding/2018-January/001918.html
Fixes #1267
## Code After:
require 'geocoder/lookups/base'
require "geocoder/results/nominatim"
module Geocoder::Lookup
class Nominatim < Base
def name
"Nominatim"
end
def map_link_url(coordinates)
"https://www.openstreetmap.org/?lat=#{coordinates[0]}&lon=#{coordinates[1]}&zoom=15&layers=M"
end
def query_url(query)
method = query.reverse_geocode? ? "reverse" : "search"
host = configuration[:host] || "nominatim.openstreetmap.org"
"#{protocol}://#{host}/#{method}?" + url_query_string(query)
end
def supported_protocols
[:https]
end
private # ---------------------------------------------------------------
def results(query)
return [] unless doc = fetch_data(query)
doc.is_a?(Array) ? doc : [doc]
end
def parse_raw_data(raw_data)
if raw_data.include?("Bandwidth limit exceeded")
raise_error(Geocoder::OverQueryLimitError) || Geocoder.log(:warn, "Over API query limit.")
else
super(raw_data)
end
end
def query_url_params(query)
params = {
:format => "json",
:addressdetails => "1",
:"accept-language" => (query.language || configuration.language)
}.merge(super)
if query.reverse_geocode?
lat,lon = query.coordinates
params[:lat] = lat
params[:lon] = lon
else
params[:q] = query.sanitized_text
end
params
end
end
end
| require 'geocoder/lookups/base'
require "geocoder/results/nominatim"
module Geocoder::Lookup
class Nominatim < Base
def name
"Nominatim"
end
def map_link_url(coordinates)
- "http://www.openstreetmap.org/?lat=#{coordinates[0]}&lon=#{coordinates[1]}&zoom=15&layers=M"
+ "https://www.openstreetmap.org/?lat=#{coordinates[0]}&lon=#{coordinates[1]}&zoom=15&layers=M"
? +
end
def query_url(query)
method = query.reverse_geocode? ? "reverse" : "search"
host = configuration[:host] || "nominatim.openstreetmap.org"
"#{protocol}://#{host}/#{method}?" + url_query_string(query)
+ end
+
+ def supported_protocols
+ [:https]
end
private # ---------------------------------------------------------------
def results(query)
return [] unless doc = fetch_data(query)
doc.is_a?(Array) ? doc : [doc]
end
def parse_raw_data(raw_data)
if raw_data.include?("Bandwidth limit exceeded")
raise_error(Geocoder::OverQueryLimitError) || Geocoder.log(:warn, "Over API query limit.")
else
super(raw_data)
end
end
def query_url_params(query)
params = {
:format => "json",
:addressdetails => "1",
:"accept-language" => (query.language || configuration.language)
}.merge(super)
if query.reverse_geocode?
lat,lon = query.coordinates
params[:lat] = lat
params[:lon] = lon
else
params[:q] = query.sanitized_text
end
params
end
end
end | 6 | 0.115385 | 5 | 1 |
a3b4d23fcd647d6ddaa349012d66a17654c32d02 | src/components/TabBar/TabBar.css | src/components/TabBar/TabBar.css | @import "../palette.css";
.container {
position: relative;
margin: 10px 0 30px;
border-bottom: 1px solid rgba(255, 255, 255, .19);
overflow: hidden;
}
.subContainer {
display: flex;
flex-direction: row;
justify-content: space-between;
& a { /* Tab */
text-align: center;
font-weight: var(--fontWeightLight);
font-size: 15px;
color: var(--primaryTextColor);
padding: 10px 12px 16px;
border-bottom: 2px solid transparent;
flex-grow: 1;
&:hover {
color: var(--colorMutedLight);
}
&[disabled] {
pointer-events: none;
color: var(--colorMuted);
}
@media only screen and (max-width: 768px) {
padding-left: 10px;
padding-right: 10px;
}
}
& .chosen {
display: inline-block;
border-color: var(--primaryLinkColor);
color: color(var(--colorMuted) lightness(85%));
}
@media only screen and (max-width: 1439px) {
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
}
}
| @import "../palette.css";
.container {
position: relative;
margin: 10px 0 30px;
border-bottom: 1px solid rgba(255, 255, 255, .19);
overflow: hidden;
}
.subContainer {
display: flex;
flex-direction: row;
justify-content: space-between;
& a { /* Tab */
text-align: center;
font-weight: var(--fontWeightLight);
font-size: 15px;
color: var(--primaryTextColor);
padding: 10px 12px 16px;
border-bottom: 2px solid transparent;
flex-grow: 1;
&:hover {
color: var(--colorMutedLight);
}
&[disabled] {
pointer-events: none;
color: var(--colorMuted);
}
@media only screen and (max-width: 768px) {
padding-left: 10px;
padding-right: 10px;
}
}
& .chosen {
display: inline-block;
border-color: var(--primaryLinkColor);
color: color(var(--colorMuted) lightness(85%));
}
@media only screen and (max-width: 1439px) {
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
-ms-overflow-style: none;
}
}
| Fix being unable to scroll tab bar on Firefox when window width is smaller than 1440px | Fix being unable to scroll tab bar on Firefox when window width is smaller than 1440px
| CSS | mit | zya6yu/ui,zya6yu/ui,odota/ui,coreymaher/ui,coreymaher/ui,odota/ui,odota/ui,zya6yu/ui,mdiller/ui,mdiller/ui,mdiller/ui | css | ## Code Before:
@import "../palette.css";
.container {
position: relative;
margin: 10px 0 30px;
border-bottom: 1px solid rgba(255, 255, 255, .19);
overflow: hidden;
}
.subContainer {
display: flex;
flex-direction: row;
justify-content: space-between;
& a { /* Tab */
text-align: center;
font-weight: var(--fontWeightLight);
font-size: 15px;
color: var(--primaryTextColor);
padding: 10px 12px 16px;
border-bottom: 2px solid transparent;
flex-grow: 1;
&:hover {
color: var(--colorMutedLight);
}
&[disabled] {
pointer-events: none;
color: var(--colorMuted);
}
@media only screen and (max-width: 768px) {
padding-left: 10px;
padding-right: 10px;
}
}
& .chosen {
display: inline-block;
border-color: var(--primaryLinkColor);
color: color(var(--colorMuted) lightness(85%));
}
@media only screen and (max-width: 1439px) {
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
}
}
## Instruction:
Fix being unable to scroll tab bar on Firefox when window width is smaller than 1440px
## Code After:
@import "../palette.css";
.container {
position: relative;
margin: 10px 0 30px;
border-bottom: 1px solid rgba(255, 255, 255, .19);
overflow: hidden;
}
.subContainer {
display: flex;
flex-direction: row;
justify-content: space-between;
& a { /* Tab */
text-align: center;
font-weight: var(--fontWeightLight);
font-size: 15px;
color: var(--primaryTextColor);
padding: 10px 12px 16px;
border-bottom: 2px solid transparent;
flex-grow: 1;
&:hover {
color: var(--colorMutedLight);
}
&[disabled] {
pointer-events: none;
color: var(--colorMuted);
}
@media only screen and (max-width: 768px) {
padding-left: 10px;
padding-right: 10px;
}
}
& .chosen {
display: inline-block;
border-color: var(--primaryLinkColor);
color: color(var(--colorMuted) lightness(85%));
}
@media only screen and (max-width: 1439px) {
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
-ms-overflow-style: none;
}
}
| @import "../palette.css";
.container {
position: relative;
margin: 10px 0 30px;
border-bottom: 1px solid rgba(255, 255, 255, .19);
overflow: hidden;
}
.subContainer {
display: flex;
flex-direction: row;
justify-content: space-between;
& a { /* Tab */
text-align: center;
font-weight: var(--fontWeightLight);
font-size: 15px;
color: var(--primaryTextColor);
padding: 10px 12px 16px;
border-bottom: 2px solid transparent;
flex-grow: 1;
&:hover {
color: var(--colorMutedLight);
}
&[disabled] {
pointer-events: none;
color: var(--colorMuted);
}
@media only screen and (max-width: 768px) {
padding-left: 10px;
padding-right: 10px;
}
}
& .chosen {
display: inline-block;
border-color: var(--primaryLinkColor);
color: color(var(--colorMuted) lightness(85%));
}
@media only screen and (max-width: 1439px) {
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
-ms-overflow-style: none;
- overflow: -moz-scrollbars-none;
}
} | 1 | 0.019231 | 0 | 1 |
70a0e8171cefb33a40b9b6dda25b92631c3643fd | web/api/result.jsp | web/api/result.jsp | <%@ page import="java.util.*" contentType="application/json; charset=UTF-8" pageEncoding="UTF-8" %>
<%
out.print("{ \"result\": \"" + request.getAttribute("result") + "\" }");
%>
| <%@ page contentType="application/json; charset=UTF-8" pageEncoding="UTF-8" %>
{ "result": "${result}" }
| Use EL instead of scripting. | Use EL instead of scripting.
| Java Server Pages | apache-2.0 | ftclausen/ChefRoleSelect,ftclausen/ChefRoleSelect | java-server-pages | ## Code Before:
<%@ page import="java.util.*" contentType="application/json; charset=UTF-8" pageEncoding="UTF-8" %>
<%
out.print("{ \"result\": \"" + request.getAttribute("result") + "\" }");
%>
## Instruction:
Use EL instead of scripting.
## Code After:
<%@ page contentType="application/json; charset=UTF-8" pageEncoding="UTF-8" %>
{ "result": "${result}" }
| - <%@ page import="java.util.*" contentType="application/json; charset=UTF-8" pageEncoding="UTF-8" %>
? ---------------------
+ <%@ page contentType="application/json; charset=UTF-8" pageEncoding="UTF-8" %>
+ { "result": "${result}" }
- <%
- out.print("{ \"result\": \"" + request.getAttribute("result") + "\" }");
- %> | 6 | 1.5 | 2 | 4 |
f538c6f6a3b3486608b36cc8a6b4420c00a97a4b | .travis.yml | .travis.yml | language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
branches:
only:
- master
before_script:
- composer self-update
- composer install
script: php vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
notifications:
webhooks:
urls:
- http://wyrihaximus.net/wyri_projects/wyri_projects/webhook/travisci.json
on_success: always
on_failure: always
on_start: true
after_script: sh -c " if [ -f ./build/logs/clover.xml ]; then php vendor/bin/coveralls; fi"
| language: php
php:
- 5.3.3
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
branches:
only:
- master
before_script:
- composer self-update
- composer install
script: php vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
notifications:
webhooks:
urls:
- http://wyrihaximus.net/wyri_projects/wyri_projects/webhook/travisci.json
on_success: always
on_failure: always
on_start: true
after_script: sh -c " if [ -f ./build/logs/clover.xml ]; then php vendor/bin/coveralls; fi"
| Test against 5.3.3 to be sure | Test against 5.3.3 to be sure
| YAML | mit | WyriHaximus/HotSpots | yaml | ## Code Before:
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
branches:
only:
- master
before_script:
- composer self-update
- composer install
script: php vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
notifications:
webhooks:
urls:
- http://wyrihaximus.net/wyri_projects/wyri_projects/webhook/travisci.json
on_success: always
on_failure: always
on_start: true
after_script: sh -c " if [ -f ./build/logs/clover.xml ]; then php vendor/bin/coveralls; fi"
## Instruction:
Test against 5.3.3 to be sure
## Code After:
language: php
php:
- 5.3.3
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
branches:
only:
- master
before_script:
- composer self-update
- composer install
script: php vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
notifications:
webhooks:
urls:
- http://wyrihaximus.net/wyri_projects/wyri_projects/webhook/travisci.json
on_success: always
on_failure: always
on_start: true
after_script: sh -c " if [ -f ./build/logs/clover.xml ]; then php vendor/bin/coveralls; fi"
| language: php
php:
+ - 5.3.3
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
branches:
only:
- master
before_script:
- composer self-update
- composer install
script: php vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
notifications:
webhooks:
urls:
- http://wyrihaximus.net/wyri_projects/wyri_projects/webhook/travisci.json
on_success: always
on_failure: always
on_start: true
after_script: sh -c " if [ -f ./build/logs/clover.xml ]; then php vendor/bin/coveralls; fi" | 1 | 0.035714 | 1 | 0 |
a6ace3d73c5e87db6c26214cfd1ac20c4ab0d8a2 | tests/pgdoctor.cfg | tests/pgdoctor.cfg | http_port = 8071
# syslog facility to log to
syslog_facility = local7
# data to connect to the PostgreSQL server
pg_host = localhost
pg_port = 5432
pg_user = postgres
pg_password =
pg_database = postgres
# timeout (in seconds) when connecting to the PostgreSQL server
pg_connection_timeout = 3
# maximum acceptable delay on a streaming replica (use -1 to disable)
pg_max_replication_lag = -1
#
# optional set of custom checks
# each line is of the form "sql query" relop "value"
# * "sql query" -> plain SQL query to run; should return exactly one field
# * relop -> relational operator
# * "value" -> expected result from "sql query"
#
# the check is considered successful iff the application of the
# relational operator to the result of the query and the expected
# value is true
#
# if no relop and "value" are provided, the check is considered
# successful if the query is executed without any errors (regardless
# of what it actually returns)
#
# successful if "replication_lag < 5"
"SELECT extract(seconds from (now() - pg_last_xact_replay_timestamp())) AS replication_lag" < "5"
# successful iff the query runs without errors
"SELECT c FROM t WHERE 1=2"
| http_port = 8071
# syslog facility to log to
syslog_facility = local7
# data to connect to the PostgreSQL server
pg_host = localhost
pg_port = 5432
pg_user = postgres
pg_password =
pg_database = postgres
# timeout (in seconds) when connecting to the PostgreSQL server
pg_connection_timeout = 3
# maximum acceptable delay on a streaming replica (use -1 to disable)
pg_max_replication_lag = -1
#
# optional set of custom checks
# each line is of the form "sql query" relop "value"
# * "sql query" -> plain SQL query to run; should return exactly one field
# * relop -> relational operator
# * "value" -> expected result from "sql query"
#
# the check is considered successful iff the application of the
# relational operator to the result of the query and the expected
# value is true
#
# if no relop and "value" are provided, the check is considered
# successful if the query is executed without any errors (regardless
# of what it actually returns)
#
"SELECT 6" > "5"
"SELECT 3" < "5"
"SELECT 5" = "5"
| Add test cases to configuration file | Add test cases to configuration file
| INI | apache-2.0 | thumbtack/pgdoctor | ini | ## Code Before:
http_port = 8071
# syslog facility to log to
syslog_facility = local7
# data to connect to the PostgreSQL server
pg_host = localhost
pg_port = 5432
pg_user = postgres
pg_password =
pg_database = postgres
# timeout (in seconds) when connecting to the PostgreSQL server
pg_connection_timeout = 3
# maximum acceptable delay on a streaming replica (use -1 to disable)
pg_max_replication_lag = -1
#
# optional set of custom checks
# each line is of the form "sql query" relop "value"
# * "sql query" -> plain SQL query to run; should return exactly one field
# * relop -> relational operator
# * "value" -> expected result from "sql query"
#
# the check is considered successful iff the application of the
# relational operator to the result of the query and the expected
# value is true
#
# if no relop and "value" are provided, the check is considered
# successful if the query is executed without any errors (regardless
# of what it actually returns)
#
# successful if "replication_lag < 5"
"SELECT extract(seconds from (now() - pg_last_xact_replay_timestamp())) AS replication_lag" < "5"
# successful iff the query runs without errors
"SELECT c FROM t WHERE 1=2"
## Instruction:
Add test cases to configuration file
## Code After:
http_port = 8071
# syslog facility to log to
syslog_facility = local7
# data to connect to the PostgreSQL server
pg_host = localhost
pg_port = 5432
pg_user = postgres
pg_password =
pg_database = postgres
# timeout (in seconds) when connecting to the PostgreSQL server
pg_connection_timeout = 3
# maximum acceptable delay on a streaming replica (use -1 to disable)
pg_max_replication_lag = -1
#
# optional set of custom checks
# each line is of the form "sql query" relop "value"
# * "sql query" -> plain SQL query to run; should return exactly one field
# * relop -> relational operator
# * "value" -> expected result from "sql query"
#
# the check is considered successful iff the application of the
# relational operator to the result of the query and the expected
# value is true
#
# if no relop and "value" are provided, the check is considered
# successful if the query is executed without any errors (regardless
# of what it actually returns)
#
"SELECT 6" > "5"
"SELECT 3" < "5"
"SELECT 5" = "5"
| http_port = 8071
# syslog facility to log to
syslog_facility = local7
# data to connect to the PostgreSQL server
pg_host = localhost
pg_port = 5432
pg_user = postgres
pg_password =
pg_database = postgres
# timeout (in seconds) when connecting to the PostgreSQL server
pg_connection_timeout = 3
# maximum acceptable delay on a streaming replica (use -1 to disable)
pg_max_replication_lag = -1
#
# optional set of custom checks
# each line is of the form "sql query" relop "value"
# * "sql query" -> plain SQL query to run; should return exactly one field
# * relop -> relational operator
# * "value" -> expected result from "sql query"
#
# the check is considered successful iff the application of the
# relational operator to the result of the query and the expected
# value is true
#
# if no relop and "value" are provided, the check is considered
# successful if the query is executed without any errors (regardless
# of what it actually returns)
#
+ "SELECT 6" > "5"
+ "SELECT 3" < "5"
+ "SELECT 5" = "5"
- # successful if "replication_lag < 5"
- "SELECT extract(seconds from (now() - pg_last_xact_replay_timestamp())) AS replication_lag" < "5"
-
- # successful iff the query runs without errors
- "SELECT c FROM t WHERE 1=2" | 8 | 0.228571 | 3 | 5 |
73ee6af962a02c689888c5d1f93f5827d36def84 | package.json | package.json | {
"name": "autocomplete-plus",
"version": "2.15.2",
"main": "./lib/main",
"description": "Display possible completions in the editor while typing",
"repository": "https://github.com/atom/autocomplete-plus",
"licenses": [
{
"type": "MIT",
"url": "http://github.com/atom/autocomplete-plus/raw/master/LICENSE.md"
}
],
"engines": {
"atom": ">=0.189.0 <2.0.0"
},
"dependencies": {
"atom-slick": "^2.0.0",
"fuzzaldrin": "^2.1.0",
"grim": "^1.4.0",
"minimatch": "^2.0.1",
"selector-kit": "^0.1",
"semver": "^4.3.3",
"stable": "^0.1.5",
"underscore-plus": "^1.6.6"
},
"devDependencies": {
"coffeelint": ">=1.8.1",
"fs-plus": ">=2.4.0",
"temp": ">=0.7.0"
},
"consumedServices": {
"autocomplete.provider": {
"versions": {
"1.0.0": "consumeProviderLegacy",
"1.1.0": "consumeProvidersLegacy",
"2.0.0": "consumeProvider"
}
},
"snippets": {
"versions": {
"0.1.0": "consumeSnippets"
}
}
}
}
| {
"name": "autocomplete-plus",
"version": "2.15.2",
"main": "./lib/main",
"description": "Display possible completions in the editor while typing",
"repository": "https://github.com/atom/autocomplete-plus",
"license": "MIT",
"engines": {
"atom": ">=0.189.0 <2.0.0"
},
"dependencies": {
"atom-slick": "^2.0.0",
"fuzzaldrin": "^2.1.0",
"grim": "^1.4.0",
"minimatch": "^2.0.1",
"selector-kit": "^0.1",
"semver": "^4.3.3",
"stable": "^0.1.5",
"underscore-plus": "^1.6.6"
},
"devDependencies": {
"coffeelint": ">=1.8.1",
"fs-plus": ">=2.4.0",
"temp": ">=0.7.0"
},
"consumedServices": {
"autocomplete.provider": {
"versions": {
"1.0.0": "consumeProviderLegacy",
"1.1.0": "consumeProvidersLegacy",
"2.0.0": "consumeProvider"
}
},
"snippets": {
"versions": {
"0.1.0": "consumeSnippets"
}
}
}
}
| Change licenses field to license | Change licenses field to license
| JSON | mit | Lyleo/autocomplete-plus,atom/autocomplete-plus,lestat220255/autocomplete-plus,atom-community/autocomplete-plus,brntbeer/autocomplete-plus,wakermahmud/autocomplete-plus | json | ## Code Before:
{
"name": "autocomplete-plus",
"version": "2.15.2",
"main": "./lib/main",
"description": "Display possible completions in the editor while typing",
"repository": "https://github.com/atom/autocomplete-plus",
"licenses": [
{
"type": "MIT",
"url": "http://github.com/atom/autocomplete-plus/raw/master/LICENSE.md"
}
],
"engines": {
"atom": ">=0.189.0 <2.0.0"
},
"dependencies": {
"atom-slick": "^2.0.0",
"fuzzaldrin": "^2.1.0",
"grim": "^1.4.0",
"minimatch": "^2.0.1",
"selector-kit": "^0.1",
"semver": "^4.3.3",
"stable": "^0.1.5",
"underscore-plus": "^1.6.6"
},
"devDependencies": {
"coffeelint": ">=1.8.1",
"fs-plus": ">=2.4.0",
"temp": ">=0.7.0"
},
"consumedServices": {
"autocomplete.provider": {
"versions": {
"1.0.0": "consumeProviderLegacy",
"1.1.0": "consumeProvidersLegacy",
"2.0.0": "consumeProvider"
}
},
"snippets": {
"versions": {
"0.1.0": "consumeSnippets"
}
}
}
}
## Instruction:
Change licenses field to license
## Code After:
{
"name": "autocomplete-plus",
"version": "2.15.2",
"main": "./lib/main",
"description": "Display possible completions in the editor while typing",
"repository": "https://github.com/atom/autocomplete-plus",
"license": "MIT",
"engines": {
"atom": ">=0.189.0 <2.0.0"
},
"dependencies": {
"atom-slick": "^2.0.0",
"fuzzaldrin": "^2.1.0",
"grim": "^1.4.0",
"minimatch": "^2.0.1",
"selector-kit": "^0.1",
"semver": "^4.3.3",
"stable": "^0.1.5",
"underscore-plus": "^1.6.6"
},
"devDependencies": {
"coffeelint": ">=1.8.1",
"fs-plus": ">=2.4.0",
"temp": ">=0.7.0"
},
"consumedServices": {
"autocomplete.provider": {
"versions": {
"1.0.0": "consumeProviderLegacy",
"1.1.0": "consumeProvidersLegacy",
"2.0.0": "consumeProvider"
}
},
"snippets": {
"versions": {
"0.1.0": "consumeSnippets"
}
}
}
}
| {
"name": "autocomplete-plus",
"version": "2.15.2",
"main": "./lib/main",
"description": "Display possible completions in the editor while typing",
"repository": "https://github.com/atom/autocomplete-plus",
- "licenses": [
? - ^
+ "license": "MIT",
? ^^^^^^
- {
- "type": "MIT",
- "url": "http://github.com/atom/autocomplete-plus/raw/master/LICENSE.md"
- }
- ],
"engines": {
"atom": ">=0.189.0 <2.0.0"
},
"dependencies": {
"atom-slick": "^2.0.0",
"fuzzaldrin": "^2.1.0",
"grim": "^1.4.0",
"minimatch": "^2.0.1",
"selector-kit": "^0.1",
"semver": "^4.3.3",
"stable": "^0.1.5",
"underscore-plus": "^1.6.6"
},
"devDependencies": {
"coffeelint": ">=1.8.1",
"fs-plus": ">=2.4.0",
"temp": ">=0.7.0"
},
"consumedServices": {
"autocomplete.provider": {
"versions": {
"1.0.0": "consumeProviderLegacy",
"1.1.0": "consumeProvidersLegacy",
"2.0.0": "consumeProvider"
}
},
"snippets": {
"versions": {
"0.1.0": "consumeSnippets"
}
}
}
} | 7 | 0.155556 | 1 | 6 |
e1775dfa465a0b0f376a5f4a659e958e66e1c4a5 | docker-compose.yml | docker-compose.yml | version: "2"
services:
app:
build:
context: .
dockerfile: Dockerfile-dev
volumes:
- .:/app
- build_cache:/build
tmpfs:
# Mount the ember-cli tmp directory as a tmpfs partition for better
# performance.
- /app/src/api-umbrella/admin-ui/tmp:rw,size=128m,mode=1777
environment:
HTTP_PORT: 8100
HTTPS_PORT: 8101
ports:
- "8100:8100"
- "8101:8101"
volumes:
build_cache:
| version: "2.1"
services:
app:
build:
context: .
dockerfile: Dockerfile-dev
volumes:
- .:/app
- build_cache:/build
tmpfs:
# Mount the ember-cli tmp directory as a tmpfs partition for better
# performance.
- /app/src/api-umbrella/admin-ui/tmp:rw,size=128m,mode=1777
environment:
HTTP_PORT: 8100
HTTPS_PORT: 8101
ports:
- "8100:8100"
- "8101:8101"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
volumes:
build_cache:
| Enable IPv6 support in local docker container for development testing. | Enable IPv6 support in local docker container for development testing.
| YAML | mit | NREL/api-umbrella,NREL/api-umbrella,NREL/api-umbrella,NREL/api-umbrella | yaml | ## Code Before:
version: "2"
services:
app:
build:
context: .
dockerfile: Dockerfile-dev
volumes:
- .:/app
- build_cache:/build
tmpfs:
# Mount the ember-cli tmp directory as a tmpfs partition for better
# performance.
- /app/src/api-umbrella/admin-ui/tmp:rw,size=128m,mode=1777
environment:
HTTP_PORT: 8100
HTTPS_PORT: 8101
ports:
- "8100:8100"
- "8101:8101"
volumes:
build_cache:
## Instruction:
Enable IPv6 support in local docker container for development testing.
## Code After:
version: "2.1"
services:
app:
build:
context: .
dockerfile: Dockerfile-dev
volumes:
- .:/app
- build_cache:/build
tmpfs:
# Mount the ember-cli tmp directory as a tmpfs partition for better
# performance.
- /app/src/api-umbrella/admin-ui/tmp:rw,size=128m,mode=1777
environment:
HTTP_PORT: 8100
HTTPS_PORT: 8101
ports:
- "8100:8100"
- "8101:8101"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
volumes:
build_cache:
| - version: "2"
+ version: "2.1"
? ++
services:
app:
build:
context: .
dockerfile: Dockerfile-dev
volumes:
- .:/app
- build_cache:/build
tmpfs:
# Mount the ember-cli tmp directory as a tmpfs partition for better
# performance.
- /app/src/api-umbrella/admin-ui/tmp:rw,size=128m,mode=1777
environment:
HTTP_PORT: 8100
HTTPS_PORT: 8101
ports:
- "8100:8100"
- "8101:8101"
+ sysctls:
+ - net.ipv6.conf.all.disable_ipv6=0
volumes:
build_cache: | 4 | 0.190476 | 3 | 1 |
ccd9cfc7e7a759193ea9000d401134c853dc4491 | app/controllers/api/v1/documents_controller.rb | app/controllers/api/v1/documents_controller.rb | class Api::V1::DocumentsController < ApplicationController
# PATCH/PUT /documents/1
# PATCH/PUT /documents/1.json
def update
document = Document.find_by(id: params[:id])
if not document.nil?
document.update_document(params, document.documentID, @@tvVaultID, @@tvAdminAPI)
end
end
private
def document_params
params.require(:document).permit(:documentID, :documentData)
end
end
| class Api::V1::DocumentsController < ApplicationController
# PATCH/PUT /documents/1
# PATCH/PUT /documents/1.json
def update
document = current_user.document
if not document.nil?
doc = document.update_document(document_params, document.documentID, @@tvVaultID, @@tvAdminAPI)
render json: {
status: 'success',
data: doc.as_json
}
else
render json: {
status: 'error',
message: 'Document does not exist!'
}
end
end
private
def document_params
params.except(:format, :controller, :action)
end
end
| Document update action no longer requires an ID parameter | Document update action no longer requires an ID parameter
Also included more informational messages after executing.
| Ruby | apache-2.0 | openpearl/PearlAPI,openpearl/PearlAPI | ruby | ## Code Before:
class Api::V1::DocumentsController < ApplicationController
# PATCH/PUT /documents/1
# PATCH/PUT /documents/1.json
def update
document = Document.find_by(id: params[:id])
if not document.nil?
document.update_document(params, document.documentID, @@tvVaultID, @@tvAdminAPI)
end
end
private
def document_params
params.require(:document).permit(:documentID, :documentData)
end
end
## Instruction:
Document update action no longer requires an ID parameter
Also included more informational messages after executing.
## Code After:
class Api::V1::DocumentsController < ApplicationController
# PATCH/PUT /documents/1
# PATCH/PUT /documents/1.json
def update
document = current_user.document
if not document.nil?
doc = document.update_document(document_params, document.documentID, @@tvVaultID, @@tvAdminAPI)
render json: {
status: 'success',
data: doc.as_json
}
else
render json: {
status: 'error',
message: 'Document does not exist!'
}
end
end
private
def document_params
params.except(:format, :controller, :action)
end
end
| class Api::V1::DocumentsController < ApplicationController
# PATCH/PUT /documents/1
# PATCH/PUT /documents/1.json
+
def update
- document = Document.find_by(id: params[:id])
+ document = current_user.document
if not document.nil?
- document.update_document(params, document.documentID, @@tvVaultID, @@tvAdminAPI)
+ doc = document.update_document(document_params, document.documentID, @@tvVaultID, @@tvAdminAPI)
? ++++++ +++++++++
+ render json: {
+ status: 'success',
+ data: doc.as_json
+ }
+ else
+ render json: {
+ status: 'error',
+ message: 'Document does not exist!'
+ }
end
end
private
def document_params
- params.require(:document).permit(:documentID, :documentData)
+ params.except(:format, :controller, :action)
end
end | 16 | 0.941176 | 13 | 3 |
05953f58f7a09f763ade0d2638a1c87e25ee2cce | www/index.html | www/index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' http://localhost:35729 'unsafe-inline' 'unsafe-eval'">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html>
| Add Content-Security-Policy meta tag (Whitelist plugin) | Added: Add Content-Security-Policy meta tag (Whitelist plugin)
| HTML | mit | re757575/my-ionic-app,re757575/my-ionic-app | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html>
## Instruction:
Added: Add Content-Security-Policy meta tag (Whitelist plugin)
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' http://localhost:35729 'unsafe-inline' 'unsafe-eval'">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
+ <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' http://localhost:35729 'unsafe-inline' 'unsafe-eval'">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html> | 1 | 0.034483 | 1 | 0 |
500b53d9110d67f9e7b053cf91d0cc16579ba988 | app/serializers/device_serializer.rb | app/serializers/device_serializer.rb | class DeviceSerializer < ActiveModel::Serializer
attributes :id, :name, :webcam_url
end
| class DeviceSerializer < ActiveModel::Serializer
attributes :id, :name, :webcam_url, :timezone
end
| Add timezone to device serializer. | Add timezone to device serializer.
| Ruby | mit | RickCarlino/farmbot-web-app,FarmBot/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,FarmBot/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,FarmBot/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,FarmBot/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,FarmBot/Farmbot-Web-API,RickCarlino/farmbot-web-app,RickCarlino/farmbot-web-app,RickCarlino/farmbot-web-app,FarmBot/Farmbot-Web-API,RickCarlino/farmbot-web-app,MrChristofferson/Farmbot-Web-API,FarmBot/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,MrChristofferson/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,FarmBot/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App | ruby | ## Code Before:
class DeviceSerializer < ActiveModel::Serializer
attributes :id, :name, :webcam_url
end
## Instruction:
Add timezone to device serializer.
## Code After:
class DeviceSerializer < ActiveModel::Serializer
attributes :id, :name, :webcam_url, :timezone
end
| class DeviceSerializer < ActiveModel::Serializer
- attributes :id, :name, :webcam_url
+ attributes :id, :name, :webcam_url, :timezone
? +++++++++++
end | 2 | 0.666667 | 1 | 1 |
1cce9a55b215a4a315c7d09ffb58f5412d20b35c | lib/shared/cronjob-utils.js | lib/shared/cronjob-utils.js | // @flow
import type { CronJob, Task } from '../../types';
import shortid from 'shortid';
import { format, addSeconds } from 'date-fns';
import { assoc, lens, map, pipe, prop, replace, set, view } from 'ramda';
const jobTemplate: CronJob = {
jobId: 'cronjobs/',
name: 'temporary scene cron-job ',
at: '13:15:00',
repeat: 'oneShot',
scheduled: false,
running: false,
lastRun: null,
tasks: null,
};
function buildCronjobWithTasks(name: string, tasks: Array<Task>) {
const jobIdLens = lens(prop('jobId'), assoc('jobId'));
const orgJobId = view(jobIdLens)(jobTemplate);
// Remove slash in scene-name and append unique id
const newJobId = set(
jobIdLens,
`${orgJobId}${replace(/\//, '', name)}-${shortid.generate()}`
);
return pipe(newJobId, assoc('tasks', tasks))(jobTemplate);
}
function scheduleJobForNow(job: CronJob) {
const ts = new Date();
return assoc('at', format(addSeconds(ts, 2), 'HH:mm:s'), job);
}
function invertTaskActions(tasks: Array<Task>) {
const invert = act => {
switch (act) {
case 'on':
return 'off';
case 'off':
return 'on';
default:
return act;
}
};
return map(t => assoc('act', invert(prop('act', t)), t), tasks);
}
export { buildCronjobWithTasks, scheduleJobForNow, invertTaskActions };
| // @flow
import type { CronJob, Task } from '../../types';
import shortid from 'shortid';
import { assoc, lens, map, pipe, prop, replace, set, view } from 'ramda';
const jobTemplate: CronJob = {
jobId: 'cronjobs/',
name: 'temporary scene cron-job ',
at: '13:15:00',
repeat: 'oneShot',
scheduled: false,
running: false,
lastRun: null,
tasks: null,
};
function buildCronjobWithTasks(name: string, tasks: Array<Task>) {
const jobIdLens = lens(prop('jobId'), assoc('jobId'));
const orgJobId = view(jobIdLens)(jobTemplate);
// Remove slash in scene-name and append unique id
const newJobId = set(
jobIdLens,
`${orgJobId}${replace(/\//, '', name)}-${shortid.generate()}`
);
return pipe(newJobId, assoc('tasks', tasks))(jobTemplate);
}
function scheduleJobForNow(job: CronJob) {
return assoc('at', 'now', job);
}
function invertTaskActions(tasks: Array<Task>) {
const invert = act => {
switch (act) {
case 'on':
return 'off';
case 'off':
return 'on';
default:
return act;
}
};
return map(t => assoc('act', invert(prop('act', t)), t), tasks);
}
export { buildCronjobWithTasks, scheduleJobForNow, invertTaskActions };
| Set start-time for scenes to ’now’ instead of calculating timestamps | Set start-time for scenes to ’now’ instead of calculating timestamps
| JavaScript | mit | cjk/smart-home-app | javascript | ## Code Before:
// @flow
import type { CronJob, Task } from '../../types';
import shortid from 'shortid';
import { format, addSeconds } from 'date-fns';
import { assoc, lens, map, pipe, prop, replace, set, view } from 'ramda';
const jobTemplate: CronJob = {
jobId: 'cronjobs/',
name: 'temporary scene cron-job ',
at: '13:15:00',
repeat: 'oneShot',
scheduled: false,
running: false,
lastRun: null,
tasks: null,
};
function buildCronjobWithTasks(name: string, tasks: Array<Task>) {
const jobIdLens = lens(prop('jobId'), assoc('jobId'));
const orgJobId = view(jobIdLens)(jobTemplate);
// Remove slash in scene-name and append unique id
const newJobId = set(
jobIdLens,
`${orgJobId}${replace(/\//, '', name)}-${shortid.generate()}`
);
return pipe(newJobId, assoc('tasks', tasks))(jobTemplate);
}
function scheduleJobForNow(job: CronJob) {
const ts = new Date();
return assoc('at', format(addSeconds(ts, 2), 'HH:mm:s'), job);
}
function invertTaskActions(tasks: Array<Task>) {
const invert = act => {
switch (act) {
case 'on':
return 'off';
case 'off':
return 'on';
default:
return act;
}
};
return map(t => assoc('act', invert(prop('act', t)), t), tasks);
}
export { buildCronjobWithTasks, scheduleJobForNow, invertTaskActions };
## Instruction:
Set start-time for scenes to ’now’ instead of calculating timestamps
## Code After:
// @flow
import type { CronJob, Task } from '../../types';
import shortid from 'shortid';
import { assoc, lens, map, pipe, prop, replace, set, view } from 'ramda';
const jobTemplate: CronJob = {
jobId: 'cronjobs/',
name: 'temporary scene cron-job ',
at: '13:15:00',
repeat: 'oneShot',
scheduled: false,
running: false,
lastRun: null,
tasks: null,
};
function buildCronjobWithTasks(name: string, tasks: Array<Task>) {
const jobIdLens = lens(prop('jobId'), assoc('jobId'));
const orgJobId = view(jobIdLens)(jobTemplate);
// Remove slash in scene-name and append unique id
const newJobId = set(
jobIdLens,
`${orgJobId}${replace(/\//, '', name)}-${shortid.generate()}`
);
return pipe(newJobId, assoc('tasks', tasks))(jobTemplate);
}
function scheduleJobForNow(job: CronJob) {
return assoc('at', 'now', job);
}
function invertTaskActions(tasks: Array<Task>) {
const invert = act => {
switch (act) {
case 'on':
return 'off';
case 'off':
return 'on';
default:
return act;
}
};
return map(t => assoc('act', invert(prop('act', t)), t), tasks);
}
export { buildCronjobWithTasks, scheduleJobForNow, invertTaskActions };
| // @flow
import type { CronJob, Task } from '../../types';
import shortid from 'shortid';
- import { format, addSeconds } from 'date-fns';
import { assoc, lens, map, pipe, prop, replace, set, view } from 'ramda';
const jobTemplate: CronJob = {
jobId: 'cronjobs/',
name: 'temporary scene cron-job ',
at: '13:15:00',
repeat: 'oneShot',
scheduled: false,
running: false,
lastRun: null,
tasks: null,
};
function buildCronjobWithTasks(name: string, tasks: Array<Task>) {
const jobIdLens = lens(prop('jobId'), assoc('jobId'));
const orgJobId = view(jobIdLens)(jobTemplate);
// Remove slash in scene-name and append unique id
const newJobId = set(
jobIdLens,
`${orgJobId}${replace(/\//, '', name)}-${shortid.generate()}`
);
return pipe(newJobId, assoc('tasks', tasks))(jobTemplate);
}
function scheduleJobForNow(job: CronJob) {
+ return assoc('at', 'now', job);
- const ts = new Date();
- return assoc('at', format(addSeconds(ts, 2), 'HH:mm:s'), job);
}
function invertTaskActions(tasks: Array<Task>) {
const invert = act => {
switch (act) {
case 'on':
return 'off';
case 'off':
return 'on';
default:
return act;
}
};
return map(t => assoc('act', invert(prop('act', t)), t), tasks);
}
export { buildCronjobWithTasks, scheduleJobForNow, invertTaskActions }; | 4 | 0.08 | 1 | 3 |
4ebea6646ea63a56f32facbdfe4be6c83e494e91 | docs/dev-environment/README.md | docs/dev-environment/README.md |
This folder contains the following guides:
1. [Setting Up Your Dev Environment](./setting-up-dev-environment.md): Everyone should read this, this is how to setup your dev environment
2. [Setting Up Debuggers](./setting-up-debuggers.md): Debuggers are immensely helpful tools during development, this guide outlines some possible ways to setup debuggers for both the clientside JS and the server (feel free to add others if you use a different but also good setup)
|
This folder contains the following guides:
1. [Setting Up Your Dev Environment](./setting-up-dev-environment.md): Everyone should read this, this is how to setup your dev environment
2. [Setting Up Your Editor](./setting-up-editor.md): Having a good editor setup is very important for developer productivity and general quality of life! Check out this guide to get some tips on how to setup your editor to work well with The Gazelle's codebase
| Update index to reflect changes | Update index to reflect changes | Markdown | mit | thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end | markdown | ## Code Before:
This folder contains the following guides:
1. [Setting Up Your Dev Environment](./setting-up-dev-environment.md): Everyone should read this, this is how to setup your dev environment
2. [Setting Up Debuggers](./setting-up-debuggers.md): Debuggers are immensely helpful tools during development, this guide outlines some possible ways to setup debuggers for both the clientside JS and the server (feel free to add others if you use a different but also good setup)
## Instruction:
Update index to reflect changes
## Code After:
This folder contains the following guides:
1. [Setting Up Your Dev Environment](./setting-up-dev-environment.md): Everyone should read this, this is how to setup your dev environment
2. [Setting Up Your Editor](./setting-up-editor.md): Having a good editor setup is very important for developer productivity and general quality of life! Check out this guide to get some tips on how to setup your editor to work well with The Gazelle's codebase
|
This folder contains the following guides:
1. [Setting Up Your Dev Environment](./setting-up-dev-environment.md): Everyone should read this, this is how to setup your dev environment
- 2. [Setting Up Debuggers](./setting-up-debuggers.md): Debuggers are immensely helpful tools during development, this guide outlines some possible ways to setup debuggers for both the clientside JS and the server (feel free to add others if you use a different but also good setup)
+ 2. [Setting Up Your Editor](./setting-up-editor.md): Having a good editor setup is very important for developer productivity and general quality of life! Check out this guide to get some tips on how to setup your editor to work well with The Gazelle's codebase | 2 | 0.5 | 1 | 1 |
40bae0eab2e863d466f45c46df11656459d9e761 | islandora_xacml_editor.api.php | islandora_xacml_editor.api.php | <?php
/**
* @file
* This file documents all available hook functions to manipulate data.
*/
/**
* Define custom queries to be used when batching through "children" of objects.
*
* @param FedoraObject $object
* A FedoraObject.
*
* @return array
* An array of queries to be returned to the islandora_xacml_editor module.
* Each entry in the array is an associate array itself with the following
* structure:
* - type: The type of query to be executed either itql or sparql.
* - query: The defined query string.
* - description: Human-readable description used in populating the options
* dropdown.
*/
function hook_islandora_xacml_editor_child_query($object) {
return array(
'sample_query' => array(
'type' => 'itql',
'query' => 'select $object from <#ri> where $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:root>',
'description' => t('Sweet query bro.'),
),
);
}
| <?php
/**
* @file
* This file documents all available hook functions to manipulate data.
*/
/**
* Define custom queries to be used when batching through "children" of objects.
*
* @param FedoraObject $object
* A FedoraObject.
*
* @return array
* An array of queries to be returned to the islandora_xacml_editor module.
* Each entry in the array is an associate array itself with the following
* structure:
* - type: The type of query to be executed either itql or sparql.
* - query: The defined query string. The field we expect returned is that of
* "object". I.e select ?object.
* - description: Human-readable description used in populating the options
* dropdown.
*/
function hook_islandora_xacml_editor_child_query($object) {
return array(
'sample_query' => array(
'type' => 'itql',
'query' => 'select $object from <#ri> where $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:root>',
'description' => t('Sweet query bro.'),
),
);
}
| Clarify API doc a smidge. | Clarify API doc a smidge.
| PHP | agpl-3.0 | jordandukart/islandora_xacml_editor | php | ## Code Before:
<?php
/**
* @file
* This file documents all available hook functions to manipulate data.
*/
/**
* Define custom queries to be used when batching through "children" of objects.
*
* @param FedoraObject $object
* A FedoraObject.
*
* @return array
* An array of queries to be returned to the islandora_xacml_editor module.
* Each entry in the array is an associate array itself with the following
* structure:
* - type: The type of query to be executed either itql or sparql.
* - query: The defined query string.
* - description: Human-readable description used in populating the options
* dropdown.
*/
function hook_islandora_xacml_editor_child_query($object) {
return array(
'sample_query' => array(
'type' => 'itql',
'query' => 'select $object from <#ri> where $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:root>',
'description' => t('Sweet query bro.'),
),
);
}
## Instruction:
Clarify API doc a smidge.
## Code After:
<?php
/**
* @file
* This file documents all available hook functions to manipulate data.
*/
/**
* Define custom queries to be used when batching through "children" of objects.
*
* @param FedoraObject $object
* A FedoraObject.
*
* @return array
* An array of queries to be returned to the islandora_xacml_editor module.
* Each entry in the array is an associate array itself with the following
* structure:
* - type: The type of query to be executed either itql or sparql.
* - query: The defined query string. The field we expect returned is that of
* "object". I.e select ?object.
* - description: Human-readable description used in populating the options
* dropdown.
*/
function hook_islandora_xacml_editor_child_query($object) {
return array(
'sample_query' => array(
'type' => 'itql',
'query' => 'select $object from <#ri> where $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:root>',
'description' => t('Sweet query bro.'),
),
);
}
| <?php
/**
* @file
* This file documents all available hook functions to manipulate data.
*/
/**
* Define custom queries to be used when batching through "children" of objects.
*
* @param FedoraObject $object
* A FedoraObject.
*
* @return array
* An array of queries to be returned to the islandora_xacml_editor module.
* Each entry in the array is an associate array itself with the following
* structure:
* - type: The type of query to be executed either itql or sparql.
- * - query: The defined query string.
+ * - query: The defined query string. The field we expect returned is that of
+ * "object". I.e select ?object.
* - description: Human-readable description used in populating the options
* dropdown.
*/
function hook_islandora_xacml_editor_child_query($object) {
return array(
'sample_query' => array(
'type' => 'itql',
'query' => 'select $object from <#ri> where $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:root>',
'description' => t('Sweet query bro.'),
),
);
} | 3 | 0.096774 | 2 | 1 |
93b7b5befe40c4a3f847c59071c4f2f6cd5325e7 | src/tstquery.cpp | src/tstquery.cpp | /*
* Copyright (c) 1998-2005, Index Data.
* See the file LICENSE for details.
*
* $Id: tstquery.cpp,v 1.2 2006-03-29 13:14:15 adam Exp $
*/
#include <stdlib.h>
#include <yazpp/z-query.h>
using namespace yazpp_1;
void tst1(const char *query_str_in, const char *query_expected)
{
Yaz_Z_Query q;
q = query_str_in;
Yaz_Z_Query q2;
q2 = q;
char query_str_out[100];
q2.print(query_str_out, sizeof(query_str_out)-1);
if (strcmp(query_str_out, query_expected))
{
fprintf(stderr, "tstquery: query mismatch out=%s expected=%s\n",
query_str_out, query_expected);
exit(1);
}
}
int main(int argc, char **argv)
{
tst1("", "");
tst1("x", "RPN: @attrset Bib-1 x");
tst1("@and a b", "RPN: @attrset Bib-1 @and a b");
}
/*
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
| /*
* Copyright (c) 1998-2006, Index Data.
* See the file LICENSE for details.
*
* $Id: tstquery.cpp,v 1.3 2006-07-07 12:57:15 adam Exp $
*/
#include <stdlib.h>
#include <yazpp/z-query.h>
using namespace yazpp_1;
void tst1(const char *query_str_in, const char *query_expected)
{
Yaz_Z_Query q;
q = query_str_in;
Yaz_Z_Query q2;
q2 = q;
char query_str_out[100];
q2.print(query_str_out, sizeof(query_str_out)-1);
if (strcmp(query_str_out, query_expected))
{
fprintf(stderr, "tstquery: query mismatch out=%s expected=%s\n",
query_str_out, query_expected);
exit(1);
}
}
int main(int argc, char **argv)
{
tst1("", "");
tst1("x", "RPN @attrset Bib-1 x");
tst1("@and a b", "RPN @attrset Bib-1 @and a b");
}
/*
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
| Update test becuase yaz_query_to_wrbuf now omits : before query type in string output. | Update test becuase yaz_query_to_wrbuf now omits : before
query type in string output.
| C++ | bsd-3-clause | indexgeo/yazpp,indexgeo/yazpp | c++ | ## Code Before:
/*
* Copyright (c) 1998-2005, Index Data.
* See the file LICENSE for details.
*
* $Id: tstquery.cpp,v 1.2 2006-03-29 13:14:15 adam Exp $
*/
#include <stdlib.h>
#include <yazpp/z-query.h>
using namespace yazpp_1;
void tst1(const char *query_str_in, const char *query_expected)
{
Yaz_Z_Query q;
q = query_str_in;
Yaz_Z_Query q2;
q2 = q;
char query_str_out[100];
q2.print(query_str_out, sizeof(query_str_out)-1);
if (strcmp(query_str_out, query_expected))
{
fprintf(stderr, "tstquery: query mismatch out=%s expected=%s\n",
query_str_out, query_expected);
exit(1);
}
}
int main(int argc, char **argv)
{
tst1("", "");
tst1("x", "RPN: @attrset Bib-1 x");
tst1("@and a b", "RPN: @attrset Bib-1 @and a b");
}
/*
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
## Instruction:
Update test becuase yaz_query_to_wrbuf now omits : before
query type in string output.
## Code After:
/*
* Copyright (c) 1998-2006, Index Data.
* See the file LICENSE for details.
*
* $Id: tstquery.cpp,v 1.3 2006-07-07 12:57:15 adam Exp $
*/
#include <stdlib.h>
#include <yazpp/z-query.h>
using namespace yazpp_1;
void tst1(const char *query_str_in, const char *query_expected)
{
Yaz_Z_Query q;
q = query_str_in;
Yaz_Z_Query q2;
q2 = q;
char query_str_out[100];
q2.print(query_str_out, sizeof(query_str_out)-1);
if (strcmp(query_str_out, query_expected))
{
fprintf(stderr, "tstquery: query mismatch out=%s expected=%s\n",
query_str_out, query_expected);
exit(1);
}
}
int main(int argc, char **argv)
{
tst1("", "");
tst1("x", "RPN @attrset Bib-1 x");
tst1("@and a b", "RPN @attrset Bib-1 @and a b");
}
/*
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
| /*
- * Copyright (c) 1998-2005, Index Data.
? ^
+ * Copyright (c) 1998-2006, Index Data.
? ^
* See the file LICENSE for details.
*
- * $Id: tstquery.cpp,v 1.2 2006-03-29 13:14:15 adam Exp $
? ^ ^ ^^ ^ ^^
+ * $Id: tstquery.cpp,v 1.3 2006-07-07 12:57:15 adam Exp $
? ^ ^ ^^ ^ ^^
*/
#include <stdlib.h>
#include <yazpp/z-query.h>
using namespace yazpp_1;
void tst1(const char *query_str_in, const char *query_expected)
{
Yaz_Z_Query q;
q = query_str_in;
Yaz_Z_Query q2;
q2 = q;
char query_str_out[100];
q2.print(query_str_out, sizeof(query_str_out)-1);
if (strcmp(query_str_out, query_expected))
{
fprintf(stderr, "tstquery: query mismatch out=%s expected=%s\n",
query_str_out, query_expected);
exit(1);
}
}
int main(int argc, char **argv)
{
tst1("", "");
- tst1("x", "RPN: @attrset Bib-1 x");
? -
+ tst1("x", "RPN @attrset Bib-1 x");
- tst1("@and a b", "RPN: @attrset Bib-1 @and a b");
? -
+ tst1("@and a b", "RPN @attrset Bib-1 @and a b");
}
/*
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/ | 8 | 0.170213 | 4 | 4 |
ba44156fe8d5057c4b164ade61b76e0d6654d607 | app/renderer/containers/PlayerContainer.js | app/renderer/containers/PlayerContainer.js | import { connect } from 'react-redux';
import Player from '../presentational/audio-player/Player';
import { togglePlay, changeCurrentSeconds, seekToSeconds, setDuration } from './../actions/player';
export const mapStateToProps = (state) => ({
...state
});
const mapDispatchToProps = (dispatch) => ({
onPlayClick: () => dispatch(togglePlay),
onTimeUpdate: (e) => dispatch(changeCurrentSeconds(e.target.currentTime)),
onSlide: (e) => dispatch(seekToSeconds(e.target.value)),
onDurationSet: (dur) => dispatch(setDuration(dur))
});
const PlayerContainer = connect(
mapStateToProps,
mapDispatchToProps
)(Player);
export default PlayerContainer;
| import { connect } from 'react-redux';
import Player from '../presentational/audio-player/Player';
import { togglePlay, changeCurrentSeconds, seekToSeconds, setDuration, changeVolume } from './../actions/player';
export const mapStateToProps = (state) => ({
...state
});
const mapDispatchToProps = (dispatch) => ({
onPlayClick: () => dispatch(togglePlay),
onTimeUpdate: (e) => dispatch(changeCurrentSeconds(e.target.currentTime)),
onSeekerChange: (e) => dispatch(seekToSeconds(e.target.value)),
onDurationSet: (dur) => dispatch(setDuration(dur)),
onVolumeChange: (e) => dispatch(changeVolume(e.target.value / 100))
});
const PlayerContainer = connect(
mapStateToProps,
mapDispatchToProps
)(Player);
export default PlayerContainer;
| Add new action volume change | Add new action volume change
| JavaScript | mit | AbsoluteZero273/Deezic | javascript | ## Code Before:
import { connect } from 'react-redux';
import Player from '../presentational/audio-player/Player';
import { togglePlay, changeCurrentSeconds, seekToSeconds, setDuration } from './../actions/player';
export const mapStateToProps = (state) => ({
...state
});
const mapDispatchToProps = (dispatch) => ({
onPlayClick: () => dispatch(togglePlay),
onTimeUpdate: (e) => dispatch(changeCurrentSeconds(e.target.currentTime)),
onSlide: (e) => dispatch(seekToSeconds(e.target.value)),
onDurationSet: (dur) => dispatch(setDuration(dur))
});
const PlayerContainer = connect(
mapStateToProps,
mapDispatchToProps
)(Player);
export default PlayerContainer;
## Instruction:
Add new action volume change
## Code After:
import { connect } from 'react-redux';
import Player from '../presentational/audio-player/Player';
import { togglePlay, changeCurrentSeconds, seekToSeconds, setDuration, changeVolume } from './../actions/player';
export const mapStateToProps = (state) => ({
...state
});
const mapDispatchToProps = (dispatch) => ({
onPlayClick: () => dispatch(togglePlay),
onTimeUpdate: (e) => dispatch(changeCurrentSeconds(e.target.currentTime)),
onSeekerChange: (e) => dispatch(seekToSeconds(e.target.value)),
onDurationSet: (dur) => dispatch(setDuration(dur)),
onVolumeChange: (e) => dispatch(changeVolume(e.target.value / 100))
});
const PlayerContainer = connect(
mapStateToProps,
mapDispatchToProps
)(Player);
export default PlayerContainer;
| import { connect } from 'react-redux';
import Player from '../presentational/audio-player/Player';
- import { togglePlay, changeCurrentSeconds, seekToSeconds, setDuration } from './../actions/player';
+ import { togglePlay, changeCurrentSeconds, seekToSeconds, setDuration, changeVolume } from './../actions/player';
? ++++++++++++++
export const mapStateToProps = (state) => ({
...state
});
const mapDispatchToProps = (dispatch) => ({
onPlayClick: () => dispatch(togglePlay),
onTimeUpdate: (e) => dispatch(changeCurrentSeconds(e.target.currentTime)),
- onSlide: (e) => dispatch(seekToSeconds(e.target.value)),
? ^^^
+ onSeekerChange: (e) => dispatch(seekToSeconds(e.target.value)),
? ^^^^^^^^^^
- onDurationSet: (dur) => dispatch(setDuration(dur))
+ onDurationSet: (dur) => dispatch(setDuration(dur)),
? +
+ onVolumeChange: (e) => dispatch(changeVolume(e.target.value / 100))
});
const PlayerContainer = connect(
mapStateToProps,
mapDispatchToProps
)(Player);
export default PlayerContainer; | 7 | 0.333333 | 4 | 3 |
d27a8c543038a3a7f75bcde20abba8b29b461eea | README.md | README.md |
Goth is a web authentication system written in Go. With Goth, you get out-of-
the-box user sign in, sign up, and sign out functionality to kick off building
your web app.
## Installation
```
go get github.com/jroes/goth
```
## Usage
The following example registers a handler for an admin section that would be
able to retrieve information about the currently logged in user, and a pattern
that will handle the standard sign in, sign out, and sign up functionality.
```go
package main
import (
"fmt"
"github.com/jroes/goth"
"net/http"
)
func main() {
authHandler := goth.AuthHandler{RoutePath: "/auth/", TemplatePath: "tmpl/", AfterSignupURL: "/", AfterSigninURL: "/"}
http.HandleFunc("/admin/", adminHandler)
http.Handle("/auth/", authHandler)
// Please use ListenAndServeTLS in production.
http.ListenAndServe(":8080", nil)
}
func adminHandler(w http.ResponseWriter, r *http.Request) {
if user, err := goth.CurrentUser(r); err != nil {
fmt.Fprint(w, "User not logged in, please authenticate before visiting this page.")
return
}
fmt.Fprint(w, "Hello, %s", user.email)
}
```
|
Goth is a web authentication system written in Go. With Goth, you get out-of-
the-box user sign in, sign up, and sign out functionality to kick off building
your web app.
## Installation
```
go get github.com/jroes/goth
```
## Usage
The following example registers a handler for an admin section that would be
able to retrieve information about the currently logged in user, and a pattern
that will handle the standard sign in, sign out, and sign up functionality.
```go
package main
import (
"fmt"
"net/http"
)
import (
"github.com/jroes/goth"
)
var authHandler = goth.DefaultAuthHandler
func main() {
http.Handle("/auth/", authHandler)
http.HandleFunc("/", helloUserHandler)
// Please use ListenAndServeTLS in production.
http.ListenAndServe(":8080", nil)
}
func helloUserHandler(w http.ResponseWriter, r *http.Request) {
currentUser, ok := authHandler.CurrentUser(r)
if ok {
fmt.Fprintf(w, "Hello, %s!", currentUser.Email)
} else {
fmt.Fprintf(w, "Hello, guest!")
}
}
```
| Update readme to use simple example | Update readme to use simple example
| Markdown | mit | jroes/goth | markdown | ## Code Before:
Goth is a web authentication system written in Go. With Goth, you get out-of-
the-box user sign in, sign up, and sign out functionality to kick off building
your web app.
## Installation
```
go get github.com/jroes/goth
```
## Usage
The following example registers a handler for an admin section that would be
able to retrieve information about the currently logged in user, and a pattern
that will handle the standard sign in, sign out, and sign up functionality.
```go
package main
import (
"fmt"
"github.com/jroes/goth"
"net/http"
)
func main() {
authHandler := goth.AuthHandler{RoutePath: "/auth/", TemplatePath: "tmpl/", AfterSignupURL: "/", AfterSigninURL: "/"}
http.HandleFunc("/admin/", adminHandler)
http.Handle("/auth/", authHandler)
// Please use ListenAndServeTLS in production.
http.ListenAndServe(":8080", nil)
}
func adminHandler(w http.ResponseWriter, r *http.Request) {
if user, err := goth.CurrentUser(r); err != nil {
fmt.Fprint(w, "User not logged in, please authenticate before visiting this page.")
return
}
fmt.Fprint(w, "Hello, %s", user.email)
}
```
## Instruction:
Update readme to use simple example
## Code After:
Goth is a web authentication system written in Go. With Goth, you get out-of-
the-box user sign in, sign up, and sign out functionality to kick off building
your web app.
## Installation
```
go get github.com/jroes/goth
```
## Usage
The following example registers a handler for an admin section that would be
able to retrieve information about the currently logged in user, and a pattern
that will handle the standard sign in, sign out, and sign up functionality.
```go
package main
import (
"fmt"
"net/http"
)
import (
"github.com/jroes/goth"
)
var authHandler = goth.DefaultAuthHandler
func main() {
http.Handle("/auth/", authHandler)
http.HandleFunc("/", helloUserHandler)
// Please use ListenAndServeTLS in production.
http.ListenAndServe(":8080", nil)
}
func helloUserHandler(w http.ResponseWriter, r *http.Request) {
currentUser, ok := authHandler.CurrentUser(r)
if ok {
fmt.Fprintf(w, "Hello, %s!", currentUser.Email)
} else {
fmt.Fprintf(w, "Hello, guest!")
}
}
```
|
Goth is a web authentication system written in Go. With Goth, you get out-of-
the-box user sign in, sign up, and sign out functionality to kick off building
your web app.
## Installation
```
go get github.com/jroes/goth
```
## Usage
The following example registers a handler for an admin section that would be
able to retrieve information about the currently logged in user, and a pattern
that will handle the standard sign in, sign out, and sign up functionality.
```go
package main
import (
+ "fmt"
- "fmt"
- "github.com/jroes/goth"
- "net/http"
? ^^^^
+ "net/http"
? ^
)
+ import (
+ "github.com/jroes/goth"
+ )
+
+ var authHandler = goth.DefaultAuthHandler
+
func main() {
- authHandler := goth.AuthHandler{RoutePath: "/auth/", TemplatePath: "tmpl/", AfterSignupURL: "/", AfterSigninURL: "/"}
- http.HandleFunc("/admin/", adminHandler)
- http.Handle("/auth/", authHandler)
? ^^^^
+ http.Handle("/auth/", authHandler)
? ^
+ http.HandleFunc("/", helloUserHandler)
- // Please use ListenAndServeTLS in production.
? ^^^^
+ // Please use ListenAndServeTLS in production.
? ^
- http.ListenAndServe(":8080", nil)
? ^^^^
+ http.ListenAndServe(":8080", nil)
? ^
}
- func adminHandler(w http.ResponseWriter, r *http.Request) {
? ^^^^^
+ func helloUserHandler(w http.ResponseWriter, r *http.Request) {
? ^^^^^^^^^
+ currentUser, ok := authHandler.CurrentUser(r)
+ if ok {
- if user, err := goth.CurrentUser(r); err != nil {
- fmt.Fprint(w, "User not logged in, please authenticate before visiting this page.")
- return
- }
-
- fmt.Fprint(w, "Hello, %s", user.email)
? ^^^^ ^
+ fmt.Fprintf(w, "Hello, %s!", currentUser.Email)
? ^^ + + + ++++++ ^
+ } else {
+ fmt.Fprintf(w, "Hello, guest!")
+ }
}
``` | 34 | 0.809524 | 19 | 15 |
7a2db3a6dbc21ce89b2914e08b9f9452220ec263 | README.md | README.md | JUST FOOD FACTS
===============
Show nutritional information about your food.
|
Show nutritional information about your food, using a simple and neat user interface.
## Prerequisites
- Node JS 0.10
- NPM 1.2
## Installation
Install grunt-cli and bower and setup local app:
$ npm -g install grunt-cli bower
$ npm install
## Usage
Launch development environment:
$ grunt server
Launch frontend unit tests:
$ grunt karma:unit
Launch backend unit tests:
$ grunt test-back
Build the application:
$ grunt build optimize
Launch the application for production server:
$ node ./server/server.js &> jff-prod.log & | Add installation and usage information | Add installation and usage information
| Markdown | mit | geekarist/just-food-facts,geekarist/just-food-facts | markdown | ## Code Before:
JUST FOOD FACTS
===============
Show nutritional information about your food.
## Instruction:
Add installation and usage information
## Code After:
Show nutritional information about your food, using a simple and neat user interface.
## Prerequisites
- Node JS 0.10
- NPM 1.2
## Installation
Install grunt-cli and bower and setup local app:
$ npm -g install grunt-cli bower
$ npm install
## Usage
Launch development environment:
$ grunt server
Launch frontend unit tests:
$ grunt karma:unit
Launch backend unit tests:
$ grunt test-back
Build the application:
$ grunt build optimize
Launch the application for production server:
$ node ./server/server.js &> jff-prod.log & | - JUST FOOD FACTS
- ===============
- Show nutritional information about your food.
+ Show nutritional information about your food, using a simple and neat user interface.
+
+ ## Prerequisites
+
+ - Node JS 0.10
+ - NPM 1.2
+
+ ## Installation
+
+ Install grunt-cli and bower and setup local app:
+
+ $ npm -g install grunt-cli bower
+ $ npm install
+
+ ## Usage
+
+ Launch development environment:
+
+ $ grunt server
+
+ Launch frontend unit tests:
+
+ $ grunt karma:unit
+
+ Launch backend unit tests:
+
+ $ grunt test-back
+
+ Build the application:
+
+ $ grunt build optimize
+
+ Launch the application for production server:
+
+ $ node ./server/server.js &> jff-prod.log & | 38 | 9.5 | 35 | 3 |
1a5f415b9a050fb54ddfda2f8a090b617f9abb43 | README.md | README.md |
A new app a day will keep the doctor away. To become sufficiently good at anything you need practice, lots of it. This is me learning iOS development from no prior experience.
- Day 1: Hello World |
A new app a day will keep the doctor away. To become sufficiently good at anything you need practice, lots of it. This is me learning iOS development from no prior experience.
- Day 1: Hello World
- Day 2: Like | Add day 2 to readme | Add day 2 to readme
| Markdown | mit | grant/20-Apps,Suninus/20-Apps | markdown | ## Code Before:
A new app a day will keep the doctor away. To become sufficiently good at anything you need practice, lots of it. This is me learning iOS development from no prior experience.
- Day 1: Hello World
## Instruction:
Add day 2 to readme
## Code After:
A new app a day will keep the doctor away. To become sufficiently good at anything you need practice, lots of it. This is me learning iOS development from no prior experience.
- Day 1: Hello World
- Day 2: Like |
A new app a day will keep the doctor away. To become sufficiently good at anything you need practice, lots of it. This is me learning iOS development from no prior experience.
- Day 1: Hello World
+ - Day 2: Like | 1 | 0.25 | 1 | 0 |
07010a46b0f34bf7d0050bd2114dff3ddd72e5fe | README.mkd | README.mkd | Retro Gauge Arduino Source Code
================================
## Dependencies
Besides a standard Arduino development environment, the firmware also requires
the [SwitecX25 library](https://github.com/clearwater/SwitecX25) to drive the
stepper motor.
This library is based on [Guy Carpenter's Gaugette project][gaugette].
[gaugette]: http://guy.carpenter.id.au/gaugette/about/
| Retro Gauge Arduino Source Code
================================
## Dependencies
Run this from the top level directory to download the dependencies:
$ git submodule update --init
Besides a standard Arduino development environment, the firmware also requires
the [SwitecX25 library](https://github.com/clearwater/SwitecX25) to drive the
stepper motor.
This library is based on [Guy Carpenter's Gaugette project][gaugette].
[gaugette]: http://guy.carpenter.id.au/gaugette/about/
## Compiling with Makefile
After updating the submodules, run `make` in the firmware directory to compile.
Run `make upload` to flash an attached gauge.
The Makefile will attempt to automatically determine the name of the attached
port, but you may need to specify it manually with `MONITOR_PORT` if it doesn't
work. For example, if your device shows up as /dev/ttyUSB1:
MONITOR_PORT=/dev/ttyUSB1 make upload
| Add some basic docs on using Makefile. | Add some basic docs on using Makefile.
| Markdown | bsd-3-clause | openxc-retro-gauge/retro-gauge-firmware,openxc-retro-gauge/retro-gauge-firmware | markdown | ## Code Before:
Retro Gauge Arduino Source Code
================================
## Dependencies
Besides a standard Arduino development environment, the firmware also requires
the [SwitecX25 library](https://github.com/clearwater/SwitecX25) to drive the
stepper motor.
This library is based on [Guy Carpenter's Gaugette project][gaugette].
[gaugette]: http://guy.carpenter.id.au/gaugette/about/
## Instruction:
Add some basic docs on using Makefile.
## Code After:
Retro Gauge Arduino Source Code
================================
## Dependencies
Run this from the top level directory to download the dependencies:
$ git submodule update --init
Besides a standard Arduino development environment, the firmware also requires
the [SwitecX25 library](https://github.com/clearwater/SwitecX25) to drive the
stepper motor.
This library is based on [Guy Carpenter's Gaugette project][gaugette].
[gaugette]: http://guy.carpenter.id.au/gaugette/about/
## Compiling with Makefile
After updating the submodules, run `make` in the firmware directory to compile.
Run `make upload` to flash an attached gauge.
The Makefile will attempt to automatically determine the name of the attached
port, but you may need to specify it manually with `MONITOR_PORT` if it doesn't
work. For example, if your device shows up as /dev/ttyUSB1:
MONITOR_PORT=/dev/ttyUSB1 make upload
| Retro Gauge Arduino Source Code
================================
## Dependencies
+
+ Run this from the top level directory to download the dependencies:
+
+ $ git submodule update --init
Besides a standard Arduino development environment, the firmware also requires
the [SwitecX25 library](https://github.com/clearwater/SwitecX25) to drive the
stepper motor.
This library is based on [Guy Carpenter's Gaugette project][gaugette].
[gaugette]: http://guy.carpenter.id.au/gaugette/about/
+
+ ## Compiling with Makefile
+
+ After updating the submodules, run `make` in the firmware directory to compile.
+ Run `make upload` to flash an attached gauge.
+
+ The Makefile will attempt to automatically determine the name of the attached
+ port, but you may need to specify it manually with `MONITOR_PORT` if it doesn't
+ work. For example, if your device shows up as /dev/ttyUSB1:
+
+ MONITOR_PORT=/dev/ttyUSB1 make upload | 15 | 1.25 | 15 | 0 |
c8aed75afd9b23a339853423d916c38ddfe42a99 | examples/package.json | examples/package.json | {
"name": "react-image-webp",
"main": "dist/index.js",
"scripts": {
"build": "webpack --progress --color -p --config ./webpack.config.js"
},
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-core": "^6.17.0",
"babel-eslint": "^7.0.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"webpack": "^3.1.0"
},
"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.6.1",
"react-image-webp": "^0.2.2",
"url-loader": "^0.5.9"
}
}
| {
"name": "react-image-webp",
"main": "dist/index.js",
"scripts": {
"build": "webpack --progress --color -p --config ./webpack.config.js"
},
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-core": "^6.17.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"webpack": "^3.1.0"
},
"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.6.1",
"react-image-webp": "^0.2.2",
"url-loader": "^0.5.9"
}
}
| Remove depend from example too | Remove depend from example too
| JSON | mit | DonRai/react-image-webp | json | ## Code Before:
{
"name": "react-image-webp",
"main": "dist/index.js",
"scripts": {
"build": "webpack --progress --color -p --config ./webpack.config.js"
},
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-core": "^6.17.0",
"babel-eslint": "^7.0.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"webpack": "^3.1.0"
},
"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.6.1",
"react-image-webp": "^0.2.2",
"url-loader": "^0.5.9"
}
}
## Instruction:
Remove depend from example too
## Code After:
{
"name": "react-image-webp",
"main": "dist/index.js",
"scripts": {
"build": "webpack --progress --color -p --config ./webpack.config.js"
},
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-core": "^6.17.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"webpack": "^3.1.0"
},
"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.6.1",
"react-image-webp": "^0.2.2",
"url-loader": "^0.5.9"
}
}
| {
"name": "react-image-webp",
"main": "dist/index.js",
"scripts": {
"build": "webpack --progress --color -p --config ./webpack.config.js"
},
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-core": "^6.17.0",
- "babel-eslint": "^7.0.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"webpack": "^3.1.0"
},
"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.6.1",
"react-image-webp": "^0.2.2",
"url-loader": "^0.5.9"
}
} | 1 | 0.043478 | 0 | 1 |
6e5f0d3c527c2994156537cd181b41bbadcfe718 | README.md | README.md | Electrical AMU Android App
===
![App Logo] (https://raw.githubusercontent.com/iamareebjamal/electrical-amu/master/ic_launcher_web.png)
The Official Electrical Department, AMU application for Android Devices
###Features
- Faculty List
- About Department
- Contact and Feedback Option
- Notifications about the power management and events
- etc
| []()
[](https://opensource.org/licenses/Apache-2.0)
> The Official Electrical Department, AMU application for Android Devices

### Features
- Faculty List
- About Department
- Contact and Feedback Option
- Notifications about the power management and events
- etc
### Author
[@iamareebjamal](https://github.com/iamareebjamal)
Divya Prakash Varshney [@divs4debu](https://github.com/divs4debu)
| Add codacy grade in ReadMe | chore: Add codacy grade in ReadMe | Markdown | apache-2.0 | iamareebjamal/electrical-amu | markdown | ## Code Before:
Electrical AMU Android App
===
![App Logo] (https://raw.githubusercontent.com/iamareebjamal/electrical-amu/master/ic_launcher_web.png)
The Official Electrical Department, AMU application for Android Devices
###Features
- Faculty List
- About Department
- Contact and Feedback Option
- Notifications about the power management and events
- etc
## Instruction:
chore: Add codacy grade in ReadMe
## Code After:
[]()
[](https://opensource.org/licenses/Apache-2.0)
> The Official Electrical Department, AMU application for Android Devices

### Features
- Faculty List
- About Department
- Contact and Feedback Option
- Notifications about the power management and events
- etc
### Author
[@iamareebjamal](https://github.com/iamareebjamal)
Divya Prakash Varshney [@divs4debu](https://github.com/divs4debu)
| - Electrical AMU Android App
- ===
+ []()
+ [](https://opensource.org/licenses/Apache-2.0)
+ > The Official Electrical Department, AMU application for Android Devices
- ![App Logo] (https://raw.githubusercontent.com/iamareebjamal/electrical-amu/master/ic_launcher_web.png)
+ 
- The Official Electrical Department, AMU application for Android Devices
-
- ###Features
+ ### Features
? +
- Faculty List
- About Department
- Contact and Feedback Option
- Notifications about the power management and events
- etc
+ ### Author
+ [@iamareebjamal](https://github.com/iamareebjamal)
+ Divya Prakash Varshney [@divs4debu](https://github.com/divs4debu) | 14 | 0.933333 | 8 | 6 |
95de02942f011785b43850121241514ed95ba167 | pkgs/servers/mail/mailman/wrapped.nix | pkgs/servers/mail/mailman/wrapped.nix | { runCommand, lib, makeWrapper, python3
, archivers ? [ python3.pkgs.mailman-hyperkitty ]
}:
let
inherit (python3.pkgs) makePythonPath mailman;
in
runCommand "${mailman.name}-wrapped" {
inherit (mailman) meta;
buildInputs = [ makeWrapper ];
passthru = mailman.passthru // { unwrapped = mailman; };
} ''
mkdir -p "$out/bin"
cd "${mailman}/bin"
for exe in *; do
makeWrapper "${mailman}/bin/$exe" "$out/bin/$exe" \
--set PYTHONPATH ${makePythonPath ([ mailman python3.pkgs.urllib3 ] ++ archivers)}
done
''
| { runCommand, lib, makeWrapper, python3
, archivers ? [ python3.pkgs.mailman-hyperkitty ]
}:
let
inherit (python3.pkgs) makePythonPath mailman;
in
runCommand "${mailman.name}-wrapped" {
inherit (mailman) meta;
buildInputs = [ makeWrapper ];
passthru = mailman.passthru // { unwrapped = mailman; };
} ''
mkdir -p "$out/bin"
cd "${mailman}/bin"
for exe in *; do
makeWrapper "${mailman}/bin/$exe" "$out/bin/$exe" \
--set PYTHONPATH ${makePythonPath ([ mailman ] ++ archivers)}
done
''
| Revert "mailman-wrapper: crazy hack to work around the missing urllib3 dependency" | Revert "mailman-wrapper: crazy hack to work around the missing urllib3 dependency"
This reverts commit ce6b2419be6e16cc6b9096c99798a0d365b16486, which
was unnecessary (mailman worked just fine on its parent commit).
See #79222.
| Nix | mit | NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
{ runCommand, lib, makeWrapper, python3
, archivers ? [ python3.pkgs.mailman-hyperkitty ]
}:
let
inherit (python3.pkgs) makePythonPath mailman;
in
runCommand "${mailman.name}-wrapped" {
inherit (mailman) meta;
buildInputs = [ makeWrapper ];
passthru = mailman.passthru // { unwrapped = mailman; };
} ''
mkdir -p "$out/bin"
cd "${mailman}/bin"
for exe in *; do
makeWrapper "${mailman}/bin/$exe" "$out/bin/$exe" \
--set PYTHONPATH ${makePythonPath ([ mailman python3.pkgs.urllib3 ] ++ archivers)}
done
''
## Instruction:
Revert "mailman-wrapper: crazy hack to work around the missing urllib3 dependency"
This reverts commit ce6b2419be6e16cc6b9096c99798a0d365b16486, which
was unnecessary (mailman worked just fine on its parent commit).
See #79222.
## Code After:
{ runCommand, lib, makeWrapper, python3
, archivers ? [ python3.pkgs.mailman-hyperkitty ]
}:
let
inherit (python3.pkgs) makePythonPath mailman;
in
runCommand "${mailman.name}-wrapped" {
inherit (mailman) meta;
buildInputs = [ makeWrapper ];
passthru = mailman.passthru // { unwrapped = mailman; };
} ''
mkdir -p "$out/bin"
cd "${mailman}/bin"
for exe in *; do
makeWrapper "${mailman}/bin/$exe" "$out/bin/$exe" \
--set PYTHONPATH ${makePythonPath ([ mailman ] ++ archivers)}
done
''
| { runCommand, lib, makeWrapper, python3
, archivers ? [ python3.pkgs.mailman-hyperkitty ]
}:
let
inherit (python3.pkgs) makePythonPath mailman;
in
runCommand "${mailman.name}-wrapped" {
inherit (mailman) meta;
buildInputs = [ makeWrapper ];
passthru = mailman.passthru // { unwrapped = mailman; };
} ''
mkdir -p "$out/bin"
cd "${mailman}/bin"
for exe in *; do
makeWrapper "${mailman}/bin/$exe" "$out/bin/$exe" \
- --set PYTHONPATH ${makePythonPath ([ mailman python3.pkgs.urllib3 ] ++ archivers)}
? ---------------------
+ --set PYTHONPATH ${makePythonPath ([ mailman ] ++ archivers)}
done
'' | 2 | 0.1 | 1 | 1 |
21604e1150f3a02108df6f0a0c690d18513c2a30 | src/arachnida/core.clj | src/arachnida/core.clj | (ns arachnida.core)
(require '[clojure.java.jdbc :as jdbc])
(require '[clojure.pprint :as pprint])
(require '[hozumi.rm-rf :as rm-rf])
(require '[ring.adapter.jetty :as jetty])
(require '[ring.middleware.params :as http-params])
(require '[ring.util.response :as http-response])
(require '[ring.middleware.cookies :as cookies])
(require '[hiccup.page :as page])
(require '[hiccup.form :as form])
(require '[arachnida.db-spec :as db-spec])
(require '[arachnida.db-interface :as db-interface])
(require '[arachnida.git-data-fetcher :as git-data-fetcher])
(defn -main
[& args]
(git-data-fetcher/process))
| (ns arachnida.core)
(require '[clojure.tools.cli :as cli])
(require '[clojure.java.jdbc :as jdbc])
(require '[clojure.pprint :as pprint])
(require '[hozumi.rm-rf :as rm-rf])
(require '[ring.adapter.jetty :as jetty])
(require '[ring.middleware.params :as http-params])
(require '[ring.util.response :as http-response])
(require '[ring.middleware.cookies :as cookies])
(require '[hiccup.page :as page])
(require '[hiccup.form :as form])
(require '[arachnida.db-spec :as db-spec])
(require '[arachnida.db-interface :as db-interface])
(require '[arachnida.git-data-fetcher :as git-data-fetcher])
(def cli-options
[["-h" "--help" "help" :id :help]
["-g" "--git" "fetch GIT statistic" :id :git]
["-s" "--server" "run as HTTP server" :id :server]])
(defn show-help
[]
(println "Usage:")
(println "-h" "--help help")
(println "-g" "--git fetch GIT statistic")
(println "-s" "--server run as HTTP server"))
(defn show-error
[]
(println "Unknown command line option!")
(show-help))
(defn start-server
[]
)
(defn -main
[& args]
(let [all-options (cli/parse-opts args cli-options)
options (all-options :options)
show-help? (options :help)
git? (options :git)
server? (options :server)]
(cond show-help? (show-help)
git? (git-data-fetcher/process)
server? (start-server)
:else (show-error))))
| Support for handling basic CLI options: -h, -g, -s etc. | Support for handling basic CLI options: -h, -g, -s etc.
| Clojure | epl-1.0 | tisnik/arachnida,tisnik/arachnida | clojure | ## Code Before:
(ns arachnida.core)
(require '[clojure.java.jdbc :as jdbc])
(require '[clojure.pprint :as pprint])
(require '[hozumi.rm-rf :as rm-rf])
(require '[ring.adapter.jetty :as jetty])
(require '[ring.middleware.params :as http-params])
(require '[ring.util.response :as http-response])
(require '[ring.middleware.cookies :as cookies])
(require '[hiccup.page :as page])
(require '[hiccup.form :as form])
(require '[arachnida.db-spec :as db-spec])
(require '[arachnida.db-interface :as db-interface])
(require '[arachnida.git-data-fetcher :as git-data-fetcher])
(defn -main
[& args]
(git-data-fetcher/process))
## Instruction:
Support for handling basic CLI options: -h, -g, -s etc.
## Code After:
(ns arachnida.core)
(require '[clojure.tools.cli :as cli])
(require '[clojure.java.jdbc :as jdbc])
(require '[clojure.pprint :as pprint])
(require '[hozumi.rm-rf :as rm-rf])
(require '[ring.adapter.jetty :as jetty])
(require '[ring.middleware.params :as http-params])
(require '[ring.util.response :as http-response])
(require '[ring.middleware.cookies :as cookies])
(require '[hiccup.page :as page])
(require '[hiccup.form :as form])
(require '[arachnida.db-spec :as db-spec])
(require '[arachnida.db-interface :as db-interface])
(require '[arachnida.git-data-fetcher :as git-data-fetcher])
(def cli-options
[["-h" "--help" "help" :id :help]
["-g" "--git" "fetch GIT statistic" :id :git]
["-s" "--server" "run as HTTP server" :id :server]])
(defn show-help
[]
(println "Usage:")
(println "-h" "--help help")
(println "-g" "--git fetch GIT statistic")
(println "-s" "--server run as HTTP server"))
(defn show-error
[]
(println "Unknown command line option!")
(show-help))
(defn start-server
[]
)
(defn -main
[& args]
(let [all-options (cli/parse-opts args cli-options)
options (all-options :options)
show-help? (options :help)
git? (options :git)
server? (options :server)]
(cond show-help? (show-help)
git? (git-data-fetcher/process)
server? (start-server)
:else (show-error))))
| (ns arachnida.core)
+
+ (require '[clojure.tools.cli :as cli])
(require '[clojure.java.jdbc :as jdbc])
(require '[clojure.pprint :as pprint])
(require '[hozumi.rm-rf :as rm-rf])
(require '[ring.adapter.jetty :as jetty])
(require '[ring.middleware.params :as http-params])
(require '[ring.util.response :as http-response])
(require '[ring.middleware.cookies :as cookies])
(require '[hiccup.page :as page])
(require '[hiccup.form :as form])
(require '[arachnida.db-spec :as db-spec])
(require '[arachnida.db-interface :as db-interface])
(require '[arachnida.git-data-fetcher :as git-data-fetcher])
+ (def cli-options
+ [["-h" "--help" "help" :id :help]
+ ["-g" "--git" "fetch GIT statistic" :id :git]
+ ["-s" "--server" "run as HTTP server" :id :server]])
+
+ (defn show-help
+ []
+ (println "Usage:")
+ (println "-h" "--help help")
+ (println "-g" "--git fetch GIT statistic")
+ (println "-s" "--server run as HTTP server"))
+
+ (defn show-error
+ []
+ (println "Unknown command line option!")
+ (show-help))
+
+ (defn start-server
+ []
+ )
+
(defn -main
[& args]
- (git-data-fetcher/process))
+ (let [all-options (cli/parse-opts args cli-options)
+ options (all-options :options)
+ show-help? (options :help)
+ git? (options :git)
+ server? (options :server)]
+ (cond show-help? (show-help)
+ git? (git-data-fetcher/process)
+ server? (start-server)
+ :else (show-error))))
| 33 | 1.375 | 32 | 1 |
20c77152d1b81fd3ab42d9e563bb7170ef96906c | tools/misc/python/test-phenodata-output.py | tools/misc/python/test-phenodata-output.py |
with open('output.tsv', 'w') as f:
f.write('test output\n')
f.write('test output\n')
with open('phenodata.tsv', 'w') as f:
f.write('sample original_name chiptype group\n')
f.write('microarray001.cel cancerGSM11814.cel hgu133ahsentrezg.db 1\n')
f.write('microarray002.cel cancerGSM11830.cel hgu133ahsentrezg.db 2\n')
|
with open('output.tsv', 'w') as f:
f.write('identifier chip.sample1\n')
f.write('test output\n')
with open('phenodata.tsv', 'w') as f:
f.write('dataset column sample chiptype experiment group library_size\n')
f.write('ngs-data-table.tsv chip.sample000.tsv sample000.tsv not applicable rna_seq \n')
f.write('ngs-data-table.tsv chip.sample001.tsv sample001.tsv not applicable rna_seq \n')
| Make output similar to Define NGS experiment tool | Make output similar to Define NGS experiment tool | Python | mit | chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools | python | ## Code Before:
with open('output.tsv', 'w') as f:
f.write('test output\n')
f.write('test output\n')
with open('phenodata.tsv', 'w') as f:
f.write('sample original_name chiptype group\n')
f.write('microarray001.cel cancerGSM11814.cel hgu133ahsentrezg.db 1\n')
f.write('microarray002.cel cancerGSM11830.cel hgu133ahsentrezg.db 2\n')
## Instruction:
Make output similar to Define NGS experiment tool
## Code After:
with open('output.tsv', 'w') as f:
f.write('identifier chip.sample1\n')
f.write('test output\n')
with open('phenodata.tsv', 'w') as f:
f.write('dataset column sample chiptype experiment group library_size\n')
f.write('ngs-data-table.tsv chip.sample000.tsv sample000.tsv not applicable rna_seq \n')
f.write('ngs-data-table.tsv chip.sample001.tsv sample001.tsv not applicable rna_seq \n')
|
with open('output.tsv', 'w') as f:
- f.write('test output\n')
+ f.write('identifier chip.sample1\n')
f.write('test output\n')
with open('phenodata.tsv', 'w') as f:
- f.write('sample original_name chiptype group\n')
- f.write('microarray001.cel cancerGSM11814.cel hgu133ahsentrezg.db 1\n')
- f.write('microarray002.cel cancerGSM11830.cel hgu133ahsentrezg.db 2\n')
+ f.write('dataset column sample chiptype experiment group library_size\n')
+ f.write('ngs-data-table.tsv chip.sample000.tsv sample000.tsv not applicable rna_seq \n')
+ f.write('ngs-data-table.tsv chip.sample001.tsv sample001.tsv not applicable rna_seq \n')
+ | 9 | 1 | 5 | 4 |
4585c5d0a69b190f55486a2cfb94a5c361bd4365 | tests/pytests/functional/states/test_npm.py | tests/pytests/functional/states/test_npm.py | import pytest
from salt.exceptions import CommandExecutionError
@pytest.fixture(scope="module", autouse=True)
def install_npm(sminion):
try:
sminion.functions.pkg.install("npm")
except CommandExecutionError:
pytest.skip("Unable to install npm")
@pytest.mark.slow_test
@pytest.mark.destructive_test
@pytest.mark.requires_network
def test_removed_installed_cycle(sminion):
project_version = "pm2@5.1.0"
success = sminion.functions.npm.uninstall("pm2")
assert success, "Unable to uninstall pm2 in prep for tests"
ret = next(
iter(
sminion.functions.state.single(
"npm.installed", name=project_version
).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.installed " + project_version + ret["comment"]
ret = next(
iter(
sminion.functions.state.single("npm.removed", name=project_version).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.removed " + project_version
| import pytest
from salt.exceptions import CommandExecutionError
@pytest.fixture(scope="module", autouse=True)
def install_npm(sminion):
try:
sminion.functions.pkg.install("npm")
# Just name the thing we're looking for
sminion.functions.npm # pylint: disable=pointless-statement
except (CommandExecutionError, AttributeError):
pytest.skip("Unable to install npm")
@pytest.mark.slow_test
@pytest.mark.destructive_test
@pytest.mark.requires_network
def test_removed_installed_cycle(sminion):
project_version = "pm2@5.1.0"
success = sminion.functions.npm.uninstall("pm2")
assert success, "Unable to uninstall pm2 in prep for tests"
ret = next(
iter(
sminion.functions.state.single(
"npm.installed", name=project_version
).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.installed " + project_version + ret["comment"]
ret = next(
iter(
sminion.functions.state.single("npm.removed", name=project_version).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.removed " + project_version
| Check npm name as well | Check npm name as well
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | python | ## Code Before:
import pytest
from salt.exceptions import CommandExecutionError
@pytest.fixture(scope="module", autouse=True)
def install_npm(sminion):
try:
sminion.functions.pkg.install("npm")
except CommandExecutionError:
pytest.skip("Unable to install npm")
@pytest.mark.slow_test
@pytest.mark.destructive_test
@pytest.mark.requires_network
def test_removed_installed_cycle(sminion):
project_version = "pm2@5.1.0"
success = sminion.functions.npm.uninstall("pm2")
assert success, "Unable to uninstall pm2 in prep for tests"
ret = next(
iter(
sminion.functions.state.single(
"npm.installed", name=project_version
).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.installed " + project_version + ret["comment"]
ret = next(
iter(
sminion.functions.state.single("npm.removed", name=project_version).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.removed " + project_version
## Instruction:
Check npm name as well
## Code After:
import pytest
from salt.exceptions import CommandExecutionError
@pytest.fixture(scope="module", autouse=True)
def install_npm(sminion):
try:
sminion.functions.pkg.install("npm")
# Just name the thing we're looking for
sminion.functions.npm # pylint: disable=pointless-statement
except (CommandExecutionError, AttributeError):
pytest.skip("Unable to install npm")
@pytest.mark.slow_test
@pytest.mark.destructive_test
@pytest.mark.requires_network
def test_removed_installed_cycle(sminion):
project_version = "pm2@5.1.0"
success = sminion.functions.npm.uninstall("pm2")
assert success, "Unable to uninstall pm2 in prep for tests"
ret = next(
iter(
sminion.functions.state.single(
"npm.installed", name=project_version
).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.installed " + project_version + ret["comment"]
ret = next(
iter(
sminion.functions.state.single("npm.removed", name=project_version).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.removed " + project_version
| import pytest
from salt.exceptions import CommandExecutionError
@pytest.fixture(scope="module", autouse=True)
def install_npm(sminion):
try:
sminion.functions.pkg.install("npm")
+ # Just name the thing we're looking for
+ sminion.functions.npm # pylint: disable=pointless-statement
- except CommandExecutionError:
+ except (CommandExecutionError, AttributeError):
? + +++++++++++++++++
pytest.skip("Unable to install npm")
@pytest.mark.slow_test
@pytest.mark.destructive_test
@pytest.mark.requires_network
def test_removed_installed_cycle(sminion):
project_version = "pm2@5.1.0"
success = sminion.functions.npm.uninstall("pm2")
assert success, "Unable to uninstall pm2 in prep for tests"
ret = next(
iter(
sminion.functions.state.single(
"npm.installed", name=project_version
).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.installed " + project_version + ret["comment"]
ret = next(
iter(
sminion.functions.state.single("npm.removed", name=project_version).values()
)
)
success = ret["result"]
assert success, "Failed to states.npm.removed " + project_version | 4 | 0.108108 | 3 | 1 |
4c54e21bfaf52047e4d0790623197df84a7410e4 | src/sys/utsname.c | src/sys/utsname.c | /* $Id$ */
/* Copyright (c) 2006 The DeforaOS Project */
#include "../syscalls.h"
#include "sys/utsname.h"
/* uname */
#ifndef __NetBSD__
syscall1(int, uname, struct utsname *, utsname);
#endif
| /* $Id$ */
/* Copyright (c) 2007 The DeforaOS Project */
#include "../syscalls.h"
#include "sys/utsname.h"
/* uname */
#if !defined(__NetBSD__) || defined(NETBSD_USE_LINUX_EMULATION)
syscall1(int, uname, struct utsname *, utsname);
#endif
| Allow uname() with linux emulation on NetBSD | Allow uname() with linux emulation on NetBSD
| C | bsd-2-clause | DeforaOS/libc,DeforaOS/libc | c | ## Code Before:
/* $Id$ */
/* Copyright (c) 2006 The DeforaOS Project */
#include "../syscalls.h"
#include "sys/utsname.h"
/* uname */
#ifndef __NetBSD__
syscall1(int, uname, struct utsname *, utsname);
#endif
## Instruction:
Allow uname() with linux emulation on NetBSD
## Code After:
/* $Id$ */
/* Copyright (c) 2007 The DeforaOS Project */
#include "../syscalls.h"
#include "sys/utsname.h"
/* uname */
#if !defined(__NetBSD__) || defined(NETBSD_USE_LINUX_EMULATION)
syscall1(int, uname, struct utsname *, utsname);
#endif
| /* $Id$ */
- /* Copyright (c) 2006 The DeforaOS Project */
? ^
+ /* Copyright (c) 2007 The DeforaOS Project */
? ^
#include "../syscalls.h"
#include "sys/utsname.h"
/* uname */
- #ifndef __NetBSD__
+ #if !defined(__NetBSD__) || defined(NETBSD_USE_LINUX_EMULATION)
syscall1(int, uname, struct utsname *, utsname);
#endif | 4 | 0.307692 | 2 | 2 |
0772359ae7570d8d54921bae87dd506c33ff3c89 | .travis.yml | .travis.yml | script: bundle exec rspec
language: ruby
rvm: 2.1.5
before_install:
- cd $TRAVIS_BUILD_DIR/db && wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz && gunzip GeoLite2-City.mmdb.gz
- cd $TRAVIS_BUILD_DIR
install: bundle install --deployment --jobs 4
cache:
directories:
- vendor/bundle
before_script:
- unset RACK_ENV
script: bundle exec rspec
| language: ruby
rvm: 2.1.5
before_install:
- cd $TRAVIS_BUILD_DIR/db && wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
&& gunzip GeoLite2-City.mmdb.gz
- cd $TRAVIS_BUILD_DIR
install: bundle install --deployment --jobs 4
cache:
directories:
- vendor/bundle
before_script:
- unset RACK_ENV
script: bundle exec rspec
notifications:
flowdock:
secure: MMpQnoJ0m0vAVuQ+2T1i/i4eL6zSRmEma7cX6sCbbCcGVL9IAGsnC3UC2bMsO8pkadD5mXz9cX9JVRpzuto6DhWlvmSTw8zsHbjwEYsD5MlAkhApN2jq/AX3cLZmOTn6i2ZzrQnHhhaOgygnRWHaqT1sa7rQKlbrKOaRRKCFAGM=
| Add Flowdock notifications from Travis | Add Flowdock notifications from Travis
| YAML | mit | bukowskis/meter | yaml | ## Code Before:
script: bundle exec rspec
language: ruby
rvm: 2.1.5
before_install:
- cd $TRAVIS_BUILD_DIR/db && wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz && gunzip GeoLite2-City.mmdb.gz
- cd $TRAVIS_BUILD_DIR
install: bundle install --deployment --jobs 4
cache:
directories:
- vendor/bundle
before_script:
- unset RACK_ENV
script: bundle exec rspec
## Instruction:
Add Flowdock notifications from Travis
## Code After:
language: ruby
rvm: 2.1.5
before_install:
- cd $TRAVIS_BUILD_DIR/db && wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
&& gunzip GeoLite2-City.mmdb.gz
- cd $TRAVIS_BUILD_DIR
install: bundle install --deployment --jobs 4
cache:
directories:
- vendor/bundle
before_script:
- unset RACK_ENV
script: bundle exec rspec
notifications:
flowdock:
secure: MMpQnoJ0m0vAVuQ+2T1i/i4eL6zSRmEma7cX6sCbbCcGVL9IAGsnC3UC2bMsO8pkadD5mXz9cX9JVRpzuto6DhWlvmSTw8zsHbjwEYsD5MlAkhApN2jq/AX3cLZmOTn6i2ZzrQnHhhaOgygnRWHaqT1sa7rQKlbrKOaRRKCFAGM=
| - script: bundle exec rspec
language: ruby
-
rvm: 2.1.5
-
before_install:
- - cd $TRAVIS_BUILD_DIR/db && wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz && gunzip GeoLite2-City.mmdb.gz
? -- --------------------------------
+ - cd $TRAVIS_BUILD_DIR/db && wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
+ && gunzip GeoLite2-City.mmdb.gz
- - cd $TRAVIS_BUILD_DIR
? --
+ - cd $TRAVIS_BUILD_DIR
-
install: bundle install --deployment --jobs 4
cache:
directories:
- - vendor/bundle
? --
+ - vendor/bundle
-
before_script:
- - unset RACK_ENV
? --
+ - unset RACK_ENV
-
script: bundle exec rspec
+ notifications:
+ flowdock:
+ secure: MMpQnoJ0m0vAVuQ+2T1i/i4eL6zSRmEma7cX6sCbbCcGVL9IAGsnC3UC2bMsO8pkadD5mXz9cX9JVRpzuto6DhWlvmSTw8zsHbjwEYsD5MlAkhApN2jq/AX3cLZmOTn6i2ZzrQnHhhaOgygnRWHaqT1sa7rQKlbrKOaRRKCFAGM= | 18 | 1 | 8 | 10 |
6fdc3713efcb363d5197495fb0ee44a12ca80b79 | requirements.txt | requirements.txt | Flask==0.8
Flask-Cache==0.8.0
| numpy
scipy
# You need GDAL, but installing it via pip doesn't work for me.
# GDAL==1.9.1
Flask==0.8
Flask-Cache==0.8.0
./ | Add numpy and scipy back in | Add numpy and scipy back in
| Text | mit | abrookins/siren | text | ## Code Before:
Flask==0.8
Flask-Cache==0.8.0
## Instruction:
Add numpy and scipy back in
## Code After:
numpy
scipy
# You need GDAL, but installing it via pip doesn't work for me.
# GDAL==1.9.1
Flask==0.8
Flask-Cache==0.8.0
./ | + numpy
+ scipy
+ # You need GDAL, but installing it via pip doesn't work for me.
+ # GDAL==1.9.1
Flask==0.8
Flask-Cache==0.8.0
+ ./ | 5 | 2.5 | 5 | 0 |
43b67899d9cb2a500577acf345c8c0b2d5ab6786 | src/AccessCheckerInterface.php | src/AccessCheckerInterface.php | <?php
namespace Ordermind\LogicalPermissions;
interface AccessCheckerInterface {
/**
* Sets the permission type collection.
*
* @param \Ordermind\LogicalPermissions\PermissionTypeCollectionInterface $permissionTypeCollection
*
* @return \Ordermind\LogicalPermissions\AccessCheckerInterface
*/
public function setPermissionTypeCollection(\Ordermind\LogicalPermissions\PermissionTypeCollectionInterface $permissionTypeCollection);
/**
* Gets the permission type collection.
*
* @return \Ordermind\LogicalPermissions\PermissionTypeCollectionInterface|NULL
*/
public function getPermissionTypeCollection();
/**
* Sets the bypass access checker.
*
* @param \Ordermind\LogicalPermissions\BypassAccessCheckerInterface $bypassAccessChecker
*
* @return \Ordermind\LogicalPermissions\AccessCheckerInterface
*/
public function setBypassAccessChecker(BypassAccessCheckerInterface $bypassAccessChecker);
/**
* Gets the bypass access checker.
*
* @return \Ordermind\LogicalPermissions\BypassAccessCheckerInterface|NULL
*/
public function getBypassAccessChecker();
/**
* Gets all keys that can be used in a permission tree.
*
* @return array Valid permission keys.
*/
public function getValidPermissionKeys();
/**
* Checks access for a permission tree.
* @param array|string|bool $permissions The permission tree to be evaluated.
* @param array|object|NULL $context (optional) A context that could for example contain the evaluated user and document. Default value is NULL.
* @param bool $allowBypass (optional) Determines whether bypassing access should be allowed. Default value is TRUE.
* @return bool TRUE if access is granted or FALSE if access is denied.
*/
public function checkAccess($permissions, $context = NULL, $allowBypass = TRUE);
}
| <?php
namespace Ordermind\LogicalPermissions;
interface AccessCheckerInterface
{
/**
* Sets the permission type collection.
*
* @param PermissionTypeCollectionInterface $permissionTypeCollection
*
* @return AccessCheckerInterface
*/
public function setPermissionTypeCollection(PermissionTypeCollectionInterface $permissionTypeCollection);
/**
* Gets the permission type collection.
*
* @return PermissionTypeCollectionInterface|null
*/
public function getPermissionTypeCollection();
/**
* Sets the bypass access checker.
*
* @param BypassAccessCheckerInterface $bypassAccessChecker
*
* @return AccessCheckerInterface
*/
public function setBypassAccessChecker(BypassAccessCheckerInterface $bypassAccessChecker);
/**
* Gets the bypass access checker.
*
* @return BypassAccessCheckerInterface|null
*/
public function getBypassAccessChecker();
/**
* Gets all keys that can be used in a permission tree.
*
* @return array Valid permission keys.
*/
public function getValidPermissionKeys();
/**
* Checks access for a permission tree.
* @param array|string|bool $permissions The permission tree to be evaluated.
* @param array|object|null $context (optional) A context that could for example contain the evaluated user and document. Default value is NULL.
* @param bool $allowBypass (optional) Determines whether bypassing access should be allowed. Default value is TRUE.
*
* @return bool TRUE if access is granted or FALSE if access is denied.
*/
public function checkAccess($permissions, $context = null, $allowBypass = true);
}
| Clean up access checker interface | Clean up access checker interface
| PHP | mit | Ordermind/logical-permissions-php | php | ## Code Before:
<?php
namespace Ordermind\LogicalPermissions;
interface AccessCheckerInterface {
/**
* Sets the permission type collection.
*
* @param \Ordermind\LogicalPermissions\PermissionTypeCollectionInterface $permissionTypeCollection
*
* @return \Ordermind\LogicalPermissions\AccessCheckerInterface
*/
public function setPermissionTypeCollection(\Ordermind\LogicalPermissions\PermissionTypeCollectionInterface $permissionTypeCollection);
/**
* Gets the permission type collection.
*
* @return \Ordermind\LogicalPermissions\PermissionTypeCollectionInterface|NULL
*/
public function getPermissionTypeCollection();
/**
* Sets the bypass access checker.
*
* @param \Ordermind\LogicalPermissions\BypassAccessCheckerInterface $bypassAccessChecker
*
* @return \Ordermind\LogicalPermissions\AccessCheckerInterface
*/
public function setBypassAccessChecker(BypassAccessCheckerInterface $bypassAccessChecker);
/**
* Gets the bypass access checker.
*
* @return \Ordermind\LogicalPermissions\BypassAccessCheckerInterface|NULL
*/
public function getBypassAccessChecker();
/**
* Gets all keys that can be used in a permission tree.
*
* @return array Valid permission keys.
*/
public function getValidPermissionKeys();
/**
* Checks access for a permission tree.
* @param array|string|bool $permissions The permission tree to be evaluated.
* @param array|object|NULL $context (optional) A context that could for example contain the evaluated user and document. Default value is NULL.
* @param bool $allowBypass (optional) Determines whether bypassing access should be allowed. Default value is TRUE.
* @return bool TRUE if access is granted or FALSE if access is denied.
*/
public function checkAccess($permissions, $context = NULL, $allowBypass = TRUE);
}
## Instruction:
Clean up access checker interface
## Code After:
<?php
namespace Ordermind\LogicalPermissions;
interface AccessCheckerInterface
{
/**
* Sets the permission type collection.
*
* @param PermissionTypeCollectionInterface $permissionTypeCollection
*
* @return AccessCheckerInterface
*/
public function setPermissionTypeCollection(PermissionTypeCollectionInterface $permissionTypeCollection);
/**
* Gets the permission type collection.
*
* @return PermissionTypeCollectionInterface|null
*/
public function getPermissionTypeCollection();
/**
* Sets the bypass access checker.
*
* @param BypassAccessCheckerInterface $bypassAccessChecker
*
* @return AccessCheckerInterface
*/
public function setBypassAccessChecker(BypassAccessCheckerInterface $bypassAccessChecker);
/**
* Gets the bypass access checker.
*
* @return BypassAccessCheckerInterface|null
*/
public function getBypassAccessChecker();
/**
* Gets all keys that can be used in a permission tree.
*
* @return array Valid permission keys.
*/
public function getValidPermissionKeys();
/**
* Checks access for a permission tree.
* @param array|string|bool $permissions The permission tree to be evaluated.
* @param array|object|null $context (optional) A context that could for example contain the evaluated user and document. Default value is NULL.
* @param bool $allowBypass (optional) Determines whether bypassing access should be allowed. Default value is TRUE.
*
* @return bool TRUE if access is granted or FALSE if access is denied.
*/
public function checkAccess($permissions, $context = null, $allowBypass = true);
}
| <?php
namespace Ordermind\LogicalPermissions;
- interface AccessCheckerInterface {
? --
+ interface AccessCheckerInterface
+ {
- /**
+ /**
? ++
- * Sets the permission type collection.
+ * Sets the permission type collection.
? ++
- *
+ *
? ++
- * @param \Ordermind\LogicalPermissions\PermissionTypeCollectionInterface $permissionTypeCollection
? ------------------------------
+ * @param PermissionTypeCollectionInterface $permissionTypeCollection
? ++
- *
+ *
? ++
- * @return \Ordermind\LogicalPermissions\AccessCheckerInterface
+ * @return AccessCheckerInterface
- */
+ */
? ++
- public function setPermissionTypeCollection(\Ordermind\LogicalPermissions\PermissionTypeCollectionInterface $permissionTypeCollection);
? ------------------------------
+ public function setPermissionTypeCollection(PermissionTypeCollectionInterface $permissionTypeCollection);
? ++
- /**
+ /**
? ++
- * Gets the permission type collection.
+ * Gets the permission type collection.
? ++
- *
+ *
? ++
- * @return \Ordermind\LogicalPermissions\PermissionTypeCollectionInterface|NULL
+ * @return PermissionTypeCollectionInterface|null
- */
+ */
? ++
- public function getPermissionTypeCollection();
+ public function getPermissionTypeCollection();
? ++
- /**
+ /**
? ++
- * Sets the bypass access checker.
+ * Sets the bypass access checker.
? ++
- *
+ *
? ++
- * @param \Ordermind\LogicalPermissions\BypassAccessCheckerInterface $bypassAccessChecker
? ------------------------------
+ * @param BypassAccessCheckerInterface $bypassAccessChecker
? ++
- *
+ *
? ++
- * @return \Ordermind\LogicalPermissions\AccessCheckerInterface
+ * @return AccessCheckerInterface
- */
+ */
? ++
- public function setBypassAccessChecker(BypassAccessCheckerInterface $bypassAccessChecker);
+ public function setBypassAccessChecker(BypassAccessCheckerInterface $bypassAccessChecker);
? ++
- /**
+ /**
? ++
- * Gets the bypass access checker.
+ * Gets the bypass access checker.
? ++
- *
+ *
? ++
- * @return \Ordermind\LogicalPermissions\BypassAccessCheckerInterface|NULL
+ * @return BypassAccessCheckerInterface|null
- */
+ */
? ++
- public function getBypassAccessChecker();
+ public function getBypassAccessChecker();
? ++
- /**
+ /**
? ++
- * Gets all keys that can be used in a permission tree.
+ * Gets all keys that can be used in a permission tree.
? ++
- *
+ *
? ++
- * @return array Valid permission keys.
+ * @return array Valid permission keys.
? ++
- */
+ */
? ++
- public function getValidPermissionKeys();
+ public function getValidPermissionKeys();
? ++
- /**
+ /**
? ++
- * Checks access for a permission tree.
+ * Checks access for a permission tree.
? +++
- * @param array|string|bool $permissions The permission tree to be evaluated.
+ * @param array|string|bool $permissions The permission tree to be evaluated.
? +++
- * @param array|object|NULL $context (optional) A context that could for example contain the evaluated user and document. Default value is NULL.
? ^^^^
+ * @param array|object|null $context (optional) A context that could for example contain the evaluated user and document. Default value is NULL.
? +++ ^^^^
- * @param bool $allowBypass (optional) Determines whether bypassing access should be allowed. Default value is TRUE.
+ * @param bool $allowBypass (optional) Determines whether bypassing access should be allowed. Default value is TRUE.
? +++ +++++++++++++
+ *
- * @return bool TRUE if access is granted or FALSE if access is denied.
+ * @return bool TRUE if access is granted or FALSE if access is denied.
? +++
- */
+ */
- public function checkAccess($permissions, $context = NULL, $allowBypass = TRUE);
? ^^^^ ^^^^
+ public function checkAccess($permissions, $context = null, $allowBypass = true);
? ++ ^^^^ ^^^^
-
}
| 89 | 1.618182 | 45 | 44 |
cf4ceb46bd3c64553ff6d8221dd6ab4447ac4b45 | src/app/components/Header/styles.css | src/app/components/Header/styles.css | @import '../../styles/mixins/mixins.css';
@import '../../styles/variables/variables.css';
.mainHeader{
width: 100%;
left: 0;
right: 0;
position: fixed;
overflow: hidden;
z-index: 2;
border-top: $bdr-mainHeader;
color: $cl-mainHeader;
.mainHeaderSheet{
height: 65px;
position: absolute;
opacity: 0;
top: -65px;
width: 100%;
transition: background-color .2s, top .5s;
}
.mainHeaderWrapper{
@mixin mainFit;
margin: 0 auto;
height: 65px;
display: flex;
z-index: 2;
position: relative;
justify-content: space-between;
align-items: center;
}
}
.mainHeaderActive {
transition: background-color .2s,top .5s,opacity .2s;
.mainHeaderSheet{
background-color: $bg-mainHeader;
background-image: $bgi-mainHeaderActive;
opacity: 1;
top: 0;
transition: background-color .2s,top .5s,opacity .2s;
clip-path: polygon(0% 0px, 0% 65px, 33% 48px, 48% 65px, 67% 35px, 85% 55px, 100% 55px, 100% 0px);
}
} | @import '../../styles/mixins/mixins.css';
@import '../../styles/variables/variables.css';
.mainHeader{
width: 100%;
left: 0;
right: 0;
position: fixed;
overflow: hidden;
z-index: 2;
border-top: $bdr-mainHeader;
color: $cl-mainHeader;
.mainHeaderSheet{
height: 65px;
position: absolute;
opacity: 0;
top: -65px;
width: 100%;
transition: background-color .2s, top .5s;
}
.mainHeaderWrapper{
@mixin mainFit;
margin: 0 auto;
height: 65px;
display: flex;
z-index: 2;
position: relative;
justify-content: space-between;
align-items: center;
}
}
.mainHeaderActive {
transition: background-color .2s,top .5s,opacity .2s;
.mainHeaderSheet{
background-color: $bg-mainHeader;
background-image: $bgi-mainHeaderActive;
opacity: 1;
top: 0;
transition: top .3s,opacity .2s;
clip-path: polygon(0% 0px, 0% 65px, 33% 48px, 48% 65px, 67% 35px, 85% 55px, 100% 55px, 100% 0px);
}
} | Decrease anim time and remove background-color anim | Decrease anim time and remove background-color anim
| CSS | mit | pmagaz/pablomagaz.com,pmagaz/pablomagaz.com | css | ## Code Before:
@import '../../styles/mixins/mixins.css';
@import '../../styles/variables/variables.css';
.mainHeader{
width: 100%;
left: 0;
right: 0;
position: fixed;
overflow: hidden;
z-index: 2;
border-top: $bdr-mainHeader;
color: $cl-mainHeader;
.mainHeaderSheet{
height: 65px;
position: absolute;
opacity: 0;
top: -65px;
width: 100%;
transition: background-color .2s, top .5s;
}
.mainHeaderWrapper{
@mixin mainFit;
margin: 0 auto;
height: 65px;
display: flex;
z-index: 2;
position: relative;
justify-content: space-between;
align-items: center;
}
}
.mainHeaderActive {
transition: background-color .2s,top .5s,opacity .2s;
.mainHeaderSheet{
background-color: $bg-mainHeader;
background-image: $bgi-mainHeaderActive;
opacity: 1;
top: 0;
transition: background-color .2s,top .5s,opacity .2s;
clip-path: polygon(0% 0px, 0% 65px, 33% 48px, 48% 65px, 67% 35px, 85% 55px, 100% 55px, 100% 0px);
}
}
## Instruction:
Decrease anim time and remove background-color anim
## Code After:
@import '../../styles/mixins/mixins.css';
@import '../../styles/variables/variables.css';
.mainHeader{
width: 100%;
left: 0;
right: 0;
position: fixed;
overflow: hidden;
z-index: 2;
border-top: $bdr-mainHeader;
color: $cl-mainHeader;
.mainHeaderSheet{
height: 65px;
position: absolute;
opacity: 0;
top: -65px;
width: 100%;
transition: background-color .2s, top .5s;
}
.mainHeaderWrapper{
@mixin mainFit;
margin: 0 auto;
height: 65px;
display: flex;
z-index: 2;
position: relative;
justify-content: space-between;
align-items: center;
}
}
.mainHeaderActive {
transition: background-color .2s,top .5s,opacity .2s;
.mainHeaderSheet{
background-color: $bg-mainHeader;
background-image: $bgi-mainHeaderActive;
opacity: 1;
top: 0;
transition: top .3s,opacity .2s;
clip-path: polygon(0% 0px, 0% 65px, 33% 48px, 48% 65px, 67% 35px, 85% 55px, 100% 55px, 100% 0px);
}
} | @import '../../styles/mixins/mixins.css';
@import '../../styles/variables/variables.css';
.mainHeader{
width: 100%;
left: 0;
right: 0;
position: fixed;
overflow: hidden;
z-index: 2;
border-top: $bdr-mainHeader;
color: $cl-mainHeader;
.mainHeaderSheet{
height: 65px;
position: absolute;
opacity: 0;
top: -65px;
width: 100%;
transition: background-color .2s, top .5s;
}
.mainHeaderWrapper{
@mixin mainFit;
margin: 0 auto;
height: 65px;
display: flex;
z-index: 2;
position: relative;
justify-content: space-between;
align-items: center;
}
}
.mainHeaderActive {
transition: background-color .2s,top .5s,opacity .2s;
.mainHeaderSheet{
background-color: $bg-mainHeader;
background-image: $bgi-mainHeaderActive;
opacity: 1;
top: 0;
- transition: background-color .2s,top .5s,opacity .2s;
? --------------------- ^
+ transition: top .3s,opacity .2s;
? ^
clip-path: polygon(0% 0px, 0% 65px, 33% 48px, 48% 65px, 67% 35px, 85% 55px, 100% 55px, 100% 0px);
}
} | 2 | 0.046512 | 1 | 1 |
bc5a70e02eccdbcbb66ce829dbaa3676849808d9 | _events/2020_10_09_optivercpp.md | _events/2020_10_09_optivercpp.md | ---
layout: event
published: true
cancelled: false
cancel_reason:
title: Low-Latency C++ Workshop (by Optiver)
date: 2020-10-09 13:00:00
date_end: 2020-10-09 14:00:00
banner: 2020_10_09_optivercpp.png
location: Zoom
fb_link: https://www.facebook.com/events/705985230129967/
ticket_link:
price: Free
category:
- Tech Talk
- Workshop
cohost:
---
Do you want to learn how to write the fastest and best-performing code possible? Are you ready to dive into assembly, cache internals and squeeze the last nanosecond out of your code? If so, then join our low-latency workshop on code optimisation!
During this workshop, one of our engineers will demonstrate some of the profiling and micro-benchmarking techniques used when developing low-latency code. Through concrete code examples, we will share some of the performance tips and tricks attained from our vast experience in writing fast, maintainable and modern C++ code. We will look into assembly generated by the compiler to understand how seemingly small code changes affect the work a processor needs to do.
Whether you write games, mobile applications or trading software, these techniques will help you to write faster and more efficient code!
Please note this webinar is suited for students with at least some pre-existing C++ knowledge. | ---
layout: event
published: true
cancelled: false
cancel_reason:
title: Low-Latency C++ Workshop (by Optiver)
date: 2020-10-09 13:00:00
date_end: 2020-10-09 14:00:00
banner: 2020_10_09_optivercpp.png
location: Zoom
fb_link: https://www.facebook.com/events/705985230129967/
ticket_link:
price: Free
category:
- Tech Talk
- Workshop
cohost:
- Optiver
---
Do you want to learn how to write the fastest and best-performing code possible? Are you ready to dive into assembly, cache internals and squeeze the last nanosecond out of your code? If so, then join our low-latency workshop on code optimisation!
During this workshop, one of our engineers will demonstrate some of the profiling and micro-benchmarking techniques used when developing low-latency code. Through concrete code examples, we will share some of the performance tips and tricks attained from our vast experience in writing fast, maintainable and modern C++ code. We will look into assembly generated by the compiler to understand how seemingly small code changes affect the work a processor needs to do.
Whether you write games, mobile applications or trading software, these techniques will help you to write faster and more efficient code!
Please note this webinar is suited for students with at least some pre-existing C++ knowledge.
| Add optiver as cohost to event | Add optiver as cohost to event
| Markdown | mit | cssbristol/cssbristol.github.io,cssbristol/cssbristol.github.io,cssbristol/cssbristol.github.io,cssbristol/cssbristol.github.io,cssbristol/cssbristol.github.io | markdown | ## Code Before:
---
layout: event
published: true
cancelled: false
cancel_reason:
title: Low-Latency C++ Workshop (by Optiver)
date: 2020-10-09 13:00:00
date_end: 2020-10-09 14:00:00
banner: 2020_10_09_optivercpp.png
location: Zoom
fb_link: https://www.facebook.com/events/705985230129967/
ticket_link:
price: Free
category:
- Tech Talk
- Workshop
cohost:
---
Do you want to learn how to write the fastest and best-performing code possible? Are you ready to dive into assembly, cache internals and squeeze the last nanosecond out of your code? If so, then join our low-latency workshop on code optimisation!
During this workshop, one of our engineers will demonstrate some of the profiling and micro-benchmarking techniques used when developing low-latency code. Through concrete code examples, we will share some of the performance tips and tricks attained from our vast experience in writing fast, maintainable and modern C++ code. We will look into assembly generated by the compiler to understand how seemingly small code changes affect the work a processor needs to do.
Whether you write games, mobile applications or trading software, these techniques will help you to write faster and more efficient code!
Please note this webinar is suited for students with at least some pre-existing C++ knowledge.
## Instruction:
Add optiver as cohost to event
## Code After:
---
layout: event
published: true
cancelled: false
cancel_reason:
title: Low-Latency C++ Workshop (by Optiver)
date: 2020-10-09 13:00:00
date_end: 2020-10-09 14:00:00
banner: 2020_10_09_optivercpp.png
location: Zoom
fb_link: https://www.facebook.com/events/705985230129967/
ticket_link:
price: Free
category:
- Tech Talk
- Workshop
cohost:
- Optiver
---
Do you want to learn how to write the fastest and best-performing code possible? Are you ready to dive into assembly, cache internals and squeeze the last nanosecond out of your code? If so, then join our low-latency workshop on code optimisation!
During this workshop, one of our engineers will demonstrate some of the profiling and micro-benchmarking techniques used when developing low-latency code. Through concrete code examples, we will share some of the performance tips and tricks attained from our vast experience in writing fast, maintainable and modern C++ code. We will look into assembly generated by the compiler to understand how seemingly small code changes affect the work a processor needs to do.
Whether you write games, mobile applications or trading software, these techniques will help you to write faster and more efficient code!
Please note this webinar is suited for students with at least some pre-existing C++ knowledge.
| ---
layout: event
published: true
cancelled: false
cancel_reason:
title: Low-Latency C++ Workshop (by Optiver)
- date: 2020-10-09 13:00:00
? ----
+ date: 2020-10-09 13:00:00
date_end: 2020-10-09 14:00:00
banner: 2020_10_09_optivercpp.png
location: Zoom
fb_link: https://www.facebook.com/events/705985230129967/
- ticket_link:
? -
+ ticket_link:
price: Free
category:
- - Tech Talk
? --
+ - Tech Talk
- - Workshop
? --
+ - Workshop
cohost:
+ - Optiver
---
Do you want to learn how to write the fastest and best-performing code possible? Are you ready to dive into assembly, cache internals and squeeze the last nanosecond out of your code? If so, then join our low-latency workshop on code optimisation!
During this workshop, one of our engineers will demonstrate some of the profiling and micro-benchmarking techniques used when developing low-latency code. Through concrete code examples, we will share some of the performance tips and tricks attained from our vast experience in writing fast, maintainable and modern C++ code. We will look into assembly generated by the compiler to understand how seemingly small code changes affect the work a processor needs to do.
Whether you write games, mobile applications or trading software, these techniques will help you to write faster and more efficient code!
Please note this webinar is suited for students with at least some pre-existing C++ knowledge. | 9 | 0.346154 | 5 | 4 |
d1e7973ab3b22fed2eb6c3149d0ee8e1ef16920a | src/components/FileList/index.js | src/components/FileList/index.js | import React from 'react';
import FileListItem from './fileListItem';
const FileList = (props) => {
// const styles = require('./BucketList.scss');
function renderFileListItems(files) {
if(files && files.length && files.length > 0) {
return files.map((file) => {
return (
<FileListItem
fileSelectAction = {props.fileSelectAction}
key = {file.id}
{...file}
/>
);
//onClick = {() => props.onFileClick(file.id)}
});
} else {
return (
<tr className="text-center"><td colSpan="3"><span>Ready to Store Objects...</span></td></tr>
);
}
}
return (
<table className="table table-hover table-files">
<thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Type</th>
</tr>
</thead>
<tbody>
{renderFileListItems(props.files)}
</tbody>
</table>
);
};
FileList.propTypes = {
files : React.PropTypes.array.isRequired,
};
export default FileList;
| import React from 'react';
import FileListItem from './fileListItem';
const FileList = (props) => {
// const styles = require('./BucketList.scss');
function renderFileListItems(files) {
if(files && files.length && files.length > 0) {
return files.map((file) => {
return (
<FileListItem
fileSelectAction = {props.fileSelectAction}
key = {file.id}
{...file}
/>
);
//onClick = {() => props.onFileClick(file.id)}
});
} else {
return (
<tr className="text-center"><td colSpan="3"><span>Ready to Store Objects</span></td></tr>
<tr className="text-center"><td colSpan="3"><span>Read the <a href="https://storj.readme.io/">Get Started</a> tutorial, or go straight to the <a href="https://storj.io/api.html">Storj API</a>.</span></td></tr>
);
}
}
return (
<table className="table table-hover table-files">
<thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Type</th>
</tr>
</thead>
<tbody>
{renderFileListItems(props.files)}
</tbody>
</table>
);
};
FileList.propTypes = {
files : React.PropTypes.array.isRequired,
};
export default FileList;
| Add next steps after creating new bucket | Add next steps after creating new bucket
| JavaScript | agpl-3.0 | dylanlott/bridge-gui,Storj/metadisk-gui,dylanlott/bridge-gui,Storj/metadisk-gui | javascript | ## Code Before:
import React from 'react';
import FileListItem from './fileListItem';
const FileList = (props) => {
// const styles = require('./BucketList.scss');
function renderFileListItems(files) {
if(files && files.length && files.length > 0) {
return files.map((file) => {
return (
<FileListItem
fileSelectAction = {props.fileSelectAction}
key = {file.id}
{...file}
/>
);
//onClick = {() => props.onFileClick(file.id)}
});
} else {
return (
<tr className="text-center"><td colSpan="3"><span>Ready to Store Objects...</span></td></tr>
);
}
}
return (
<table className="table table-hover table-files">
<thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Type</th>
</tr>
</thead>
<tbody>
{renderFileListItems(props.files)}
</tbody>
</table>
);
};
FileList.propTypes = {
files : React.PropTypes.array.isRequired,
};
export default FileList;
## Instruction:
Add next steps after creating new bucket
## Code After:
import React from 'react';
import FileListItem from './fileListItem';
const FileList = (props) => {
// const styles = require('./BucketList.scss');
function renderFileListItems(files) {
if(files && files.length && files.length > 0) {
return files.map((file) => {
return (
<FileListItem
fileSelectAction = {props.fileSelectAction}
key = {file.id}
{...file}
/>
);
//onClick = {() => props.onFileClick(file.id)}
});
} else {
return (
<tr className="text-center"><td colSpan="3"><span>Ready to Store Objects</span></td></tr>
<tr className="text-center"><td colSpan="3"><span>Read the <a href="https://storj.readme.io/">Get Started</a> tutorial, or go straight to the <a href="https://storj.io/api.html">Storj API</a>.</span></td></tr>
);
}
}
return (
<table className="table table-hover table-files">
<thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Type</th>
</tr>
</thead>
<tbody>
{renderFileListItems(props.files)}
</tbody>
</table>
);
};
FileList.propTypes = {
files : React.PropTypes.array.isRequired,
};
export default FileList;
| import React from 'react';
import FileListItem from './fileListItem';
const FileList = (props) => {
// const styles = require('./BucketList.scss');
function renderFileListItems(files) {
if(files && files.length && files.length > 0) {
return files.map((file) => {
return (
<FileListItem
fileSelectAction = {props.fileSelectAction}
key = {file.id}
{...file}
/>
);
//onClick = {() => props.onFileClick(file.id)}
});
} else {
return (
- <tr className="text-center"><td colSpan="3"><span>Ready to Store Objects...</span></td></tr>
? ---
+ <tr className="text-center"><td colSpan="3"><span>Ready to Store Objects</span></td></tr>
+ <tr className="text-center"><td colSpan="3"><span>Read the <a href="https://storj.readme.io/">Get Started</a> tutorial, or go straight to the <a href="https://storj.io/api.html">Storj API</a>.</span></td></tr>
);
}
}
return (
<table className="table table-hover table-files">
<thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Type</th>
</tr>
</thead>
<tbody>
{renderFileListItems(props.files)}
</tbody>
</table>
);
};
FileList.propTypes = {
files : React.PropTypes.array.isRequired,
};
export default FileList; | 3 | 0.06383 | 2 | 1 |
ebeabe0ad612b3e3e94b8f7a96e05c5fe76ef1de | spec/unit/ice_nine/freezer/numeric/class_methods/deep_freeze_spec.rb | spec/unit/ice_nine/freezer/numeric/class_methods/deep_freeze_spec.rb |
require 'spec_helper'
require 'ice_nine/freezer'
require 'ice_nine/freezer/no_freeze'
require 'ice_nine/freezer/numeric'
describe IceNine::Freezer::Numeric, '.deep_freeze' do
subject { object.deep_freeze(value) }
let(:object) { described_class }
[0.0, 0, 0x7fffffffffffffff].each do |value|
context "with a #{value.class} object" do
let(:value) { value }
it_behaves_like 'IceNine::Freezer::Numeric.deep_freeze'
end
end
end
|
require 'spec_helper'
require 'ice_nine/freezer'
require 'ice_nine/freezer/no_freeze'
require 'ice_nine/freezer/numeric'
require 'bigdecimal'
describe IceNine::Freezer::Numeric, '.deep_freeze' do
subject { object.deep_freeze(value) }
let(:object) { described_class }
[0.0, 0, 0x7fffffffffffffff, BigDecimal('0')].each do |value|
context "with a #{value.class} object" do
let(:value) { value }
it_behaves_like 'IceNine::Freezer::Numeric.deep_freeze'
end
end
end
| Add bigdecimal specs for numeric freezer | Add bigdecimal specs for numeric freezer
| Ruby | mit | dkubb/ice_nine,soulcutter/ice_nine,nepalez/ice_nine | ruby | ## Code Before:
require 'spec_helper'
require 'ice_nine/freezer'
require 'ice_nine/freezer/no_freeze'
require 'ice_nine/freezer/numeric'
describe IceNine::Freezer::Numeric, '.deep_freeze' do
subject { object.deep_freeze(value) }
let(:object) { described_class }
[0.0, 0, 0x7fffffffffffffff].each do |value|
context "with a #{value.class} object" do
let(:value) { value }
it_behaves_like 'IceNine::Freezer::Numeric.deep_freeze'
end
end
end
## Instruction:
Add bigdecimal specs for numeric freezer
## Code After:
require 'spec_helper'
require 'ice_nine/freezer'
require 'ice_nine/freezer/no_freeze'
require 'ice_nine/freezer/numeric'
require 'bigdecimal'
describe IceNine::Freezer::Numeric, '.deep_freeze' do
subject { object.deep_freeze(value) }
let(:object) { described_class }
[0.0, 0, 0x7fffffffffffffff, BigDecimal('0')].each do |value|
context "with a #{value.class} object" do
let(:value) { value }
it_behaves_like 'IceNine::Freezer::Numeric.deep_freeze'
end
end
end
|
require 'spec_helper'
require 'ice_nine/freezer'
require 'ice_nine/freezer/no_freeze'
require 'ice_nine/freezer/numeric'
+ require 'bigdecimal'
describe IceNine::Freezer::Numeric, '.deep_freeze' do
subject { object.deep_freeze(value) }
let(:object) { described_class }
- [0.0, 0, 0x7fffffffffffffff].each do |value|
+ [0.0, 0, 0x7fffffffffffffff, BigDecimal('0')].each do |value|
? +++++++++++++++++
context "with a #{value.class} object" do
let(:value) { value }
it_behaves_like 'IceNine::Freezer::Numeric.deep_freeze'
end
end
end | 3 | 0.157895 | 2 | 1 |
ec4510ad0d5475893e378fbcc8c34e21875080a8 | app/assets/stylesheets/components/page_specific/_category_detail.scss | app/assets/stylesheets/components/page_specific/_category_detail.scss | .category-detail {
border-bottom: 3px solid $color-category-border;
margin-bottom: $baseline-unit*6;
padding-bottom: $baseline-unit*4;
}
.category-detail__list {
list-style: none;
padding: 0;
margin-top: $baseline-unit*4;
}
.category-detail__list-item {
margin-bottom: $baseline-unit*3;
@include respond-to($mq-m) {
margin-bottom: $baseline-unit*2;
}
}
.category-detail__heading {
@extend %collapsable-trigger;
}
.category-detail__list-container {
@extend %collapsable-target;
}
.js .category-detail__heading {
position:relative;
padding-left:$category-inset;
button {
margin-left:-$category-inset;
padding-left:$category-inset;
text-align:left;
&:focus,
&:hover {
text-decoration: underline;
}
}
& .icon--toggle {
@extend .icon--plus;
position:absolute;
top:6px;
left:0;
}
&.is-on .icon--toggle {
@extend .icon--minus;
}
}
.js .category-detail p,
.js .category-detail__list-container {
padding-left:$category-inset;
}
| .category-detail {
border-bottom: 3px solid $color-category-border;
margin-bottom: $baseline-unit*6;
padding-bottom: $baseline-unit*4;
&:last-child {
@include respond-to(0, $mq-m) {
margin-bottom: 0;
}
}
}
.category-detail__list {
list-style: none;
padding: 0;
margin-top: $baseline-unit*4;
}
.category-detail__list-item {
margin-bottom: $baseline-unit*3;
@include respond-to($mq-m) {
margin-bottom: $baseline-unit*2;
}
}
.category-detail__heading {
@extend %collapsable-trigger;
}
.category-detail__list-container {
@extend %collapsable-target;
}
.js .category-detail__heading {
position:relative;
padding-left:$category-inset;
button {
margin-left:-$category-inset;
padding-left:$category-inset;
text-align:left;
&:focus,
&:hover {
text-decoration: underline;
}
}
& .icon--toggle {
@extend .icon--plus;
position:absolute;
top:6px;
left:0;
}
&.is-on .icon--toggle {
@extend .icon--minus;
}
}
.js .category-detail p,
.js .category-detail__list-container {
padding-left:$category-inset;
}
| Remove bottom margin of last category detail on mobile | Remove bottom margin of last category detail on mobile
| SCSS | mit | moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend | scss | ## Code Before:
.category-detail {
border-bottom: 3px solid $color-category-border;
margin-bottom: $baseline-unit*6;
padding-bottom: $baseline-unit*4;
}
.category-detail__list {
list-style: none;
padding: 0;
margin-top: $baseline-unit*4;
}
.category-detail__list-item {
margin-bottom: $baseline-unit*3;
@include respond-to($mq-m) {
margin-bottom: $baseline-unit*2;
}
}
.category-detail__heading {
@extend %collapsable-trigger;
}
.category-detail__list-container {
@extend %collapsable-target;
}
.js .category-detail__heading {
position:relative;
padding-left:$category-inset;
button {
margin-left:-$category-inset;
padding-left:$category-inset;
text-align:left;
&:focus,
&:hover {
text-decoration: underline;
}
}
& .icon--toggle {
@extend .icon--plus;
position:absolute;
top:6px;
left:0;
}
&.is-on .icon--toggle {
@extend .icon--minus;
}
}
.js .category-detail p,
.js .category-detail__list-container {
padding-left:$category-inset;
}
## Instruction:
Remove bottom margin of last category detail on mobile
## Code After:
.category-detail {
border-bottom: 3px solid $color-category-border;
margin-bottom: $baseline-unit*6;
padding-bottom: $baseline-unit*4;
&:last-child {
@include respond-to(0, $mq-m) {
margin-bottom: 0;
}
}
}
.category-detail__list {
list-style: none;
padding: 0;
margin-top: $baseline-unit*4;
}
.category-detail__list-item {
margin-bottom: $baseline-unit*3;
@include respond-to($mq-m) {
margin-bottom: $baseline-unit*2;
}
}
.category-detail__heading {
@extend %collapsable-trigger;
}
.category-detail__list-container {
@extend %collapsable-target;
}
.js .category-detail__heading {
position:relative;
padding-left:$category-inset;
button {
margin-left:-$category-inset;
padding-left:$category-inset;
text-align:left;
&:focus,
&:hover {
text-decoration: underline;
}
}
& .icon--toggle {
@extend .icon--plus;
position:absolute;
top:6px;
left:0;
}
&.is-on .icon--toggle {
@extend .icon--minus;
}
}
.js .category-detail p,
.js .category-detail__list-container {
padding-left:$category-inset;
}
| .category-detail {
border-bottom: 3px solid $color-category-border;
margin-bottom: $baseline-unit*6;
padding-bottom: $baseline-unit*4;
+
+ &:last-child {
+ @include respond-to(0, $mq-m) {
+ margin-bottom: 0;
+ }
+ }
}
.category-detail__list {
list-style: none;
padding: 0;
margin-top: $baseline-unit*4;
}
.category-detail__list-item {
margin-bottom: $baseline-unit*3;
@include respond-to($mq-m) {
margin-bottom: $baseline-unit*2;
}
}
.category-detail__heading {
@extend %collapsable-trigger;
}
.category-detail__list-container {
@extend %collapsable-target;
}
.js .category-detail__heading {
position:relative;
padding-left:$category-inset;
button {
margin-left:-$category-inset;
padding-left:$category-inset;
text-align:left;
&:focus,
&:hover {
text-decoration: underline;
}
}
& .icon--toggle {
@extend .icon--plus;
position:absolute;
top:6px;
left:0;
}
&.is-on .icon--toggle {
@extend .icon--minus;
}
}
.js .category-detail p,
.js .category-detail__list-container {
padding-left:$category-inset;
} | 6 | 0.1 | 6 | 0 |
c2f27b18a3d94298083d8a2dce491b883fe227aa | users.go | users.go | /*
* Datadog API for Go
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2013 by authors and contributors.
*/
package datadog
import (
"errors"
)
// reqInviteUsers contains email addresses to send invitations to.
type reqInviteUsers struct {
Emails []string `json:"emails"`
}
// InviteUsers takes a slice of email addresses and sends invitations to them.
func (self *Client) InviteUsers(emails []string) error {
return errors.New("datadog API docs don't list the endpoint")
// return self.doJsonRequest("POST", "/v1/alert",
// reqInviteUsers{Emails: emails}, nil)
}
| /*
* Datadog API for Go
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2013 by authors and contributors.
*/
package datadog
// reqInviteUsers contains email addresses to send invitations to.
type reqInviteUsers struct {
Emails []string `json:"emails"`
}
// InviteUsers takes a slice of email addresses and sends invitations to them.
func (self *Client) InviteUsers(emails []string) error {
return self.doJsonRequest("POST", "/v1/account/invite",
reqInviteUsers{Emails: emails}, nil)
}
| Implement the user invitation method | Implement the user invitation method
Now I have the endpoint, now this should work.
| Go | bsd-3-clause | DataDog/go-datadog-api,seiffert/go-datadog-api,ojongerius/go-datadog-api,zorkian/go-datadog-api,zorkian/go-datadog-api | go | ## Code Before:
/*
* Datadog API for Go
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2013 by authors and contributors.
*/
package datadog
import (
"errors"
)
// reqInviteUsers contains email addresses to send invitations to.
type reqInviteUsers struct {
Emails []string `json:"emails"`
}
// InviteUsers takes a slice of email addresses and sends invitations to them.
func (self *Client) InviteUsers(emails []string) error {
return errors.New("datadog API docs don't list the endpoint")
// return self.doJsonRequest("POST", "/v1/alert",
// reqInviteUsers{Emails: emails}, nil)
}
## Instruction:
Implement the user invitation method
Now I have the endpoint, now this should work.
## Code After:
/*
* Datadog API for Go
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2013 by authors and contributors.
*/
package datadog
// reqInviteUsers contains email addresses to send invitations to.
type reqInviteUsers struct {
Emails []string `json:"emails"`
}
// InviteUsers takes a slice of email addresses and sends invitations to them.
func (self *Client) InviteUsers(emails []string) error {
return self.doJsonRequest("POST", "/v1/account/invite",
reqInviteUsers{Emails: emails}, nil)
}
| /*
* Datadog API for Go
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2013 by authors and contributors.
*/
package datadog
- import (
- "errors"
- )
-
// reqInviteUsers contains email addresses to send invitations to.
type reqInviteUsers struct {
Emails []string `json:"emails"`
}
// InviteUsers takes a slice of email addresses and sends invitations to them.
func (self *Client) InviteUsers(emails []string) error {
- return errors.New("datadog API docs don't list the endpoint")
-
- // return self.doJsonRequest("POST", "/v1/alert",
? --- ^ --
+ return self.doJsonRequest("POST", "/v1/account/invite",
? ^^^^^^^^^^^^
- // reqInviteUsers{Emails: emails}, nil)
? ---
+ reqInviteUsers{Emails: emails}, nil)
} | 10 | 0.384615 | 2 | 8 |
a6fc15fbd47ed5c54f3b3dff958851ee0f39fee3 | ipmi/test_ipmi_kcs.robot | ipmi/test_ipmi_kcs.robot | *** Settings ***
Documentation To Verify KCS interface.
Resource ../lib/ipmi_client.robot
Resource ../lib/ipmi_utils.robot
Variables ../data/ipmi_raw_cmd_table.py
Library ../lib/ipmi_utils.py
Suite Setup Test Setup Execution
*** Variables ***
${LOOP_COUNT} ${1}
*** Test Cases ***
Verify KCS interface
[Documentation] Verify KCS interface.
[Tags] Verify_KCS_interface
Verify KCS Interface Commands
Verify KCS Raw IPMI Multiple Times
[Documentation] Verify KCS interface raw ipmi command for multiple times.
[Tags] Verify_KCS_Raw_IPMI_Multiple_Times
Repeat Keyword ${LOOP_COUNT} times Verify KCS Interface Commands
*** Keywords ***
Test Setup Execution
[Documentation] Do suite setup tasks.
Should Not Be Empty ${OS_HOST}
Should Not Be Empty ${OS_USERNAME}
Should Not Be Empty ${OS_PASSWORD}
| *** Settings ***
Documentation To Verify KCS interface.
Resource ../lib/ipmi_client.robot
Resource ../lib/ipmi_utils.robot
Variables ../data/ipmi_raw_cmd_table.py
Library ../lib/ipmi_utils.py
Suite Setup Test Setup Execution
*** Variables ***
${LOOP_COUNT} ${1}
*** Test Cases ***
Verify KCS interface
[Documentation] Verify KCS interface.
[Tags] Verify_KCS_interface
Verify KCS Interface Commands
Verify KCS Raw IPMI Multiple Times
[Documentation] Verify KCS interface raw ipmi command for multiple times.
[Tags] Verify_KCS_Raw_IPMI_Multiple_Times
Repeat Keyword ${LOOP_COUNT} times Verify KCS Interface Commands
*** Keywords ***
Test Setup Execution
[Documentation] Do suite setup tasks.
Should Not Be Empty ${OS_HOST} msg=Please provide required parameter OS_HOST
Should Not Be Empty ${OS_USERNAME} msg=Please provide required parameter OS_USERNAME
Should Not Be Empty ${OS_PASSWORD} msg=Please provide required parameter OS_PASSWORD
| Add failure messages for clarity in test suite setup | Add failure messages for clarity in test suite setup
Before fix:
Parent suite setup failed:
'' should not be empty.
After fix:
Parent suite setup failed:
Please provide required paramter OS_HOST
Change-Id: I25c409978806b1d97a8223edf1ba2526f5be31aa
Signed-off-by: George Keishing <bef0a9ecac45fb57611777c8270153994e13fd2e@in.ibm.com>
| RobotFramework | apache-2.0 | openbmc/openbmc-test-automation,openbmc/openbmc-test-automation | robotframework | ## Code Before:
*** Settings ***
Documentation To Verify KCS interface.
Resource ../lib/ipmi_client.robot
Resource ../lib/ipmi_utils.robot
Variables ../data/ipmi_raw_cmd_table.py
Library ../lib/ipmi_utils.py
Suite Setup Test Setup Execution
*** Variables ***
${LOOP_COUNT} ${1}
*** Test Cases ***
Verify KCS interface
[Documentation] Verify KCS interface.
[Tags] Verify_KCS_interface
Verify KCS Interface Commands
Verify KCS Raw IPMI Multiple Times
[Documentation] Verify KCS interface raw ipmi command for multiple times.
[Tags] Verify_KCS_Raw_IPMI_Multiple_Times
Repeat Keyword ${LOOP_COUNT} times Verify KCS Interface Commands
*** Keywords ***
Test Setup Execution
[Documentation] Do suite setup tasks.
Should Not Be Empty ${OS_HOST}
Should Not Be Empty ${OS_USERNAME}
Should Not Be Empty ${OS_PASSWORD}
## Instruction:
Add failure messages for clarity in test suite setup
Before fix:
Parent suite setup failed:
'' should not be empty.
After fix:
Parent suite setup failed:
Please provide required paramter OS_HOST
Change-Id: I25c409978806b1d97a8223edf1ba2526f5be31aa
Signed-off-by: George Keishing <bef0a9ecac45fb57611777c8270153994e13fd2e@in.ibm.com>
## Code After:
*** Settings ***
Documentation To Verify KCS interface.
Resource ../lib/ipmi_client.robot
Resource ../lib/ipmi_utils.robot
Variables ../data/ipmi_raw_cmd_table.py
Library ../lib/ipmi_utils.py
Suite Setup Test Setup Execution
*** Variables ***
${LOOP_COUNT} ${1}
*** Test Cases ***
Verify KCS interface
[Documentation] Verify KCS interface.
[Tags] Verify_KCS_interface
Verify KCS Interface Commands
Verify KCS Raw IPMI Multiple Times
[Documentation] Verify KCS interface raw ipmi command for multiple times.
[Tags] Verify_KCS_Raw_IPMI_Multiple_Times
Repeat Keyword ${LOOP_COUNT} times Verify KCS Interface Commands
*** Keywords ***
Test Setup Execution
[Documentation] Do suite setup tasks.
Should Not Be Empty ${OS_HOST} msg=Please provide required parameter OS_HOST
Should Not Be Empty ${OS_USERNAME} msg=Please provide required parameter OS_USERNAME
Should Not Be Empty ${OS_PASSWORD} msg=Please provide required parameter OS_PASSWORD
| *** Settings ***
Documentation To Verify KCS interface.
Resource ../lib/ipmi_client.robot
Resource ../lib/ipmi_utils.robot
Variables ../data/ipmi_raw_cmd_table.py
Library ../lib/ipmi_utils.py
Suite Setup Test Setup Execution
*** Variables ***
${LOOP_COUNT} ${1}
*** Test Cases ***
Verify KCS interface
[Documentation] Verify KCS interface.
[Tags] Verify_KCS_interface
Verify KCS Interface Commands
Verify KCS Raw IPMI Multiple Times
[Documentation] Verify KCS interface raw ipmi command for multiple times.
[Tags] Verify_KCS_Raw_IPMI_Multiple_Times
Repeat Keyword ${LOOP_COUNT} times Verify KCS Interface Commands
*** Keywords ***
Test Setup Execution
[Documentation] Do suite setup tasks.
- Should Not Be Empty ${OS_HOST}
- Should Not Be Empty ${OS_USERNAME}
- Should Not Be Empty ${OS_PASSWORD}
+ Should Not Be Empty ${OS_HOST} msg=Please provide required parameter OS_HOST
+ Should Not Be Empty ${OS_USERNAME} msg=Please provide required parameter OS_USERNAME
+ Should Not Be Empty ${OS_PASSWORD} msg=Please provide required parameter OS_PASSWORD | 6 | 0.146341 | 3 | 3 |
ef3f0711290ddc2f631e096d5c0acf31bd0902e7 | .travis.yml | .travis.yml | language: python
dist: trusty
sudo: required
python:
- "3.5"
- "3.6"
- "3.7-dev"
before_install:
- sudo dpkg --add-architecture i386
- sudo apt-get update
- sudo apt-get install --no-install-recommends -y wine
- pip install nbval matplotlib git+https://github.com/thedataincubator/expectexception.git@master notebook
install:
- pip install -e .[test]
script:
- pytest --cov -rfsxEX
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then ./scripts/test_notebooks.sh; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then goodtables pymagicc/definitions/datapackage.json; fi
after_success:
- codecov
| language: python
dist: xenial
sudo: required
python:
- "3.5"
- "3.6"
- "3.7"
before_install:
- sudo dpkg --add-architecture i386
- sudo apt-get update
- sudo apt-get install --no-install-recommends -y wine
- pip install nbval matplotlib git+https://github.com/thedataincubator/expectexception.git@master notebook
install:
- pip install -e .[test]
script:
- pytest --cov -rfsxEX
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then ./scripts/test_notebooks.sh; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then goodtables pymagicc/definitions/datapackage.json; fi
after_success:
- codecov
| Update Linux version for Travis | Update Linux version for Travis
| YAML | agpl-3.0 | openclimatedata/pymagicc,openclimatedata/pymagicc | yaml | ## Code Before:
language: python
dist: trusty
sudo: required
python:
- "3.5"
- "3.6"
- "3.7-dev"
before_install:
- sudo dpkg --add-architecture i386
- sudo apt-get update
- sudo apt-get install --no-install-recommends -y wine
- pip install nbval matplotlib git+https://github.com/thedataincubator/expectexception.git@master notebook
install:
- pip install -e .[test]
script:
- pytest --cov -rfsxEX
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then ./scripts/test_notebooks.sh; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then goodtables pymagicc/definitions/datapackage.json; fi
after_success:
- codecov
## Instruction:
Update Linux version for Travis
## Code After:
language: python
dist: xenial
sudo: required
python:
- "3.5"
- "3.6"
- "3.7"
before_install:
- sudo dpkg --add-architecture i386
- sudo apt-get update
- sudo apt-get install --no-install-recommends -y wine
- pip install nbval matplotlib git+https://github.com/thedataincubator/expectexception.git@master notebook
install:
- pip install -e .[test]
script:
- pytest --cov -rfsxEX
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then ./scripts/test_notebooks.sh; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then goodtables pymagicc/definitions/datapackage.json; fi
after_success:
- codecov
| language: python
- dist: trusty
+ dist: xenial
sudo: required
python:
- "3.5"
- "3.6"
- - "3.7-dev"
? ----
+ - "3.7"
before_install:
- sudo dpkg --add-architecture i386
- sudo apt-get update
- sudo apt-get install --no-install-recommends -y wine
- pip install nbval matplotlib git+https://github.com/thedataincubator/expectexception.git@master notebook
install:
- pip install -e .[test]
script:
- pytest --cov -rfsxEX
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then ./scripts/test_notebooks.sh; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then goodtables pymagicc/definitions/datapackage.json; fi
after_success:
- codecov | 4 | 0.2 | 2 | 2 |
70df9d877d1a8d50a6f956204bd9278a91f6fbd1 | lib/salt/page.rb | lib/salt/page.rb | module Salt
class Page
include Frontable
attr_accessor :path, :contents, :filename, :extension
def initialize(path = nil)
@path = path
@extension = '.html'
if path
@contents = read_with_yaml(path)
@filename = File.basename(path, File.extname(path))
else
@contents = ''
@filename = 'index'
end
end
def render(context = {})
context[:this] = self
Site.instance.render_template(@layout, @contents, context)
end
def output_file(extension = nil)
"#{self.filename}#{extension ? extension : self.extension}"
end
def output_path(parent_path)
return parent_path if @path.nil?
File.join(parent_path, File.dirname(@path).gsub(Site.instance.path(:pages), ''))
end
def write(path, context = {}, extension = nil)
contents = self.render(context)
output_path = self.output_path(path)
FileUtils.mkdir_p(output_path) unless Dir.exists?(output_path)
full_path = File.join(output_path, self.output_file(extension))
if @path && File.exists?(full_path)
return if File.mtime(@path) < File.mtime(full_path)
end
File.open(full_path, 'w') do |file|
file.write(contents)
end
end
end
end | module Salt
class Page
include Frontable
include Renderable
attr_accessor :path, :contents, :filename, :extension
def initialize(path = nil)
@path = path
@extension = '.html'
if path
@contents = read_with_yaml(path)
@filename = File.basename(path, File.extname(path))
else
@contents = ''
@filename = 'index'
end
end
def output_file(extension = nil)
"#{self.filename}#{extension ? extension : self.extension}"
end
def output_path(parent_path)
return parent_path if @path.nil?
File.join(parent_path, File.dirname(@path).gsub(Site.instance.path(:pages), ''))
end
def write(path, context = {}, extension = nil)
contents = self.render(@contents, {this: self}.merge(context))
output_path = self.output_path(path)
FileUtils.mkdir_p(output_path) unless Dir.exists?(output_path)
full_path = File.join(output_path, self.output_file(extension))
File.open(full_path, 'w') do |file|
file.write(contents)
end
end
end
end | Include renderable, and use its render method instead. | Include renderable, and use its render method instead.
| Ruby | mit | waferbaby/dimples | ruby | ## Code Before:
module Salt
class Page
include Frontable
attr_accessor :path, :contents, :filename, :extension
def initialize(path = nil)
@path = path
@extension = '.html'
if path
@contents = read_with_yaml(path)
@filename = File.basename(path, File.extname(path))
else
@contents = ''
@filename = 'index'
end
end
def render(context = {})
context[:this] = self
Site.instance.render_template(@layout, @contents, context)
end
def output_file(extension = nil)
"#{self.filename}#{extension ? extension : self.extension}"
end
def output_path(parent_path)
return parent_path if @path.nil?
File.join(parent_path, File.dirname(@path).gsub(Site.instance.path(:pages), ''))
end
def write(path, context = {}, extension = nil)
contents = self.render(context)
output_path = self.output_path(path)
FileUtils.mkdir_p(output_path) unless Dir.exists?(output_path)
full_path = File.join(output_path, self.output_file(extension))
if @path && File.exists?(full_path)
return if File.mtime(@path) < File.mtime(full_path)
end
File.open(full_path, 'w') do |file|
file.write(contents)
end
end
end
end
## Instruction:
Include renderable, and use its render method instead.
## Code After:
module Salt
class Page
include Frontable
include Renderable
attr_accessor :path, :contents, :filename, :extension
def initialize(path = nil)
@path = path
@extension = '.html'
if path
@contents = read_with_yaml(path)
@filename = File.basename(path, File.extname(path))
else
@contents = ''
@filename = 'index'
end
end
def output_file(extension = nil)
"#{self.filename}#{extension ? extension : self.extension}"
end
def output_path(parent_path)
return parent_path if @path.nil?
File.join(parent_path, File.dirname(@path).gsub(Site.instance.path(:pages), ''))
end
def write(path, context = {}, extension = nil)
contents = self.render(@contents, {this: self}.merge(context))
output_path = self.output_path(path)
FileUtils.mkdir_p(output_path) unless Dir.exists?(output_path)
full_path = File.join(output_path, self.output_file(extension))
File.open(full_path, 'w') do |file|
file.write(contents)
end
end
end
end | module Salt
class Page
include Frontable
+ include Renderable
attr_accessor :path, :contents, :filename, :extension
def initialize(path = nil)
@path = path
@extension = '.html'
if path
@contents = read_with_yaml(path)
@filename = File.basename(path, File.extname(path))
else
@contents = ''
@filename = 'index'
end
end
- def render(context = {})
- context[:this] = self
- Site.instance.render_template(@layout, @contents, context)
- end
-
def output_file(extension = nil)
"#{self.filename}#{extension ? extension : self.extension}"
end
def output_path(parent_path)
return parent_path if @path.nil?
File.join(parent_path, File.dirname(@path).gsub(Site.instance.path(:pages), ''))
end
def write(path, context = {}, extension = nil)
- contents = self.render(context)
+ contents = self.render(@contents, {this: self}.merge(context))
output_path = self.output_path(path)
FileUtils.mkdir_p(output_path) unless Dir.exists?(output_path)
full_path = File.join(output_path, self.output_file(extension))
-
- if @path && File.exists?(full_path)
- return if File.mtime(@path) < File.mtime(full_path)
- end
File.open(full_path, 'w') do |file|
file.write(contents)
end
end
end
end | 12 | 0.24 | 2 | 10 |
74f9452178761e1608eb1177a3e650d115c59c45 | README.md | README.md | Serving variant, annotation and genome data for AVE visualisation.
## Data preprocessing.
Before data can be served it has to be preprocessed in following way.
| Serving variant, annotation and genome data for AVE visualisation.
## Data preprocessing.
Before data can be served it has to be preprocessed in following way.
### Genome sequence
Genome sequence in [FASTA](https://en.wikipedia.org/wiki/FASTA_format) format is used. It is idexed and accessed by
[pyfaidx](https://github.com/mdshw5/pyfaidx). All chromosome
sequences should be in single FASTA file with `.fa` extension.
`SeqID`'s shoould match once in coresponding gff and bcf files.
### Genomic features annotations
Information about annotations should be in [gff3](https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md)
format. You can validate gff files on [genome tools website](http://genometools.org/cgi-bin/gff3validator.cgi).
#### Sort features with [bedtools](https://bedtools.readthedocs.io/en/latest/)
```sh
bedtools sort -i TAIR10_genes.gff > TAIR10_genes.sorted.gff
```
#### Compress by [bgzip](http://www.htslib.org/doc/tabix.html) and index with [tabix](http://www.htslib.org/doc/tabix.html)
```sh
bgzip TAIR10_GFF3_genes.sorted.gff
tabix -p gff TAIR10_GFF3_genes.sorted.gff.gz
```
Service querries annotation with use of `pysam.Tabixfile`.
```py
gff.fetch("Chr2", 1, 5000, parser=pysam.asGTF())
```
Learn more about pysam.Tabixfile from
[pysam docs](https://pysam.readthedocs.io/en/latest/index.html) | Document preprocessing of fa and gff | Document preprocessing of fa and gff
| Markdown | apache-2.0 | nlesc-ave/ave-rest-service | markdown | ## Code Before:
Serving variant, annotation and genome data for AVE visualisation.
## Data preprocessing.
Before data can be served it has to be preprocessed in following way.
## Instruction:
Document preprocessing of fa and gff
## Code After:
Serving variant, annotation and genome data for AVE visualisation.
## Data preprocessing.
Before data can be served it has to be preprocessed in following way.
### Genome sequence
Genome sequence in [FASTA](https://en.wikipedia.org/wiki/FASTA_format) format is used. It is idexed and accessed by
[pyfaidx](https://github.com/mdshw5/pyfaidx). All chromosome
sequences should be in single FASTA file with `.fa` extension.
`SeqID`'s shoould match once in coresponding gff and bcf files.
### Genomic features annotations
Information about annotations should be in [gff3](https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md)
format. You can validate gff files on [genome tools website](http://genometools.org/cgi-bin/gff3validator.cgi).
#### Sort features with [bedtools](https://bedtools.readthedocs.io/en/latest/)
```sh
bedtools sort -i TAIR10_genes.gff > TAIR10_genes.sorted.gff
```
#### Compress by [bgzip](http://www.htslib.org/doc/tabix.html) and index with [tabix](http://www.htslib.org/doc/tabix.html)
```sh
bgzip TAIR10_GFF3_genes.sorted.gff
tabix -p gff TAIR10_GFF3_genes.sorted.gff.gz
```
Service querries annotation with use of `pysam.Tabixfile`.
```py
gff.fetch("Chr2", 1, 5000, parser=pysam.asGTF())
```
Learn more about pysam.Tabixfile from
[pysam docs](https://pysam.readthedocs.io/en/latest/index.html) | Serving variant, annotation and genome data for AVE visualisation.
## Data preprocessing.
Before data can be served it has to be preprocessed in following way.
+
+ ### Genome sequence
+ Genome sequence in [FASTA](https://en.wikipedia.org/wiki/FASTA_format) format is used. It is idexed and accessed by
+ [pyfaidx](https://github.com/mdshw5/pyfaidx). All chromosome
+ sequences should be in single FASTA file with `.fa` extension.
+ `SeqID`'s shoould match once in coresponding gff and bcf files.
+
+ ### Genomic features annotations
+ Information about annotations should be in [gff3](https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md)
+ format. You can validate gff files on [genome tools website](http://genometools.org/cgi-bin/gff3validator.cgi).
+
+ #### Sort features with [bedtools](https://bedtools.readthedocs.io/en/latest/)
+ ```sh
+ bedtools sort -i TAIR10_genes.gff > TAIR10_genes.sorted.gff
+ ```
+
+ #### Compress by [bgzip](http://www.htslib.org/doc/tabix.html) and index with [tabix](http://www.htslib.org/doc/tabix.html)
+ ```sh
+ bgzip TAIR10_GFF3_genes.sorted.gff
+ tabix -p gff TAIR10_GFF3_genes.sorted.gff.gz
+ ```
+
+ Service querries annotation with use of `pysam.Tabixfile`.
+ ```py
+ gff.fetch("Chr2", 1, 5000, parser=pysam.asGTF())
+ ```
+ Learn more about pysam.Tabixfile from
+ [pysam docs](https://pysam.readthedocs.io/en/latest/index.html) | 28 | 7 | 28 | 0 |
86a44c855ebc84d422b2338090f4ca6d0d01cee5 | cf_predict/__init__.py | cf_predict/__init__.py | import sys
from flask import Flask
from .config import config
from .api import api_bp
__project__ = 'cf-predict'
__version__ = '0.0.0'
VERSION = "{0} v{1}".format(__project__, __version__)
PYTHON_VERSION = 3, 4
if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test)
sys.exit("Python {}.{}+ is required.".format(*PYTHON_VERSION))
def create_app(config_name):
"""Flask application factory."""
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
app.register_blueprint(api_bp)
return app
| import sys
from flask import Flask
from mockredis import MockRedis
from flask_redis import FlaskRedis
from .config import config
from .api import api_bp
__project__ = 'cf-predict'
__version__ = '0.0.0'
VERSION = "{0} v{1}".format(__project__, __version__)
PYTHON_VERSION = 3, 4
if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test)
sys.exit("Python {}.{}+ is required.".format(*PYTHON_VERSION))
class MockRedisWrapper(MockRedis):
"""A wrapper to add the `from_url` classmethod."""
@classmethod
def from_url(cls, *args, **kwargs):
return cls()
def create_app(config_name):
"""Flask application factory."""
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
if app.testing:
redis_store = FlaskRedis.from_custom_provider(MockRedisWrapper)
else:
redis_store = FlaskRedis()
redis_store.init_app(app)
app.register_blueprint(api_bp)
return app
| Add Redis client from flask-redis | Add Redis client from flask-redis
| Python | mit | ronert/cf-predict,ronert/cf-predict | python | ## Code Before:
import sys
from flask import Flask
from .config import config
from .api import api_bp
__project__ = 'cf-predict'
__version__ = '0.0.0'
VERSION = "{0} v{1}".format(__project__, __version__)
PYTHON_VERSION = 3, 4
if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test)
sys.exit("Python {}.{}+ is required.".format(*PYTHON_VERSION))
def create_app(config_name):
"""Flask application factory."""
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
app.register_blueprint(api_bp)
return app
## Instruction:
Add Redis client from flask-redis
## Code After:
import sys
from flask import Flask
from mockredis import MockRedis
from flask_redis import FlaskRedis
from .config import config
from .api import api_bp
__project__ = 'cf-predict'
__version__ = '0.0.0'
VERSION = "{0} v{1}".format(__project__, __version__)
PYTHON_VERSION = 3, 4
if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test)
sys.exit("Python {}.{}+ is required.".format(*PYTHON_VERSION))
class MockRedisWrapper(MockRedis):
"""A wrapper to add the `from_url` classmethod."""
@classmethod
def from_url(cls, *args, **kwargs):
return cls()
def create_app(config_name):
"""Flask application factory."""
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
if app.testing:
redis_store = FlaskRedis.from_custom_provider(MockRedisWrapper)
else:
redis_store = FlaskRedis()
redis_store.init_app(app)
app.register_blueprint(api_bp)
return app
| import sys
from flask import Flask
+ from mockredis import MockRedis
+ from flask_redis import FlaskRedis
from .config import config
from .api import api_bp
__project__ = 'cf-predict'
__version__ = '0.0.0'
VERSION = "{0} v{1}".format(__project__, __version__)
PYTHON_VERSION = 3, 4
if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test)
sys.exit("Python {}.{}+ is required.".format(*PYTHON_VERSION))
+ class MockRedisWrapper(MockRedis):
+ """A wrapper to add the `from_url` classmethod."""
+
+ @classmethod
+ def from_url(cls, *args, **kwargs):
+ return cls()
+
+
def create_app(config_name):
"""Flask application factory."""
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
+ if app.testing:
+ redis_store = FlaskRedis.from_custom_provider(MockRedisWrapper)
+ else:
+ redis_store = FlaskRedis()
+ redis_store.init_app(app)
app.register_blueprint(api_bp)
-
return app | 16 | 0.64 | 15 | 1 |
4e7b455507a29ec17dbd66a2b284b982903e41a5 | packages/st/styx.yaml | packages/st/styx.yaml | homepage: ''
changelog-type: ''
hash: 937ad695670b8c8e98c6b0240aefb95ce35bd08fffcb1571fa5526ca4147c42f
test-bench-deps: {}
maintainer: jeanphilippe.bernardy@gmail.com
synopsis: A generator of nix files
changelog: ''
basic-deps:
base: <=666
text: -any
filepath: ! '>=1.3'
process: ! '>=1.1'
containers: -any
mtl: -any
optparse-applicative: -any
aeson: -any
yaml: -any
directory: ! '>=1.1'
all-versions:
- '1.0'
- '1.1'
author: Jean-Philippe Bernardy
latest: '1.1'
description-type: haddock
description: Soon to appear.
license-name: GPL
| homepage: ''
changelog-type: ''
hash: 03b7f1e4fffe19237f278c6b7c138753947189f5d9ae5ac1d5e66bba4b3ce953
test-bench-deps: {}
maintainer: jeanphilippe.bernardy@gmail.com
synopsis: A generator of nix files
changelog: ''
basic-deps:
base: <=666
text: -any
filepath: ! '>=1.3'
process: ! '>=1.1'
containers: -any
mtl: -any
optparse-applicative: -any
aeson: -any
yaml: -any
directory: ! '>=1.1'
all-versions:
- '1.0'
- '1.1'
- '1.2'
author: Jean-Philippe Bernardy
latest: '1.2'
description-type: haddock
description: Soon to appear.
license-name: GPL
| Update from Hackage at 2017-02-03T07:28:38Z | Update from Hackage at 2017-02-03T07:28:38Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: ''
hash: 937ad695670b8c8e98c6b0240aefb95ce35bd08fffcb1571fa5526ca4147c42f
test-bench-deps: {}
maintainer: jeanphilippe.bernardy@gmail.com
synopsis: A generator of nix files
changelog: ''
basic-deps:
base: <=666
text: -any
filepath: ! '>=1.3'
process: ! '>=1.1'
containers: -any
mtl: -any
optparse-applicative: -any
aeson: -any
yaml: -any
directory: ! '>=1.1'
all-versions:
- '1.0'
- '1.1'
author: Jean-Philippe Bernardy
latest: '1.1'
description-type: haddock
description: Soon to appear.
license-name: GPL
## Instruction:
Update from Hackage at 2017-02-03T07:28:38Z
## Code After:
homepage: ''
changelog-type: ''
hash: 03b7f1e4fffe19237f278c6b7c138753947189f5d9ae5ac1d5e66bba4b3ce953
test-bench-deps: {}
maintainer: jeanphilippe.bernardy@gmail.com
synopsis: A generator of nix files
changelog: ''
basic-deps:
base: <=666
text: -any
filepath: ! '>=1.3'
process: ! '>=1.1'
containers: -any
mtl: -any
optparse-applicative: -any
aeson: -any
yaml: -any
directory: ! '>=1.1'
all-versions:
- '1.0'
- '1.1'
- '1.2'
author: Jean-Philippe Bernardy
latest: '1.2'
description-type: haddock
description: Soon to appear.
license-name: GPL
| homepage: ''
changelog-type: ''
- hash: 937ad695670b8c8e98c6b0240aefb95ce35bd08fffcb1571fa5526ca4147c42f
+ hash: 03b7f1e4fffe19237f278c6b7c138753947189f5d9ae5ac1d5e66bba4b3ce953
test-bench-deps: {}
maintainer: jeanphilippe.bernardy@gmail.com
synopsis: A generator of nix files
changelog: ''
basic-deps:
base: <=666
text: -any
filepath: ! '>=1.3'
process: ! '>=1.1'
containers: -any
mtl: -any
optparse-applicative: -any
aeson: -any
yaml: -any
directory: ! '>=1.1'
all-versions:
- '1.0'
- '1.1'
+ - '1.2'
author: Jean-Philippe Bernardy
- latest: '1.1'
? ^
+ latest: '1.2'
? ^
description-type: haddock
description: Soon to appear.
license-name: GPL | 5 | 0.192308 | 3 | 2 |
6e34f5d8c1071ad2256e414652f072fa7251fab0 | app/views/projects/index.html.erb | app/views/projects/index.html.erb | <div class="page-header">
<%= page_title "Projects" %>
</div>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group btn-group-sm">
<button id="all" class="btn btn-primary">All</button>
<button id="current-projects" class="btn btn-default js-filter">Current</button>
<button id="past-projects" class="btn btn-default js-filter">Past</button>
</div>
<div class="btn-group btn-group-sm">
<% @project_categories.each do |category| %>
<button id="<%= category.slug %>" class="btn btn-default js-filter">
<%= category.name %>
</button>
<% end %>
</div>
</div>
<hr />
<%= render @projects %>
<% if current_tenant == current_user %>
<%= link_to "New Project", new_project_path, :class => 'btn btn-primary' if user_signed_in? %>
<% end %>
| <div class="page-header">
<%= page_title "Projects" %>
</div>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group btn-group-sm">
<button id="all" class="btn btn-primary">All</button>
<button id="current-projects" class="btn btn-default js-filter">Current</button>
<button id="past-projects" class="btn btn-default js-filter">Past</button>
</div>
<div class="btn-group btn-group-sm">
<% @project_categories.each do |category| %>
<button id="<%= category.slug %>" class="btn btn-default js-filter">
<%= category.name %>
</button>
<% end %>
</div>
<% if user_signed_in? and current_tenant == current_user %>
<div class="btn-group btn-group-sm pull-right">
<%= link_to new_project_path, class: 'btn btn-primary btn-sm' do %>
<%= icon 'plus', 'Add' %>
<% end %>
<button type="button" class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><%= link_to "New Project", new_project_path %></li>
<li><%= link_to "New Project Category", new_project_category_path %></li>
</ul>
</div>
<% end %>
</div>
<hr />
<%= render @projects %>
| Move add project button to project button toolbar. add link to add project category. | Move add project button to project button toolbar. add link to add project category.
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
| HTML+ERB | apache-2.0 | maxfierke/resumis,maxfierke/resumis,maxfierke/resumis,maxfierke/resumis | html+erb | ## Code Before:
<div class="page-header">
<%= page_title "Projects" %>
</div>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group btn-group-sm">
<button id="all" class="btn btn-primary">All</button>
<button id="current-projects" class="btn btn-default js-filter">Current</button>
<button id="past-projects" class="btn btn-default js-filter">Past</button>
</div>
<div class="btn-group btn-group-sm">
<% @project_categories.each do |category| %>
<button id="<%= category.slug %>" class="btn btn-default js-filter">
<%= category.name %>
</button>
<% end %>
</div>
</div>
<hr />
<%= render @projects %>
<% if current_tenant == current_user %>
<%= link_to "New Project", new_project_path, :class => 'btn btn-primary' if user_signed_in? %>
<% end %>
## Instruction:
Move add project button to project button toolbar. add link to add project category.
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
## Code After:
<div class="page-header">
<%= page_title "Projects" %>
</div>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group btn-group-sm">
<button id="all" class="btn btn-primary">All</button>
<button id="current-projects" class="btn btn-default js-filter">Current</button>
<button id="past-projects" class="btn btn-default js-filter">Past</button>
</div>
<div class="btn-group btn-group-sm">
<% @project_categories.each do |category| %>
<button id="<%= category.slug %>" class="btn btn-default js-filter">
<%= category.name %>
</button>
<% end %>
</div>
<% if user_signed_in? and current_tenant == current_user %>
<div class="btn-group btn-group-sm pull-right">
<%= link_to new_project_path, class: 'btn btn-primary btn-sm' do %>
<%= icon 'plus', 'Add' %>
<% end %>
<button type="button" class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><%= link_to "New Project", new_project_path %></li>
<li><%= link_to "New Project Category", new_project_category_path %></li>
</ul>
</div>
<% end %>
</div>
<hr />
<%= render @projects %>
| <div class="page-header">
<%= page_title "Projects" %>
</div>
<div class="btn-toolbar" role="toolbar">
- <div class="btn-group btn-group-sm">
? --
+ <div class="btn-group btn-group-sm">
- <button id="all" class="btn btn-primary">All</button>
? ----
+ <button id="all" class="btn btn-primary">All</button>
- <button id="current-projects" class="btn btn-default js-filter">Current</button>
? ----
+ <button id="current-projects" class="btn btn-default js-filter">Current</button>
- <button id="past-projects" class="btn btn-default js-filter">Past</button>
? ----
+ <button id="past-projects" class="btn btn-default js-filter">Past</button>
- </div>
? --
+ </div>
- <div class="btn-group btn-group-sm">
? --
+ <div class="btn-group btn-group-sm">
- <% @project_categories.each do |category| %>
? --
+ <% @project_categories.each do |category| %>
- <button id="<%= category.slug %>" class="btn btn-default js-filter">
? --
+ <button id="<%= category.slug %>" class="btn btn-default js-filter">
- <%= category.name %>
? --
+ <%= category.name %>
- </button>
? --
+ </button>
- <% end %>
? --
+ <% end %>
- </div>
? --
+ </div>
+ <% if user_signed_in? and current_tenant == current_user %>
+ <div class="btn-group btn-group-sm pull-right">
+ <%= link_to new_project_path, class: 'btn btn-primary btn-sm' do %>
+ <%= icon 'plus', 'Add' %>
+ <% end %>
+ <button type="button" class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
+ <span class="caret"></span>
+ <span class="sr-only">Toggle Dropdown</span>
+ </button>
+ <ul class="dropdown-menu" role="menu">
+ <li><%= link_to "New Project", new_project_path %></li>
+ <li><%= link_to "New Project Category", new_project_category_path %></li>
+ </ul>
+ </div>
+ <% end %>
</div>
<hr />
<%= render @projects %>
-
- <% if current_tenant == current_user %>
- <%= link_to "New Project", new_project_path, :class => 'btn btn-primary' if user_signed_in? %>
- <% end %> | 43 | 1.72 | 27 | 16 |
a20418ad43074a93bc21b97611c4967713ebc897 | plugins/providers/hyperv/scripts/list_hdds.ps1 | plugins/providers/hyperv/scripts/list_hdds.ps1 |
param(
[Parameter(Mandatory=$true)]
[string]$VmId
)
try {
$VM = Hyper-V\Get-VM -Id $VmId
Hyper-V\Get-VMHardDiskDrive -VMName $VM
} catch {
Write-ErrorMessage "Failed to retrieve all disk info from ${VM}: ${PSItem}"
exit 1
}
|
param(
[Parameter(Mandatory=$true)]
[string]$VmId
)
try {
$VM = Hyper-V\Get-VM -Id $VmId
$Disks = @(Hyper-V\Get-VMHardDiskDrive -VMName $VM)
} catch {
Write-ErrorMessage "Failed to retrieve all disk info from ${VM}: ${PSItem}"
exit 1
}
$result = ConvertTo-json $Disks
Write-OutputMessage $result
| Format output from json to return to hyper-v driver | Format output from json to return to hyper-v driver
| PowerShell | mit | mitchellh/vagrant,mitchellh/vagrant,chrisroberts/vagrant,sni/vagrant,marxarelli/vagrant,sni/vagrant,chrisroberts/vagrant,mitchellh/vagrant,marxarelli/vagrant,chrisroberts/vagrant,chrisroberts/vagrant,mitchellh/vagrant,marxarelli/vagrant,sni/vagrant,sni/vagrant,marxarelli/vagrant | powershell | ## Code Before:
param(
[Parameter(Mandatory=$true)]
[string]$VmId
)
try {
$VM = Hyper-V\Get-VM -Id $VmId
Hyper-V\Get-VMHardDiskDrive -VMName $VM
} catch {
Write-ErrorMessage "Failed to retrieve all disk info from ${VM}: ${PSItem}"
exit 1
}
## Instruction:
Format output from json to return to hyper-v driver
## Code After:
param(
[Parameter(Mandatory=$true)]
[string]$VmId
)
try {
$VM = Hyper-V\Get-VM -Id $VmId
$Disks = @(Hyper-V\Get-VMHardDiskDrive -VMName $VM)
} catch {
Write-ErrorMessage "Failed to retrieve all disk info from ${VM}: ${PSItem}"
exit 1
}
$result = ConvertTo-json $Disks
Write-OutputMessage $result
|
param(
[Parameter(Mandatory=$true)]
[string]$VmId
)
try {
$VM = Hyper-V\Get-VM -Id $VmId
- Hyper-V\Get-VMHardDiskDrive -VMName $VM
+ $Disks = @(Hyper-V\Get-VMHardDiskDrive -VMName $VM)
? +++++++++++ +
} catch {
Write-ErrorMessage "Failed to retrieve all disk info from ${VM}: ${PSItem}"
exit 1
}
+
+ $result = ConvertTo-json $Disks
+ Write-OutputMessage $result | 5 | 0.384615 | 4 | 1 |
ac421dbb24455d530bfb3fc6c061d8d6a6958fd0 | recipes/bioconductor-flowdensity/meta.yaml | recipes/bioconductor-flowdensity/meta.yaml | package:
name: bioconductor-flowdensity
version: 1.6.0
source:
fn: flowDensity_1.6.0.tar.gz
url: https://bioarchive.galaxyproject.org/flowDensity_1.6.0.tar.gz
md5: c9c7d1e7415d6e49556a33a06c28a6a0
build:
skip: True # [osx]
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
run:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
test:
commands:
- '$R -e "library(''flowDensity'')"'
about:
home: http://bioconductor.org/packages/release/bioc/html/flowDensity.html
license: Artistic-2.0
summary: 'This package provides tools for automated sequential gating analogous
to the manual gating strategy based on the density of the data.'
| package:
name: bioconductor-flowdensity
version: 1.6.0
source:
fn: flowDensity_1.6.0.tar.gz
url: https://bioarchive.galaxyproject.org/flowDensity_1.6.0.tar.gz
md5: c9c7d1e7415d6e49556a33a06c28a6a0
build:
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
run:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
test:
commands:
- '$R -e "library(''flowDensity'')"'
about:
home: http://bioconductor.org/packages/release/bioc/html/flowDensity.html
license: Artistic-2.0
summary: 'This package provides tools for automated sequential gating analogous
to the manual gating strategy based on the density of the data.'
| Add OS X build for bioconductor-flowdensity. | Add OS X build for bioconductor-flowdensity.
| YAML | mit | bow/bioconda-recipes,matthdsm/bioconda-recipes,daler/bioconda-recipes,bioconda/recipes,colinbrislawn/bioconda-recipes,bioconda/recipes,hardingnj/bioconda-recipes,xguse/bioconda-recipes,ivirshup/bioconda-recipes,abims-sbr/bioconda-recipes,blankenberg/bioconda-recipes,shenwei356/bioconda-recipes,phac-nml/bioconda-recipes,mcornwell1957/bioconda-recipes,HassanAmr/bioconda-recipes,colinbrislawn/bioconda-recipes,chapmanb/bioconda-recipes,ivirshup/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,omicsnut/bioconda-recipes,bioconda/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,rvalieris/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,ostrokach/bioconda-recipes,saketkc/bioconda-recipes,joachimwolff/bioconda-recipes,gvlproject/bioconda-recipes,rvalieris/bioconda-recipes,martin-mann/bioconda-recipes,joachimwolff/bioconda-recipes,JenCabral/bioconda-recipes,gregvonkuster/bioconda-recipes,dmaticzka/bioconda-recipes,xguse/bioconda-recipes,chapmanb/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,rvalieris/bioconda-recipes,phac-nml/bioconda-recipes,JenCabral/bioconda-recipes,phac-nml/bioconda-recipes,cokelaer/bioconda-recipes,pinguinkiste/bioconda-recipes,gvlproject/bioconda-recipes,rob-p/bioconda-recipes,npavlovikj/bioconda-recipes,chapmanb/bioconda-recipes,joachimwolff/bioconda-recipes,daler/bioconda-recipes,colinbrislawn/bioconda-recipes,hardingnj/bioconda-recipes,CGATOxford/bioconda-recipes,npavlovikj/bioconda-recipes,bebatut/bioconda-recipes,gvlproject/bioconda-recipes,cokelaer/bioconda-recipes,saketkc/bioconda-recipes,phac-nml/bioconda-recipes,jfallmann/bioconda-recipes,ivirshup/bioconda-recipes,xguse/bioconda-recipes,martin-mann/bioconda-recipes,gregvonkuster/bioconda-recipes,CGATOxford/bioconda-recipes,jfallmann/bioconda-recipes,pinguinkiste/bioconda-recipes,daler/bioconda-recipes,dkoppstein/recipes,rvalieris/bioconda-recipes,ostrokach/bioconda-recipes,colinbrislawn/bioconda-recipes,gregvonkuster/bioconda-recipes,ostrokach/bioconda-recipes,acaprez/recipes,HassanAmr/bioconda-recipes,colinbrislawn/bioconda-recipes,abims-sbr/bioconda-recipes,CGATOxford/bioconda-recipes,keuv-grvl/bioconda-recipes,chapmanb/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,rob-p/bioconda-recipes,rob-p/bioconda-recipes,blankenberg/bioconda-recipes,zachcp/bioconda-recipes,saketkc/bioconda-recipes,rvalieris/bioconda-recipes,oena/bioconda-recipes,martin-mann/bioconda-recipes,ostrokach/bioconda-recipes,mcornwell1957/bioconda-recipes,guowei-he/bioconda-recipes,dkoppstein/recipes,Luobiny/bioconda-recipes,matthdsm/bioconda-recipes,oena/bioconda-recipes,bow/bioconda-recipes,mdehollander/bioconda-recipes,jasper1918/bioconda-recipes,zachcp/bioconda-recipes,acaprez/recipes,pinguinkiste/bioconda-recipes,bebatut/bioconda-recipes,lpantano/recipes,CGATOxford/bioconda-recipes,xguse/bioconda-recipes,acaprez/recipes,joachimwolff/bioconda-recipes,guowei-he/bioconda-recipes,shenwei356/bioconda-recipes,saketkc/bioconda-recipes,shenwei356/bioconda-recipes,jasper1918/bioconda-recipes,HassanAmr/bioconda-recipes,peterjc/bioconda-recipes,peterjc/bioconda-recipes,omicsnut/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,bebatut/bioconda-recipes,acaprez/recipes,blankenberg/bioconda-recipes,bioconda/bioconda-recipes,chapmanb/bioconda-recipes,martin-mann/bioconda-recipes,matthdsm/bioconda-recipes,colinbrislawn/bioconda-recipes,mdehollander/bioconda-recipes,joachimwolff/bioconda-recipes,guowei-he/bioconda-recipes,dkoppstein/recipes,pinguinkiste/bioconda-recipes,npavlovikj/bioconda-recipes,omicsnut/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,zachcp/bioconda-recipes,saketkc/bioconda-recipes,keuv-grvl/bioconda-recipes,ostrokach/bioconda-recipes,shenwei356/bioconda-recipes,gregvonkuster/bioconda-recipes,keuv-grvl/bioconda-recipes,HassanAmr/bioconda-recipes,ivirshup/bioconda-recipes,hardingnj/bioconda-recipes,ivirshup/bioconda-recipes,peterjc/bioconda-recipes,daler/bioconda-recipes,dmaticzka/bioconda-recipes,mcornwell1957/bioconda-recipes,JenCabral/bioconda-recipes,Luobiny/bioconda-recipes,oena/bioconda-recipes,mdehollander/bioconda-recipes,mcornwell1957/bioconda-recipes,CGATOxford/bioconda-recipes,oena/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,abims-sbr/bioconda-recipes,daler/bioconda-recipes,keuv-grvl/bioconda-recipes,zachcp/bioconda-recipes,phac-nml/bioconda-recipes,ostrokach/bioconda-recipes,hardingnj/bioconda-recipes,JenCabral/bioconda-recipes,guowei-he/bioconda-recipes,rob-p/bioconda-recipes,joachimwolff/bioconda-recipes,gvlproject/bioconda-recipes,jfallmann/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,roryk/recipes,gvlproject/bioconda-recipes,peterjc/bioconda-recipes,gvlproject/bioconda-recipes,oena/bioconda-recipes,keuv-grvl/bioconda-recipes,hardingnj/bioconda-recipes,mcornwell1957/bioconda-recipes,dmaticzka/bioconda-recipes,cokelaer/bioconda-recipes,JenCabral/bioconda-recipes,dmaticzka/bioconda-recipes,saketkc/bioconda-recipes,lpantano/recipes,daler/bioconda-recipes,bow/bioconda-recipes,blankenberg/bioconda-recipes,Luobiny/bioconda-recipes,matthdsm/bioconda-recipes,abims-sbr/bioconda-recipes,jasper1918/bioconda-recipes,bioconda/recipes,peterjc/bioconda-recipes,bow/bioconda-recipes,npavlovikj/bioconda-recipes,dmaticzka/bioconda-recipes,matthdsm/bioconda-recipes,guowei-he/bioconda-recipes,lpantano/recipes,keuv-grvl/bioconda-recipes,ivirshup/bioconda-recipes,bow/bioconda-recipes,pinguinkiste/bioconda-recipes,mdehollander/bioconda-recipes,peterjc/bioconda-recipes,jasper1918/bioconda-recipes,abims-sbr/bioconda-recipes,bioconda/bioconda-recipes,HassanAmr/bioconda-recipes,pinguinkiste/bioconda-recipes,roryk/recipes,CGATOxford/bioconda-recipes,matthdsm/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,Luobiny/bioconda-recipes,HassanAmr/bioconda-recipes,martin-mann/bioconda-recipes,JenCabral/bioconda-recipes,bebatut/bioconda-recipes,omicsnut/bioconda-recipes,cokelaer/bioconda-recipes,jasper1918/bioconda-recipes,dmaticzka/bioconda-recipes,omicsnut/bioconda-recipes,xguse/bioconda-recipes,roryk/recipes,mdehollander/bioconda-recipes,abims-sbr/bioconda-recipes,jfallmann/bioconda-recipes,rvalieris/bioconda-recipes,lpantano/recipes,bow/bioconda-recipes,bioconda/bioconda-recipes,mdehollander/bioconda-recipes | yaml | ## Code Before:
package:
name: bioconductor-flowdensity
version: 1.6.0
source:
fn: flowDensity_1.6.0.tar.gz
url: https://bioarchive.galaxyproject.org/flowDensity_1.6.0.tar.gz
md5: c9c7d1e7415d6e49556a33a06c28a6a0
build:
skip: True # [osx]
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
run:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
test:
commands:
- '$R -e "library(''flowDensity'')"'
about:
home: http://bioconductor.org/packages/release/bioc/html/flowDensity.html
license: Artistic-2.0
summary: 'This package provides tools for automated sequential gating analogous
to the manual gating strategy based on the density of the data.'
## Instruction:
Add OS X build for bioconductor-flowdensity.
## Code After:
package:
name: bioconductor-flowdensity
version: 1.6.0
source:
fn: flowDensity_1.6.0.tar.gz
url: https://bioarchive.galaxyproject.org/flowDensity_1.6.0.tar.gz
md5: c9c7d1e7415d6e49556a33a06c28a6a0
build:
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
run:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
test:
commands:
- '$R -e "library(''flowDensity'')"'
about:
home: http://bioconductor.org/packages/release/bioc/html/flowDensity.html
license: Artistic-2.0
summary: 'This package provides tools for automated sequential gating analogous
to the manual gating strategy based on the density of the data.'
| package:
name: bioconductor-flowdensity
version: 1.6.0
source:
fn: flowDensity_1.6.0.tar.gz
url: https://bioarchive.galaxyproject.org/flowDensity_1.6.0.tar.gz
md5: c9c7d1e7415d6e49556a33a06c28a6a0
build:
- skip: True # [osx]
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
run:
- bioconductor-flowcore
- r
- r-car
- r-geomap
- r-gplots
- r-rfoc
test:
commands:
- '$R -e "library(''flowDensity'')"'
about:
home: http://bioconductor.org/packages/release/bioc/html/flowDensity.html
license: Artistic-2.0
summary: 'This package provides tools for automated sequential gating analogous
to the manual gating strategy based on the density of the data.' | 1 | 0.027778 | 0 | 1 |
ff50b5c9fd6ca080a036a436db3545768261351c | hieradata/node.shell-01.hosting.randomness.org.uk.yaml | hieradata/node.shell-01.hosting.randomness.org.uk.yaml | ---
ufw_allow:
allow-ssh-from-anywhere-ipv4:
port: '22'
from: 'any'
allow-ssh-from-anywhere-ipv6:
port: '22'
from: 'any'
ip: '2a03:b0c0:1:d0::dc:b001/64'
base_packages:
- alpine
- irssi
| ---
ufw_allow:
allow-ssh-from-anywhere-ipv4:
port: '22'
from: 'any'
allow-ssh-from-anywhere-ipv6:
port: '22'
from: 'any'
ip: '2a03:b0c0:1:d0::dc:b001/64'
base_packages:
- alpine
- irssi
accounts:
workbob:
comment: 'bob walker'
| Set up a work bob account on shell-01 | Set up a work bob account on shell-01
| YAML | mit | rjw1/randomness-puppet,rjw1/randomness-puppet | yaml | ## Code Before:
---
ufw_allow:
allow-ssh-from-anywhere-ipv4:
port: '22'
from: 'any'
allow-ssh-from-anywhere-ipv6:
port: '22'
from: 'any'
ip: '2a03:b0c0:1:d0::dc:b001/64'
base_packages:
- alpine
- irssi
## Instruction:
Set up a work bob account on shell-01
## Code After:
---
ufw_allow:
allow-ssh-from-anywhere-ipv4:
port: '22'
from: 'any'
allow-ssh-from-anywhere-ipv6:
port: '22'
from: 'any'
ip: '2a03:b0c0:1:d0::dc:b001/64'
base_packages:
- alpine
- irssi
accounts:
workbob:
comment: 'bob walker'
| ---
ufw_allow:
allow-ssh-from-anywhere-ipv4:
port: '22'
from: 'any'
allow-ssh-from-anywhere-ipv6:
port: '22'
from: 'any'
ip: '2a03:b0c0:1:d0::dc:b001/64'
base_packages:
- alpine
- irssi
+
+ accounts:
+ workbob:
+ comment: 'bob walker' | 4 | 0.285714 | 4 | 0 |
78f9aed600955ca46a02e8b6cf715a5cc27e8450 | viewer/index.html | viewer/index.html | <!DOCTYPE html>
<head>
<title>Kantai Collection</title>
<style type="text/css">
html, body { padding: 0; margin: 0; }
</style>
<script type="text/javascript">
function setAPILink(link) {
var e = document.createElement("embed")
e.setAttribute("src", link)
e.setAttribute("type", "application/x-shockwave-flash")
e.setAttribute("quality", "high")
e.setAttribute("width", "800")
e.setAttribute("height", "480")
document.body.appendChild(e)
}
</script>
</head>
<body>
</body>
</html> | <!DOCTYPE html>
<head>
<title>Kantai Collection</title>
<style type="text/css">
html, body { padding: 0; margin: 0; }
</style>
<script type="text/javascript">
function setAPILink(link) {
// Remove any eventual old embeds
var oldEmbeds = document.getElementsByTagName("embed")
for(var i = 0; i < oldEmbeds.length; i++) { oldEmbeds[i].parentNode.removeChild(oldEmbeds[i]) }
// Add a new one
var e = document.createElement("embed")
e.setAttribute("src", link)
e.setAttribute("type", "application/x-shockwave-flash")
e.setAttribute("quality", "high")
e.setAttribute("width", "800")
e.setAttribute("height", "480")
document.body.appendChild(e)
}
</script>
</head>
<body>
</body>
</html> | Make it possible to call setAPILink() multiple times | Make it possible to call setAPILink() multiple times
| HTML | mit | kevin01523/KanColleTool,kevin01523/KanColleTool,KanColleTool/KanColleTool,KanColleTool/KanColleTool,kevin01523/KanColleTool | html | ## Code Before:
<!DOCTYPE html>
<head>
<title>Kantai Collection</title>
<style type="text/css">
html, body { padding: 0; margin: 0; }
</style>
<script type="text/javascript">
function setAPILink(link) {
var e = document.createElement("embed")
e.setAttribute("src", link)
e.setAttribute("type", "application/x-shockwave-flash")
e.setAttribute("quality", "high")
e.setAttribute("width", "800")
e.setAttribute("height", "480")
document.body.appendChild(e)
}
</script>
</head>
<body>
</body>
</html>
## Instruction:
Make it possible to call setAPILink() multiple times
## Code After:
<!DOCTYPE html>
<head>
<title>Kantai Collection</title>
<style type="text/css">
html, body { padding: 0; margin: 0; }
</style>
<script type="text/javascript">
function setAPILink(link) {
// Remove any eventual old embeds
var oldEmbeds = document.getElementsByTagName("embed")
for(var i = 0; i < oldEmbeds.length; i++) { oldEmbeds[i].parentNode.removeChild(oldEmbeds[i]) }
// Add a new one
var e = document.createElement("embed")
e.setAttribute("src", link)
e.setAttribute("type", "application/x-shockwave-flash")
e.setAttribute("quality", "high")
e.setAttribute("width", "800")
e.setAttribute("height", "480")
document.body.appendChild(e)
}
</script>
</head>
<body>
</body>
</html> | <!DOCTYPE html>
<head>
<title>Kantai Collection</title>
<style type="text/css">
html, body { padding: 0; margin: 0; }
</style>
<script type="text/javascript">
function setAPILink(link) {
+ // Remove any eventual old embeds
+ var oldEmbeds = document.getElementsByTagName("embed")
+ for(var i = 0; i < oldEmbeds.length; i++) { oldEmbeds[i].parentNode.removeChild(oldEmbeds[i]) }
+
+ // Add a new one
var e = document.createElement("embed")
e.setAttribute("src", link)
e.setAttribute("type", "application/x-shockwave-flash")
e.setAttribute("quality", "high")
e.setAttribute("width", "800")
e.setAttribute("height", "480")
document.body.appendChild(e)
}
</script>
</head>
<body>
</body>
</html> | 5 | 0.227273 | 5 | 0 |
0d3714757572456bca52ac2dcb309516ea71cd6f | .travis/test_pillars/buildbot/master.sls | .travis/test_pillars/buildbot/master.sls | buildbot:
credentials:
'http-user': 'TEST_BUILDBOT_HTTP_USER'
'http-pass': 'TEST_BUILDBOT_HTTP_PASS'
'change-pass': 'TEST_BUILDBOT_CHANGE_PASS'
'gh-doc-token': 'TEST_BUILDBOT_GH_DOC_TOKEN'
'gh-hook-secret': 'TEST_BUILDBOT_GH_HOOK_SECRET'
'gh-status-token': 'TEST_BUILDBOT_GH_STATUS_TOKEN'
'homu-secret': 'TEST_BUILDBOT_HOMU_SECRET'
's3-upload-access-key-id': 'TEST_BUILDBOT_S3_UPLOAD_ACCESS_KEY_ID'
's3-upload-secret-access-key': 'TEST_BUILDBOT_S3_UPLOAD_SECRET_ACCESS_KEY'
| buildbot:
credentials:
'http-user': 'TEST_BUILDBOT_HTTP_USER'
'http-pass': 'TEST_BUILDBOT_HTTP_PASS'
'change-pass': 'TEST_BUILDBOT_CHANGE_PASS'
'gh-doc-token': 'TEST_BUILDBOT_GH_DOC_TOKEN'
'gh-homebrew-token': 'TEST_BUILDBOT_GH_HOMEBREW_TOKEN'
'gh-hook-secret': 'TEST_BUILDBOT_GH_HOOK_SECRET'
'gh-status-token': 'TEST_BUILDBOT_GH_STATUS_TOKEN'
'homu-secret': 'TEST_BUILDBOT_HOMU_SECRET'
's3-upload-access-key-id': 'TEST_BUILDBOT_S3_UPLOAD_ACCESS_KEY_ID'
's3-upload-secret-access-key': 'TEST_BUILDBOT_S3_UPLOAD_SECRET_ACCESS_KEY'
| Add fake Github Homebrew Token for Travis | Add fake Github Homebrew Token for Travis
We recently added a new homebrew nightly builder, which pushes to the
`servo/homebrew-servo` repository to make new binary nightlies
available via Homebrew. This requires a Github token to push to the
repository.
However, the original PR did not include a fake token for the Travis
failure, causing the builder to fail only on Travis (where the test
pillars did not have the corresponding token), but not in production.
| SaltStack | apache-2.0 | rwaweber/saltfs,rwaweber/saltfs,servo/saltfs,ALikhachev/saltfs,ALikhachev/saltfs,UK992/saltfs,UK992/saltfs,servo/saltfs,UK992/saltfs,ALikhachev/saltfs,rwaweber/saltfs | saltstack | ## Code Before:
buildbot:
credentials:
'http-user': 'TEST_BUILDBOT_HTTP_USER'
'http-pass': 'TEST_BUILDBOT_HTTP_PASS'
'change-pass': 'TEST_BUILDBOT_CHANGE_PASS'
'gh-doc-token': 'TEST_BUILDBOT_GH_DOC_TOKEN'
'gh-hook-secret': 'TEST_BUILDBOT_GH_HOOK_SECRET'
'gh-status-token': 'TEST_BUILDBOT_GH_STATUS_TOKEN'
'homu-secret': 'TEST_BUILDBOT_HOMU_SECRET'
's3-upload-access-key-id': 'TEST_BUILDBOT_S3_UPLOAD_ACCESS_KEY_ID'
's3-upload-secret-access-key': 'TEST_BUILDBOT_S3_UPLOAD_SECRET_ACCESS_KEY'
## Instruction:
Add fake Github Homebrew Token for Travis
We recently added a new homebrew nightly builder, which pushes to the
`servo/homebrew-servo` repository to make new binary nightlies
available via Homebrew. This requires a Github token to push to the
repository.
However, the original PR did not include a fake token for the Travis
failure, causing the builder to fail only on Travis (where the test
pillars did not have the corresponding token), but not in production.
## Code After:
buildbot:
credentials:
'http-user': 'TEST_BUILDBOT_HTTP_USER'
'http-pass': 'TEST_BUILDBOT_HTTP_PASS'
'change-pass': 'TEST_BUILDBOT_CHANGE_PASS'
'gh-doc-token': 'TEST_BUILDBOT_GH_DOC_TOKEN'
'gh-homebrew-token': 'TEST_BUILDBOT_GH_HOMEBREW_TOKEN'
'gh-hook-secret': 'TEST_BUILDBOT_GH_HOOK_SECRET'
'gh-status-token': 'TEST_BUILDBOT_GH_STATUS_TOKEN'
'homu-secret': 'TEST_BUILDBOT_HOMU_SECRET'
's3-upload-access-key-id': 'TEST_BUILDBOT_S3_UPLOAD_ACCESS_KEY_ID'
's3-upload-secret-access-key': 'TEST_BUILDBOT_S3_UPLOAD_SECRET_ACCESS_KEY'
| buildbot:
credentials:
'http-user': 'TEST_BUILDBOT_HTTP_USER'
'http-pass': 'TEST_BUILDBOT_HTTP_PASS'
'change-pass': 'TEST_BUILDBOT_CHANGE_PASS'
'gh-doc-token': 'TEST_BUILDBOT_GH_DOC_TOKEN'
+ 'gh-homebrew-token': 'TEST_BUILDBOT_GH_HOMEBREW_TOKEN'
'gh-hook-secret': 'TEST_BUILDBOT_GH_HOOK_SECRET'
'gh-status-token': 'TEST_BUILDBOT_GH_STATUS_TOKEN'
'homu-secret': 'TEST_BUILDBOT_HOMU_SECRET'
's3-upload-access-key-id': 'TEST_BUILDBOT_S3_UPLOAD_ACCESS_KEY_ID'
's3-upload-secret-access-key': 'TEST_BUILDBOT_S3_UPLOAD_SECRET_ACCESS_KEY' | 1 | 0.090909 | 1 | 0 |
be95a650e3598ab9abb2a5a0fa1b228bfaf64b84 | examples/step3_loadModel.js | examples/step3_loadModel.js | 'use strict';
var w2v = require( './../lib' );
w2v.loadModel( __dirname + '/fixtures/vectors.txt', function( err, model ) {
console.log( model );
var wordVecs = model.getVectors( [ 'Hamlet', 'daughter' ] );
console.log( wordVecs );
console.log( model.getNearestWord( wordVecs[0].values, 1 ) );
var similar = model.mostSimilar( 'dead', 20 );
console.log( similar );
var analogy = model.analogy( 'mother',[ 'Hamlet', 'father' ], 10 );
console.log( analogy );
var similarity = model.similarity( 'father', 'mother' );
console.log( similarity );
});
| 'use strict';
var w2v = require( './../lib' );
w2v.loadModel( __dirname + '/fixtures/vectors.txt', function( err, model ) {
console.log( model );
var wordVecs = model.getVectors( [ 'Hamlet', 'daughter' ] );
console.log( model.getNearestWord( wordVecs[0].values, 1 ) );
var similar = model.mostSimilar( 'dead', 20 );
console.log( similar );
var analogy = model.analogy( 'mother',[ 'Hamlet', 'father' ], 10 );
console.log( analogy );
var similarity = model.similarity( 'father', 'mother' );
console.log( similarity );
});
| Remove unwanted console.log statement in example code | Remove unwanted console.log statement in example code
| JavaScript | apache-2.0 | Planeshifter/node-word2vec,Planeshifter/node-word2vec,Planeshifter/node-word2vec | javascript | ## Code Before:
'use strict';
var w2v = require( './../lib' );
w2v.loadModel( __dirname + '/fixtures/vectors.txt', function( err, model ) {
console.log( model );
var wordVecs = model.getVectors( [ 'Hamlet', 'daughter' ] );
console.log( wordVecs );
console.log( model.getNearestWord( wordVecs[0].values, 1 ) );
var similar = model.mostSimilar( 'dead', 20 );
console.log( similar );
var analogy = model.analogy( 'mother',[ 'Hamlet', 'father' ], 10 );
console.log( analogy );
var similarity = model.similarity( 'father', 'mother' );
console.log( similarity );
});
## Instruction:
Remove unwanted console.log statement in example code
## Code After:
'use strict';
var w2v = require( './../lib' );
w2v.loadModel( __dirname + '/fixtures/vectors.txt', function( err, model ) {
console.log( model );
var wordVecs = model.getVectors( [ 'Hamlet', 'daughter' ] );
console.log( model.getNearestWord( wordVecs[0].values, 1 ) );
var similar = model.mostSimilar( 'dead', 20 );
console.log( similar );
var analogy = model.analogy( 'mother',[ 'Hamlet', 'father' ], 10 );
console.log( analogy );
var similarity = model.similarity( 'father', 'mother' );
console.log( similarity );
});
| 'use strict';
var w2v = require( './../lib' );
w2v.loadModel( __dirname + '/fixtures/vectors.txt', function( err, model ) {
console.log( model );
var wordVecs = model.getVectors( [ 'Hamlet', 'daughter' ] );
- console.log( wordVecs );
console.log( model.getNearestWord( wordVecs[0].values, 1 ) );
var similar = model.mostSimilar( 'dead', 20 );
console.log( similar );
var analogy = model.analogy( 'mother',[ 'Hamlet', 'father' ], 10 );
console.log( analogy );
var similarity = model.similarity( 'father', 'mother' );
console.log( similarity );
}); | 1 | 0.05 | 0 | 1 |
cc25dc41fec6523e8f3ef9cdfd85b955a0854809 | protobuf-examples/vs-prost/src/triangle.proto | protobuf-examples/vs-prost/src/triangle.proto | syntax = "proto3";
enum Color {
UNKNOWN = 0;
RED = 1;
GREEN = 2;
BLUE = 3;
}
message Properties {
oneof properties {
int32 p1 = 1;
string p2 = 2;
}
}
message Triangle {
string description = 1;
Color color = 2;
Properties properties = 3;
}
| syntax = "proto3";
enum Color {
UNKNOWN = 0;
RED = 1;
GREEN = 2;
BLUE = 3;
}
message Properties {
oneof properties {
int32 p1 = 1;
string p2 = 2;
}
}
message Triangle {
string description = 1;
Color color = 2;
Properties properties = 3;
int32 struct = 4;
}
| Add example of host protobuf vs prost escapes identifiers | Add example of host protobuf vs prost escapes identifiers
| Protocol Buffer | mit | stepancheg/rust-protobuf,stepancheg/rust-protobuf,stepancheg/rust-protobuf | protocol-buffer | ## Code Before:
syntax = "proto3";
enum Color {
UNKNOWN = 0;
RED = 1;
GREEN = 2;
BLUE = 3;
}
message Properties {
oneof properties {
int32 p1 = 1;
string p2 = 2;
}
}
message Triangle {
string description = 1;
Color color = 2;
Properties properties = 3;
}
## Instruction:
Add example of host protobuf vs prost escapes identifiers
## Code After:
syntax = "proto3";
enum Color {
UNKNOWN = 0;
RED = 1;
GREEN = 2;
BLUE = 3;
}
message Properties {
oneof properties {
int32 p1 = 1;
string p2 = 2;
}
}
message Triangle {
string description = 1;
Color color = 2;
Properties properties = 3;
int32 struct = 4;
}
| syntax = "proto3";
enum Color {
UNKNOWN = 0;
RED = 1;
GREEN = 2;
BLUE = 3;
}
message Properties {
oneof properties {
int32 p1 = 1;
string p2 = 2;
}
}
message Triangle {
string description = 1;
Color color = 2;
Properties properties = 3;
+ int32 struct = 4;
} | 1 | 0.047619 | 1 | 0 |
f3df3b2b8e1167e953457a85f2297d28b6a39729 | examples/Micro.Blog/microblog.py | examples/Micro.Blog/microblog.py | from getpass import getpass
from bessie import BaseClient
import config
class MicroBlogApi(BaseClient):
endpoints = config.available_endpoints
separator = '/'
base_url='https://micro.blog'
def __init__(self, path='', token=''):
self.token = token
super(self.__class__, self).__init__(path, token=token)
# override method from BaseClient to inject Authorization header
def _prepare_request(self):
super(self.__class__, self)._prepare_request()
self.request.headers['Authorization'] = 'Token {}'.format(self.token)
if __name__ == '__main__':
token = getpass('Token... ')
mba = MicroBlogApi(token=token)
# GET - https://micro.blog/posts/all
posts = mba.posts.all.get()
print(posts.status_code, posts.reason)
print(posts.json())
| from getpass import getpass
from bessie import BaseClient
import config
class MicroBlogApi(BaseClient):
endpoints = config.available_endpoints
separator = '/'
base_url='https://micro.blog'
def __init__(self, path='', path_params=None, token=''):
self.token = token
super(self.__class__, self).__init__(path, path_params, token=token)
# override method from BaseClient to inject Authorization header
def _prepare_request(self):
super(self.__class__, self)._prepare_request()
self.request.headers['Authorization'] = 'Token {}'.format(self.token)
if __name__ == '__main__':
token = getpass('Token... ')
mba = MicroBlogApi(token=token)
# GET - https://micro.blog/posts/all
posts = mba.posts.all.get()
print(posts.status_code, posts.reason)
print(posts.json())
| Include path_params in override constructor | Include path_params in override constructor
| Python | mit | andymitchhank/bessie | python | ## Code Before:
from getpass import getpass
from bessie import BaseClient
import config
class MicroBlogApi(BaseClient):
endpoints = config.available_endpoints
separator = '/'
base_url='https://micro.blog'
def __init__(self, path='', token=''):
self.token = token
super(self.__class__, self).__init__(path, token=token)
# override method from BaseClient to inject Authorization header
def _prepare_request(self):
super(self.__class__, self)._prepare_request()
self.request.headers['Authorization'] = 'Token {}'.format(self.token)
if __name__ == '__main__':
token = getpass('Token... ')
mba = MicroBlogApi(token=token)
# GET - https://micro.blog/posts/all
posts = mba.posts.all.get()
print(posts.status_code, posts.reason)
print(posts.json())
## Instruction:
Include path_params in override constructor
## Code After:
from getpass import getpass
from bessie import BaseClient
import config
class MicroBlogApi(BaseClient):
endpoints = config.available_endpoints
separator = '/'
base_url='https://micro.blog'
def __init__(self, path='', path_params=None, token=''):
self.token = token
super(self.__class__, self).__init__(path, path_params, token=token)
# override method from BaseClient to inject Authorization header
def _prepare_request(self):
super(self.__class__, self)._prepare_request()
self.request.headers['Authorization'] = 'Token {}'.format(self.token)
if __name__ == '__main__':
token = getpass('Token... ')
mba = MicroBlogApi(token=token)
# GET - https://micro.blog/posts/all
posts = mba.posts.all.get()
print(posts.status_code, posts.reason)
print(posts.json())
| from getpass import getpass
from bessie import BaseClient
import config
class MicroBlogApi(BaseClient):
endpoints = config.available_endpoints
separator = '/'
base_url='https://micro.blog'
- def __init__(self, path='', token=''):
+ def __init__(self, path='', path_params=None, token=''):
? ++++++++++++++++++
self.token = token
- super(self.__class__, self).__init__(path, token=token)
+ super(self.__class__, self).__init__(path, path_params, token=token)
? +++++++++++++
# override method from BaseClient to inject Authorization header
def _prepare_request(self):
super(self.__class__, self)._prepare_request()
self.request.headers['Authorization'] = 'Token {}'.format(self.token)
if __name__ == '__main__':
token = getpass('Token... ')
mba = MicroBlogApi(token=token)
# GET - https://micro.blog/posts/all
posts = mba.posts.all.get()
print(posts.status_code, posts.reason)
print(posts.json()) | 4 | 0.129032 | 2 | 2 |
b91a30a5b9875ecc7633ef26844edd51c0dc5613 | api_server/src/main/frontend/app/chart/chart-time-spec.ts | api_server/src/main/frontend/app/chart/chart-time-spec.ts | export class ChartTimeSpec {
constructor(public duration_seconds: Number, public end?: Date, public stepsize_seconds?: Number) {}
public getEnd() : Date {
return (this.end ? this.end : new Date());
}
public getBegin() : Date {
return new Date(this.getEnd().getTime() - 1000 * Number(this.duration_seconds));
}
public getStepsizeMsec() : Number {
return (this.stepsize_seconds ? 1000 * Number(this.stepsize_seconds) : null);
}
}
| /*
* Time specifications:
* - begin time only (stream from begin until end-of-data).
* - begin time and end time (stream from begin until end).
* - begin time and duration (treat as end = begin + duration).
* - end time and duration (treat as begin = end - duration).
* - duration only (treat as begin = now() - duration, no end, no duration).
*
* Duration-only is to be interpreted as a sliding window, always displaying
* data between the end-of-data - duration .. end-of-data.
*/
export class ChartTimeSpec {
constructor(public duration_seconds: Number, public end?: Date, public stepsize_seconds?: Number) {}
public getEnd() : Date {
return (this.end ? this.end : new Date());
}
public getBegin() : Date {
return new Date(this.getEnd().getTime() - 1000 * Number(this.duration_seconds));
}
public getStepsizeMsec() : Number {
return (this.stepsize_seconds ? 1000 * Number(this.stepsize_seconds) : null);
}
}
| Document what the spec for time-spec is to be. | Document what the spec for time-spec is to be.
| TypeScript | bsd-3-clause | groupon/monsoon,groupon/monsoon,groupon/monsoon,groupon/monsoon | typescript | ## Code Before:
export class ChartTimeSpec {
constructor(public duration_seconds: Number, public end?: Date, public stepsize_seconds?: Number) {}
public getEnd() : Date {
return (this.end ? this.end : new Date());
}
public getBegin() : Date {
return new Date(this.getEnd().getTime() - 1000 * Number(this.duration_seconds));
}
public getStepsizeMsec() : Number {
return (this.stepsize_seconds ? 1000 * Number(this.stepsize_seconds) : null);
}
}
## Instruction:
Document what the spec for time-spec is to be.
## Code After:
/*
* Time specifications:
* - begin time only (stream from begin until end-of-data).
* - begin time and end time (stream from begin until end).
* - begin time and duration (treat as end = begin + duration).
* - end time and duration (treat as begin = end - duration).
* - duration only (treat as begin = now() - duration, no end, no duration).
*
* Duration-only is to be interpreted as a sliding window, always displaying
* data between the end-of-data - duration .. end-of-data.
*/
export class ChartTimeSpec {
constructor(public duration_seconds: Number, public end?: Date, public stepsize_seconds?: Number) {}
public getEnd() : Date {
return (this.end ? this.end : new Date());
}
public getBegin() : Date {
return new Date(this.getEnd().getTime() - 1000 * Number(this.duration_seconds));
}
public getStepsizeMsec() : Number {
return (this.stepsize_seconds ? 1000 * Number(this.stepsize_seconds) : null);
}
}
| + /*
+ * Time specifications:
+ * - begin time only (stream from begin until end-of-data).
+ * - begin time and end time (stream from begin until end).
+ * - begin time and duration (treat as end = begin + duration).
+ * - end time and duration (treat as begin = end - duration).
+ * - duration only (treat as begin = now() - duration, no end, no duration).
+ *
+ * Duration-only is to be interpreted as a sliding window, always displaying
+ * data between the end-of-data - duration .. end-of-data.
+ */
export class ChartTimeSpec {
constructor(public duration_seconds: Number, public end?: Date, public stepsize_seconds?: Number) {}
public getEnd() : Date {
return (this.end ? this.end : new Date());
}
public getBegin() : Date {
return new Date(this.getEnd().getTime() - 1000 * Number(this.duration_seconds));
}
public getStepsizeMsec() : Number {
return (this.stepsize_seconds ? 1000 * Number(this.stepsize_seconds) : null);
}
} | 11 | 0.733333 | 11 | 0 |
1b4254a5cff6452b14803ff03c69e95ac5001344 | app/assets/javascripts/templates/admin/panels/exchange_products_panel_footer.html.haml | app/assets/javascripts/templates/admin/panels/exchange_products_panel_footer.html.haml | .pagination{ 'ng-show' => 'enterprises[exchange.enterprise_id].last_page_loaded < enterprises[exchange.enterprise_id].num_of_pages && !productsLoading()'}
.button{ 'ng-click' => 'loadMoreExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_more_variants' | t }}
.button{ 'ng-click' => 'loadAllExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_all_variants' | t }}
.sixteen.columns.alpha#loading{ 'ng-show' => 'productsLoading()' }
%br
{{ = render partial: "components/loading" }}
%h1
{{ 'js.admin.panels.exchange_products.loading_variants' | t }}
| .pagination{ 'ng-show' => 'enterprises[exchange.enterprise_id].last_page_loaded < enterprises[exchange.enterprise_id].num_of_pages && !productsLoading()'}
.button{ 'ng-click' => 'loadMoreExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_more_variants' | t }}
.button{ 'ng-click' => 'loadAllExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_all_variants' | t }}
.sixteen.columns.alpha#loading{ 'ng-show' => 'productsLoading()' }
%br
%img.spinner{ src: "/assets/spinning-circles.svg" }
%h1
{{ 'js.admin.panels.exchange_products.loading_variants' | t }}
| Revert "replace code by reusable component" | Revert "replace code by reusable component"
This reverts commit 4d953abbe921ed2a7949de7c787497ea613af802.
| Haml | agpl-3.0 | Matt-Yorkley/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,lin-d-hop/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,Matt-Yorkley/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork | haml | ## Code Before:
.pagination{ 'ng-show' => 'enterprises[exchange.enterprise_id].last_page_loaded < enterprises[exchange.enterprise_id].num_of_pages && !productsLoading()'}
.button{ 'ng-click' => 'loadMoreExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_more_variants' | t }}
.button{ 'ng-click' => 'loadAllExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_all_variants' | t }}
.sixteen.columns.alpha#loading{ 'ng-show' => 'productsLoading()' }
%br
{{ = render partial: "components/loading" }}
%h1
{{ 'js.admin.panels.exchange_products.loading_variants' | t }}
## Instruction:
Revert "replace code by reusable component"
This reverts commit 4d953abbe921ed2a7949de7c787497ea613af802.
## Code After:
.pagination{ 'ng-show' => 'enterprises[exchange.enterprise_id].last_page_loaded < enterprises[exchange.enterprise_id].num_of_pages && !productsLoading()'}
.button{ 'ng-click' => 'loadMoreExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_more_variants' | t }}
.button{ 'ng-click' => 'loadAllExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_all_variants' | t }}
.sixteen.columns.alpha#loading{ 'ng-show' => 'productsLoading()' }
%br
%img.spinner{ src: "/assets/spinning-circles.svg" }
%h1
{{ 'js.admin.panels.exchange_products.loading_variants' | t }}
| .pagination{ 'ng-show' => 'enterprises[exchange.enterprise_id].last_page_loaded < enterprises[exchange.enterprise_id].num_of_pages && !productsLoading()'}
.button{ 'ng-click' => 'loadMoreExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_more_variants' | t }}
.button{ 'ng-click' => 'loadAllExchangeProducts(exchange)' }
{{ 'js.admin.panels.exchange_products.load_all_variants' | t }}
.sixteen.columns.alpha#loading{ 'ng-show' => 'productsLoading()' }
%br
- {{ = render partial: "components/loading" }}
+ %img.spinner{ src: "/assets/spinning-circles.svg" }
%h1
{{ 'js.admin.panels.exchange_products.loading_variants' | t }} | 2 | 0.181818 | 1 | 1 |
dd252bdfe5470dd3429004844cfd7909b254740e | src/server/webpack-dev-server.js | src/server/webpack-dev-server.js | import url from 'url'
import webpack from 'webpack'
import WebpackDevServer from 'webpack-dev-server'
import webpackDevConfig from '../../webpack.config.dev'
const publicURL = url.parse(webpackDevConfig.output.publicPath)
new WebpackDevServer(webpack(webpackDevConfig), {
historyApiFallback: true,
hot: true,
noInfo: true,
publicPath: webpackDevConfig.output.publicPath,
stats: { colors: true },
quiet: true,
}).listen(publicURL.port, publicURL.hostname, function (err) {
if (err) { console.log(err) }
console.log(`Webpack development server listening on ${webpackDevConfig.output.publicPath}`)
})
| import url from 'url'
import webpack from 'webpack'
import WebpackDevServer from 'webpack-dev-server'
import webpackDevConfig from '../../webpack.config.dev'
const publicURL = url.parse(webpackDevConfig.output.publicPath)
new WebpackDevServer(webpack(webpackDevConfig), {
historyApiFallback: true,
hot: true,
noInfo: true,
publicPath: webpackDevConfig.output.publicPath,
stats: { colors: true },
quiet: true,
}).listen(publicURL.port, publicURL.hostname, function (err) {
if (err)
return console.error(err)
console.log(`Webpack development server listening on ${webpackDevConfig.output.publicPath}`)
})
| Improve error behaviour in webpack dev server boot | Improve error behaviour in webpack dev server boot
| JavaScript | agpl-3.0 | openfisca/legislation-explorer | javascript | ## Code Before:
import url from 'url'
import webpack from 'webpack'
import WebpackDevServer from 'webpack-dev-server'
import webpackDevConfig from '../../webpack.config.dev'
const publicURL = url.parse(webpackDevConfig.output.publicPath)
new WebpackDevServer(webpack(webpackDevConfig), {
historyApiFallback: true,
hot: true,
noInfo: true,
publicPath: webpackDevConfig.output.publicPath,
stats: { colors: true },
quiet: true,
}).listen(publicURL.port, publicURL.hostname, function (err) {
if (err) { console.log(err) }
console.log(`Webpack development server listening on ${webpackDevConfig.output.publicPath}`)
})
## Instruction:
Improve error behaviour in webpack dev server boot
## Code After:
import url from 'url'
import webpack from 'webpack'
import WebpackDevServer from 'webpack-dev-server'
import webpackDevConfig from '../../webpack.config.dev'
const publicURL = url.parse(webpackDevConfig.output.publicPath)
new WebpackDevServer(webpack(webpackDevConfig), {
historyApiFallback: true,
hot: true,
noInfo: true,
publicPath: webpackDevConfig.output.publicPath,
stats: { colors: true },
quiet: true,
}).listen(publicURL.port, publicURL.hostname, function (err) {
if (err)
return console.error(err)
console.log(`Webpack development server listening on ${webpackDevConfig.output.publicPath}`)
})
| import url from 'url'
import webpack from 'webpack'
import WebpackDevServer from 'webpack-dev-server'
import webpackDevConfig from '../../webpack.config.dev'
const publicURL = url.parse(webpackDevConfig.output.publicPath)
new WebpackDevServer(webpack(webpackDevConfig), {
historyApiFallback: true,
hot: true,
noInfo: true,
publicPath: webpackDevConfig.output.publicPath,
stats: { colors: true },
quiet: true,
}).listen(publicURL.port, publicURL.hostname, function (err) {
- if (err) { console.log(err) }
+ if (err)
+ return console.error(err)
+
console.log(`Webpack development server listening on ${webpackDevConfig.output.publicPath}`)
}) | 4 | 0.190476 | 3 | 1 |
19e1beb573f929b03c3a52b865030bd597d2443b | spec/fixtures/fake_behavior_export.txt | spec/fixtures/fake_behavior_export.txt | "local_id","incident_code","event_date","incident_time","incident_location","incident_description","school_local_id"
"10","Hitting","2015-10-01","13:00:00","Classroom","Hit another student.","SHS"
"11","Lorem ipsuming","2015-10-01","13:00:00","Classroom","... yelling \"NO\" to the teacher ...","SHS"
"12","Unauthorized pencil sharpening","2015-10-02","13:00:00","Classroom","pencil that didnt need to be","SHS"
"13","Bullying","2015-10-03",\N,"Classroom","Bullied another student.","SHS"
"14","Bullying",\N,\N,"Classroom","Bullied another student.","SHS"
| "local_id","incident_code","event_date","incident_time","incident_location","incident_description","school_local_id"
"10","Hitting","2015-10-01","13:00:00","Classroom","Hit another student.","SHS"
"11","Lorem ipsuming","2015-10-01","13:00:00","Classroom","... yelling \"NO\" to the teacher ...","SHS"
"13","Bullying","2015-10-03",\N,"Classroom","Bullied another student.","SHS"
"14","Bullying",\N,\N,"Classroom","Bullied another student.","SHS"
| Remove row that's throwing an unrelated parsing error | Remove row that's throwing an unrelated parsing error
| Text | mit | studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights | text | ## Code Before:
"local_id","incident_code","event_date","incident_time","incident_location","incident_description","school_local_id"
"10","Hitting","2015-10-01","13:00:00","Classroom","Hit another student.","SHS"
"11","Lorem ipsuming","2015-10-01","13:00:00","Classroom","... yelling \"NO\" to the teacher ...","SHS"
"12","Unauthorized pencil sharpening","2015-10-02","13:00:00","Classroom","pencil that didnt need to be","SHS"
"13","Bullying","2015-10-03",\N,"Classroom","Bullied another student.","SHS"
"14","Bullying",\N,\N,"Classroom","Bullied another student.","SHS"
## Instruction:
Remove row that's throwing an unrelated parsing error
## Code After:
"local_id","incident_code","event_date","incident_time","incident_location","incident_description","school_local_id"
"10","Hitting","2015-10-01","13:00:00","Classroom","Hit another student.","SHS"
"11","Lorem ipsuming","2015-10-01","13:00:00","Classroom","... yelling \"NO\" to the teacher ...","SHS"
"13","Bullying","2015-10-03",\N,"Classroom","Bullied another student.","SHS"
"14","Bullying",\N,\N,"Classroom","Bullied another student.","SHS"
| "local_id","incident_code","event_date","incident_time","incident_location","incident_description","school_local_id"
"10","Hitting","2015-10-01","13:00:00","Classroom","Hit another student.","SHS"
"11","Lorem ipsuming","2015-10-01","13:00:00","Classroom","... yelling \"NO\" to the teacher ...","SHS"
- "12","Unauthorized pencil sharpening","2015-10-02","13:00:00","Classroom","pencil that didnt need to be","SHS"
"13","Bullying","2015-10-03",\N,"Classroom","Bullied another student.","SHS"
"14","Bullying",\N,\N,"Classroom","Bullied another student.","SHS" | 1 | 0.166667 | 0 | 1 |
15797c44f730f89134380bf1d4206889301b2903 | users/templates/users/update_profile.html | users/templates/users/update_profile.html | {% extends 'base.html' %}
{% load bootstrap3 %}
{% block main %}
<div class="container-full">
<div class="row">
<div class="col-md-6 join-now col-md-offset-3">
<h1>Update your information</h1>
<form class="form" method="POST" action="{% url "users:update_profile" %}">
{% csrf_token %}
{% bootstrap_form form size='large' %}
{% buttons %}
<button type="submit" class="btn btn-primary join-now">Save</button>
{% endbuttons %}
</form>
<a href="{% url "users:profile" %}">Cancel</a>
</div>
</div>
</div>
{% endblock %}
| {% extends 'base.html' %}
{% load bootstrap3 %}
{% block main %}
<div class="container-full">
<div class="row">
<div class="col-md-6 join-now col-md-offset-3">
<h1>Update your information</h1>
<form class="form" method="POST" action="{% url "users:update_profile" %}">
{% csrf_token %}
{% bootstrap_form form size='large' %}
{% buttons %}
<button type="submit" class="btn btn-lg btn-primary">Save</button>
<a role="button" class="btn btn-lg btn-warning" href="{% url "users:profile" %}">Cancel</a>
{% endbuttons %}
</form>
</div>
</div>
</div>
{% endblock %}
| Change cancel to a button | Change cancel to a button
| HTML | mit | sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap | html | ## Code Before:
{% extends 'base.html' %}
{% load bootstrap3 %}
{% block main %}
<div class="container-full">
<div class="row">
<div class="col-md-6 join-now col-md-offset-3">
<h1>Update your information</h1>
<form class="form" method="POST" action="{% url "users:update_profile" %}">
{% csrf_token %}
{% bootstrap_form form size='large' %}
{% buttons %}
<button type="submit" class="btn btn-primary join-now">Save</button>
{% endbuttons %}
</form>
<a href="{% url "users:profile" %}">Cancel</a>
</div>
</div>
</div>
{% endblock %}
## Instruction:
Change cancel to a button
## Code After:
{% extends 'base.html' %}
{% load bootstrap3 %}
{% block main %}
<div class="container-full">
<div class="row">
<div class="col-md-6 join-now col-md-offset-3">
<h1>Update your information</h1>
<form class="form" method="POST" action="{% url "users:update_profile" %}">
{% csrf_token %}
{% bootstrap_form form size='large' %}
{% buttons %}
<button type="submit" class="btn btn-lg btn-primary">Save</button>
<a role="button" class="btn btn-lg btn-warning" href="{% url "users:profile" %}">Cancel</a>
{% endbuttons %}
</form>
</div>
</div>
</div>
{% endblock %}
| {% extends 'base.html' %}
{% load bootstrap3 %}
{% block main %}
<div class="container-full">
<div class="row">
<div class="col-md-6 join-now col-md-offset-3">
<h1>Update your information</h1>
<form class="form" method="POST" action="{% url "users:update_profile" %}">
{% csrf_token %}
{% bootstrap_form form size='large' %}
{% buttons %}
- <button type="submit" class="btn btn-primary join-now">Save</button>
? ---------
+ <button type="submit" class="btn btn-lg btn-primary">Save</button>
? +++++++
+ <a role="button" class="btn btn-lg btn-warning" href="{% url "users:profile" %}">Cancel</a>
{% endbuttons %}
</form>
- <a href="{% url "users:profile" %}">Cancel</a>
</div>
</div>
</div>
{% endblock %} | 4 | 0.2 | 2 | 2 |
4d7242d808bfbf702c05e30b323adb43bba1b69c | f8a_jobs/default_jobs/githubGatheringJob.yaml | f8a_jobs/default_jobs/githubGatheringJob.yaml | ---
handler: SelectiveFlowScheduling
job_id: githubGatheringJob
flow_name: bayesianFlow
task_names:
- github_details
- ResultCollector
- GraphImporterTask
flow_arguments:
- {
"$filter": {
"joins": [
{
"on": {
"worker_results.analysis_id": "analyses.id"
},
"table": "analyses"
},
{
"on": {
"analyses.version_id": "versions.id"
},
"table": "versions"
},
{
"on": {
"versions.package_id": "packages.id"
},
"table": "packages"
},
{
"on": {
"ecosystems.id": "packages.ecosystem_id"
},
"table": "ecosystems"
}
],
"select": [
"packages.name as name",
"ecosystems.name as ecosystem",
"versions.identifier as version"
],
"limit": 10,
"distinct": true,
"where": {
"worker_results.worker": "InitAnalysisFlow",
"worker_results.error": false
},
"table": "worker_results"
},
"force": true
}
when:
periodically: 5 minute
# Keep this high so redeployment/downtime does not affect flow scheduling
misfire_grace_time: 365 days
state: running
| ---
handler: SelectiveFlowScheduling
job_id: githubGatheringJob
flow_name: bayesianPackageFlow
task_names:
- github_details
- PackageResultCollector
- PackageGraphImporterTask
flow_arguments:
- {
"force": true,
"$filter": {
"joins": [
{
"on": {
"monitored_upstreams.package_id": "packages.id"
},
"table": "packages"
},
{
"on": {
"packages.ecosystem_id": "ecosystems.id"
},
"table": "ecosystems"
}
],
"select": [
"packages.name as name",
"ecosystems.name as ecosystem",
"monitored_upstreams.url as url"
],
"distinct": true,
"where": {
"monitored_upstreams.active": true,
"monitored_upstreams.url is not": null
},
"table": "monitored_upstreams"
}
}
when:
periodically: 14 day
# Keep this high so redeployment/downtime does not affect flow scheduling
misfire_grace_time: 99999 days
state: running
| Use directly monitored_upstream tables for refreshing GitHub data | Use directly monitored_upstream tables for refreshing GitHub data
| YAML | apache-2.0 | fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs | yaml | ## Code Before:
---
handler: SelectiveFlowScheduling
job_id: githubGatheringJob
flow_name: bayesianFlow
task_names:
- github_details
- ResultCollector
- GraphImporterTask
flow_arguments:
- {
"$filter": {
"joins": [
{
"on": {
"worker_results.analysis_id": "analyses.id"
},
"table": "analyses"
},
{
"on": {
"analyses.version_id": "versions.id"
},
"table": "versions"
},
{
"on": {
"versions.package_id": "packages.id"
},
"table": "packages"
},
{
"on": {
"ecosystems.id": "packages.ecosystem_id"
},
"table": "ecosystems"
}
],
"select": [
"packages.name as name",
"ecosystems.name as ecosystem",
"versions.identifier as version"
],
"limit": 10,
"distinct": true,
"where": {
"worker_results.worker": "InitAnalysisFlow",
"worker_results.error": false
},
"table": "worker_results"
},
"force": true
}
when:
periodically: 5 minute
# Keep this high so redeployment/downtime does not affect flow scheduling
misfire_grace_time: 365 days
state: running
## Instruction:
Use directly monitored_upstream tables for refreshing GitHub data
## Code After:
---
handler: SelectiveFlowScheduling
job_id: githubGatheringJob
flow_name: bayesianPackageFlow
task_names:
- github_details
- PackageResultCollector
- PackageGraphImporterTask
flow_arguments:
- {
"force": true,
"$filter": {
"joins": [
{
"on": {
"monitored_upstreams.package_id": "packages.id"
},
"table": "packages"
},
{
"on": {
"packages.ecosystem_id": "ecosystems.id"
},
"table": "ecosystems"
}
],
"select": [
"packages.name as name",
"ecosystems.name as ecosystem",
"monitored_upstreams.url as url"
],
"distinct": true,
"where": {
"monitored_upstreams.active": true,
"monitored_upstreams.url is not": null
},
"table": "monitored_upstreams"
}
}
when:
periodically: 14 day
# Keep this high so redeployment/downtime does not affect flow scheduling
misfire_grace_time: 99999 days
state: running
| ---
handler: SelectiveFlowScheduling
job_id: githubGatheringJob
- flow_name: bayesianFlow
+ flow_name: bayesianPackageFlow
? +++++++
task_names:
- github_details
- - ResultCollector
+ - PackageResultCollector
? +++++++
- - GraphImporterTask
+ - PackageGraphImporterTask
? +++++++
flow_arguments:
- {
+ "force": true,
"$filter": {
"joins": [
{
"on": {
- "worker_results.analysis_id": "analyses.id"
- },
- "table": "analyses"
- },
- {
- "on": {
- "analyses.version_id": "versions.id"
- },
- "table": "versions"
- },
- {
- "on": {
- "versions.package_id": "packages.id"
? ^^^^^
+ "monitored_upstreams.package_id": "packages.id"
? ^ +++++++++++++++
},
"table": "packages"
},
{
"on": {
- "ecosystems.id": "packages.ecosystem_id"
+ "packages.ecosystem_id": "ecosystems.id"
},
"table": "ecosystems"
}
],
"select": [
"packages.name as name",
"ecosystems.name as ecosystem",
- "versions.identifier as version"
+ "monitored_upstreams.url as url"
],
- "limit": 10,
"distinct": true,
"where": {
- "worker_results.worker": "InitAnalysisFlow",
- "worker_results.error": false
+ "monitored_upstreams.active": true,
+ "monitored_upstreams.url is not": null
},
- "table": "worker_results"
+ "table": "monitored_upstreams"
- },
? -
+ }
- "force": true
}
when:
- periodically: 5 minute
+ periodically: 14 day
# Keep this high so redeployment/downtime does not affect flow scheduling
- misfire_grace_time: 365 days
? ^^^
+ misfire_grace_time: 99999 days
? ^^^^^
state: running | 39 | 0.684211 | 13 | 26 |
9d9d4fbaa7e77cc877b50d0a819da1116de92368 | templates/default/upstart/teamcity-agent.erb | templates/default/upstart/teamcity-agent.erb | description "TeamCity Agent"
start on runlevel [2345]
stop on runlevel [06]
# TeamCity can take a while to shutdown
kill timeout 30
respawn
respawn limit 15 5
setuid <%= @user %>
setgid <%= @group %>
script
export TEAMCITY_DATA_PATH=<%= @data_dir %>
exec <%= @root_dir %>/agents/buildAgent/bin/agent.sh run
end script
| description "TeamCity Agent"
start on runlevel [2345]
stop on runlevel [06]
# TeamCity can take a while to shutdown
kill timeout 30
respawn
respawn limit 15 5
setuid <%= @user %>
setgid <%= @group %>
script
export TEAMCITY_DATA_PATH=<%= @data_dir %>
if [ -f ~<%= @user %>/.bashrc ]; then
. ~<%= @user %>/.bashrc
fi
exec <%= @root_dir %>/agents/buildAgent/bin/agent.sh run
end script
| Load the users bashrc to pull in any environmental variables. | Load the users bashrc to pull in any environmental variables.
| HTML+ERB | mit | hschaeidt/teamcity-cookbook,hschaeidt/teamcity-cookbook | html+erb | ## Code Before:
description "TeamCity Agent"
start on runlevel [2345]
stop on runlevel [06]
# TeamCity can take a while to shutdown
kill timeout 30
respawn
respawn limit 15 5
setuid <%= @user %>
setgid <%= @group %>
script
export TEAMCITY_DATA_PATH=<%= @data_dir %>
exec <%= @root_dir %>/agents/buildAgent/bin/agent.sh run
end script
## Instruction:
Load the users bashrc to pull in any environmental variables.
## Code After:
description "TeamCity Agent"
start on runlevel [2345]
stop on runlevel [06]
# TeamCity can take a while to shutdown
kill timeout 30
respawn
respawn limit 15 5
setuid <%= @user %>
setgid <%= @group %>
script
export TEAMCITY_DATA_PATH=<%= @data_dir %>
if [ -f ~<%= @user %>/.bashrc ]; then
. ~<%= @user %>/.bashrc
fi
exec <%= @root_dir %>/agents/buildAgent/bin/agent.sh run
end script
| description "TeamCity Agent"
start on runlevel [2345]
stop on runlevel [06]
# TeamCity can take a while to shutdown
kill timeout 30
respawn
respawn limit 15 5
setuid <%= @user %>
setgid <%= @group %>
script
export TEAMCITY_DATA_PATH=<%= @data_dir %>
-
+ if [ -f ~<%= @user %>/.bashrc ]; then
+ . ~<%= @user %>/.bashrc
+ fi
exec <%= @root_dir %>/agents/buildAgent/bin/agent.sh run
end script | 4 | 0.210526 | 3 | 1 |
649bfc586ebc58316040feebda90c052028a1d4b | Wangscape/noise/module/codecs/TerraceWrapperCodec.cpp | Wangscape/noise/module/codecs/TerraceWrapperCodec.cpp |
namespace spotify
{
namespace json
{
using TerraceWrapper = noise::module::Wrapper<noise::module::Terrace>;
codec::object_t<TerraceWrapper> default_codec_t<TerraceWrapper>::codec()
{
auto codec = codec::object<TerraceWrapper>();
codec.required("type", codec::eq<std::string>("Terrace"));
codec.required("SourceModule", codec::ignore_t<int>());
codec.optional("ControlPoints",
[](const TerraceWrapper& mw)
{
std::vector<double> control_points;
const double* raw_control_points = mw.module->GetControlPointArray();
const int control_point_count = mw.module->GetControlPointCount();
for (int i = 0; i < control_point_count; i++)
{
control_points.push_back(raw_control_points[i]);
}
return control_points;
},
[](TerraceWrapper& mw, std::vector<double> all_control_points)
{
for (double control_point : all_control_points)
{
mw.module->AddControlPoint(control_point);
}
},
default_codec<std::vector<double>>());
return codec;
}
}
}
|
namespace spotify
{
namespace json
{
using TerraceWrapper = noise::module::Wrapper<noise::module::Terrace>;
codec::object_t<TerraceWrapper> default_codec_t<TerraceWrapper>::codec()
{
auto codec = codec::object<TerraceWrapper>();
codec.required("type", codec::eq<std::string>("Terrace"));
codec.required("SourceModule", codec::ignore_t<int>());
codec.optional("InvertTerraces",
[](const TerraceWrapper& mw)
{
return mw.module->IsTerracesInverted();
},
[](const TerraceWrapper& mw, bool invert_terraces)
{
mw.module->InvertTerraces(true);
});
codec.optional("ControlPoints",
[](const TerraceWrapper& mw)
{
std::vector<double> control_points;
const double* raw_control_points = mw.module->GetControlPointArray();
const int control_point_count = mw.module->GetControlPointCount();
for (int i = 0; i < control_point_count; i++)
{
control_points.push_back(raw_control_points[i]);
}
return control_points;
},
[](TerraceWrapper& mw, std::vector<double> all_control_points)
{
for (double control_point : all_control_points)
{
mw.module->AddControlPoint(control_point);
}
},
default_codec<std::vector<double>>());
return codec;
}
}
}
| Add missing attribute to Terrace codec | Add missing attribute to Terrace codec
| C++ | mit | Wangscape/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape | c++ | ## Code Before:
namespace spotify
{
namespace json
{
using TerraceWrapper = noise::module::Wrapper<noise::module::Terrace>;
codec::object_t<TerraceWrapper> default_codec_t<TerraceWrapper>::codec()
{
auto codec = codec::object<TerraceWrapper>();
codec.required("type", codec::eq<std::string>("Terrace"));
codec.required("SourceModule", codec::ignore_t<int>());
codec.optional("ControlPoints",
[](const TerraceWrapper& mw)
{
std::vector<double> control_points;
const double* raw_control_points = mw.module->GetControlPointArray();
const int control_point_count = mw.module->GetControlPointCount();
for (int i = 0; i < control_point_count; i++)
{
control_points.push_back(raw_control_points[i]);
}
return control_points;
},
[](TerraceWrapper& mw, std::vector<double> all_control_points)
{
for (double control_point : all_control_points)
{
mw.module->AddControlPoint(control_point);
}
},
default_codec<std::vector<double>>());
return codec;
}
}
}
## Instruction:
Add missing attribute to Terrace codec
## Code After:
namespace spotify
{
namespace json
{
using TerraceWrapper = noise::module::Wrapper<noise::module::Terrace>;
codec::object_t<TerraceWrapper> default_codec_t<TerraceWrapper>::codec()
{
auto codec = codec::object<TerraceWrapper>();
codec.required("type", codec::eq<std::string>("Terrace"));
codec.required("SourceModule", codec::ignore_t<int>());
codec.optional("InvertTerraces",
[](const TerraceWrapper& mw)
{
return mw.module->IsTerracesInverted();
},
[](const TerraceWrapper& mw, bool invert_terraces)
{
mw.module->InvertTerraces(true);
});
codec.optional("ControlPoints",
[](const TerraceWrapper& mw)
{
std::vector<double> control_points;
const double* raw_control_points = mw.module->GetControlPointArray();
const int control_point_count = mw.module->GetControlPointCount();
for (int i = 0; i < control_point_count; i++)
{
control_points.push_back(raw_control_points[i]);
}
return control_points;
},
[](TerraceWrapper& mw, std::vector<double> all_control_points)
{
for (double control_point : all_control_points)
{
mw.module->AddControlPoint(control_point);
}
},
default_codec<std::vector<double>>());
return codec;
}
}
}
|
namespace spotify
{
namespace json
{
using TerraceWrapper = noise::module::Wrapper<noise::module::Terrace>;
codec::object_t<TerraceWrapper> default_codec_t<TerraceWrapper>::codec()
{
auto codec = codec::object<TerraceWrapper>();
codec.required("type", codec::eq<std::string>("Terrace"));
codec.required("SourceModule", codec::ignore_t<int>());
+ codec.optional("InvertTerraces",
+ [](const TerraceWrapper& mw)
+ {
+ return mw.module->IsTerracesInverted();
+ },
+ [](const TerraceWrapper& mw, bool invert_terraces)
+ {
+ mw.module->InvertTerraces(true);
+ });
codec.optional("ControlPoints",
[](const TerraceWrapper& mw)
{
std::vector<double> control_points;
const double* raw_control_points = mw.module->GetControlPointArray();
const int control_point_count = mw.module->GetControlPointCount();
for (int i = 0; i < control_point_count; i++)
{
control_points.push_back(raw_control_points[i]);
}
return control_points;
},
[](TerraceWrapper& mw, std::vector<double> all_control_points)
{
for (double control_point : all_control_points)
{
mw.module->AddControlPoint(control_point);
}
},
default_codec<std::vector<double>>());
return codec;
}
}
} | 9 | 0.236842 | 9 | 0 |
3c9acd502df5e2466811e3d98159f597e0524afd | packages/shrub-skin-strapped/app/template/app.html | packages/shrub-skin-strapped/app/template/app.html | <!doctype html>
<html
lang="en"
data-ng-class="pathClass"
data-ng-app="shrub"
>
<head>
<base href="/">
<title data-shrub-ui-window-title>Shrub</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="/skin/shrub-skin-strapped/favicon.ico" />
</head>
<body>
<div class="container">
<div data-shrub-skin-strapped-main-nav></div>
<div data-shrub-ui-notifications></div>
<div class="main" data-ng-view></div>
</div>
</body>
</html>
| <!doctype html>
<html
lang="en"
data-ng-class="pathClass"
data-ng-app="shrub"
>
<head>
<base href="/">
<title data-shrub-ui-window-title>Shrub</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="/skin/shrub-skin-strapped/favicon.ico" />
</head>
<body>
<div class="container">
<noscript>
<nav role="navigation" class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a href="#" class="navbar-brand"><span data-ng-bind="title" class="ng-binding">Shrub</span></a>
</div>
</div>
</nav>
<div class="main">
<div class="jumbotron">
<h1>Oh! :(</h1>
<p class="lead">You need to enable JavaScript for this site to work.</p>
<p class="muted bottom">You can enable the shrub-angular package to render the application on the server, thus removing the need for client-side JavaScript!</p>
</div>
</div>
</noscript>
<div data-shrub-skin-strapped-main-nav></div>
<div data-shrub-ui-notifications></div>
<div class="main" data-ng-view></div>
</div>
</body>
</html>
| Add noscript notification when the site isn't configured to run without client-side JavaScript | Add noscript notification when the site isn't configured to run without client-side JavaScript
| HTML | mit | cha0s/shrub,cha0s/shrub,cha0s/shrub | html | ## Code Before:
<!doctype html>
<html
lang="en"
data-ng-class="pathClass"
data-ng-app="shrub"
>
<head>
<base href="/">
<title data-shrub-ui-window-title>Shrub</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="/skin/shrub-skin-strapped/favicon.ico" />
</head>
<body>
<div class="container">
<div data-shrub-skin-strapped-main-nav></div>
<div data-shrub-ui-notifications></div>
<div class="main" data-ng-view></div>
</div>
</body>
</html>
## Instruction:
Add noscript notification when the site isn't configured to run without client-side JavaScript
## Code After:
<!doctype html>
<html
lang="en"
data-ng-class="pathClass"
data-ng-app="shrub"
>
<head>
<base href="/">
<title data-shrub-ui-window-title>Shrub</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="/skin/shrub-skin-strapped/favicon.ico" />
</head>
<body>
<div class="container">
<noscript>
<nav role="navigation" class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a href="#" class="navbar-brand"><span data-ng-bind="title" class="ng-binding">Shrub</span></a>
</div>
</div>
</nav>
<div class="main">
<div class="jumbotron">
<h1>Oh! :(</h1>
<p class="lead">You need to enable JavaScript for this site to work.</p>
<p class="muted bottom">You can enable the shrub-angular package to render the application on the server, thus removing the need for client-side JavaScript!</p>
</div>
</div>
</noscript>
<div data-shrub-skin-strapped-main-nav></div>
<div data-shrub-ui-notifications></div>
<div class="main" data-ng-view></div>
</div>
</body>
</html>
| <!doctype html>
<html
lang="en"
data-ng-class="pathClass"
data-ng-app="shrub"
>
<head>
<base href="/">
<title data-shrub-ui-window-title>Shrub</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="/skin/shrub-skin-strapped/favicon.ico" />
</head>
<body>
<div class="container">
+
+ <noscript>
+ <nav role="navigation" class="navbar navbar-default">
+ <div class="container-fluid">
+
+ <div class="navbar-header">
+ <a href="#" class="navbar-brand"><span data-ng-bind="title" class="ng-binding">Shrub</span></a>
+ </div>
+ </div>
+ </nav>
+
+ <div class="main">
+ <div class="jumbotron">
+ <h1>Oh! :(</h1>
+ <p class="lead">You need to enable JavaScript for this site to work.</p>
+ <p class="muted bottom">You can enable the shrub-angular package to render the application on the server, thus removing the need for client-side JavaScript!</p>
+ </div>
+ </div>
+ </noscript>
+
<div data-shrub-skin-strapped-main-nav></div>
<div data-shrub-ui-notifications></div>
<div class="main" data-ng-view></div>
</div>
</body>
</html> | 20 | 0.625 | 20 | 0 |
66744af6e45fc7fe1567ffcdccd8a9f5c7eaae87 | src/Glimpse.Server/project.json | src/Glimpse.Server/project.json | {
"version": "1.0.0-*",
"dependencies": {
"Glimpse.Agent.AspNet": "",
"Microsoft.AspNet.SignalR.Server": "3.0.0-*",
"Tavis.UriTemplates": "0.6.5-beta"
},
"frameworks": {
"dnx451": {
"dependencies": {
}
},
"dnxcore50": {
"dependencies": {
}
}
}
}
| {
"version": "1.0.0-*",
"dependencies": {
"Glimpse.Agent.AspNet": "",
"Microsoft.AspNet.SignalR.Server": "3.0.0-*",
"Tavis.UriTemplates": "0.6.5-beta"
},
"resource": "Resources/Embed/**/*.*",
"frameworks": {
"dnx451": {
"dependencies": {
}
},
"dnxcore50": {
"dependencies": {
}
}
}
}
| Make sure that embedded scripts are marked as embedded | Make sure that embedded scripts are marked as embedded
| JSON | mit | Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,zanetdev/Glimpse.Prototype,zanetdev/Glimpse.Prototype | json | ## Code Before:
{
"version": "1.0.0-*",
"dependencies": {
"Glimpse.Agent.AspNet": "",
"Microsoft.AspNet.SignalR.Server": "3.0.0-*",
"Tavis.UriTemplates": "0.6.5-beta"
},
"frameworks": {
"dnx451": {
"dependencies": {
}
},
"dnxcore50": {
"dependencies": {
}
}
}
}
## Instruction:
Make sure that embedded scripts are marked as embedded
## Code After:
{
"version": "1.0.0-*",
"dependencies": {
"Glimpse.Agent.AspNet": "",
"Microsoft.AspNet.SignalR.Server": "3.0.0-*",
"Tavis.UriTemplates": "0.6.5-beta"
},
"resource": "Resources/Embed/**/*.*",
"frameworks": {
"dnx451": {
"dependencies": {
}
},
"dnxcore50": {
"dependencies": {
}
}
}
}
| {
"version": "1.0.0-*",
"dependencies": {
"Glimpse.Agent.AspNet": "",
"Microsoft.AspNet.SignalR.Server": "3.0.0-*",
"Tavis.UriTemplates": "0.6.5-beta"
},
+ "resource": "Resources/Embed/**/*.*",
"frameworks": {
"dnx451": {
"dependencies": {
}
},
"dnxcore50": {
"dependencies": {
}
}
}
} | 1 | 0.055556 | 1 | 0 |
c9d3569b1c7cf9ac4d1439f8e4092abc5f67205d | src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/StringFormSubmissionField.php | src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/StringFormSubmissionField.php | <?php
namespace Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes;
use Doctrine\ORM\Mapping as ORM;
use Kunstmaan\FormBundle\Entity\FormSubmissionField;
use Kunstmaan\FormBundle\Form\StringFormSubmissionType;
/**
* The StringFormSubmissionField can be used to store string values to a FormSubmission
*
* @ORM\Entity
* @ORM\Table(name="kuma_string_form_submission_fields")
*/
class StringFormSubmissionField extends FormSubmissionField
{
/**
* @ORM\Column(name="sfsf_value", type="string")
*/
protected $value;
/**
* Returns the default form type for this FormSubmissionField
*
* @return string
*/
public function getDefaultAdminType()
{
return StringFormSubmissionType::class;
}
/**
* Return a string representation of this FormSubmissionField
*
* @return string
*/
public function __toString()
{
$value = $this->getValue();
return !empty($value) ? $value : '';
}
/**
* Returns the current value of this field
*
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Sets the current value of this field
*
* @param string $value
*
* @return StringFormSubmissionField
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
}
| <?php
namespace Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes;
use Doctrine\ORM\Mapping as ORM;
use Kunstmaan\FormBundle\Entity\FormSubmissionField;
use Kunstmaan\FormBundle\Form\StringFormSubmissionType;
use Symfony\Component\Validator\Constraints as Assert;
/**
* The StringFormSubmissionField can be used to store string values to a FormSubmission
*
* @ORM\Entity
* @ORM\Table(name="kuma_string_form_submission_fields")
*/
class StringFormSubmissionField extends FormSubmissionField
{
/**
* @ORM\Column(name="sfsf_value", type="string")
* @Assert\Length(max=255)
*/
protected $value;
/**
* Returns the default form type for this FormSubmissionField
*
* @return string
*/
public function getDefaultAdminType()
{
return StringFormSubmissionType::class;
}
/**
* Return a string representation of this FormSubmissionField
*
* @return string
*/
public function __toString()
{
$value = $this->getValue();
return !empty($value) ? $value : '';
}
/**
* Returns the current value of this field
*
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Sets the current value of this field
*
* @param string $value
*
* @return StringFormSubmissionField
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
}
| Add length validation to string form field | Add length validation to string form field
| PHP | mit | dbeerten/KunstmaanBundlesCMS,dbeerten/KunstmaanBundlesCMS,Numkil/KunstmaanBundlesCMS,Kunstmaan/KunstmaanBundlesCMS,FVKVN/KunstmaanBundlesCMS,Numkil/KunstmaanBundlesCMS,FVKVN/KunstmaanBundlesCMS,insiders/KunstmaanBundlesCMS,insiders/KunstmaanBundlesCMS,FVKVN/KunstmaanBundlesCMS,insiders/KunstmaanBundlesCMS,FVKVN/KunstmaanBundlesCMS,Numkil/KunstmaanBundlesCMS,insiders/KunstmaanBundlesCMS,dbeerten/KunstmaanBundlesCMS,Numkil/KunstmaanBundlesCMS,Kunstmaan/KunstmaanBundlesCMS,Kunstmaan/KunstmaanBundlesCMS,Kunstmaan/KunstmaanBundlesCMS,dbeerten/KunstmaanBundlesCMS | php | ## Code Before:
<?php
namespace Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes;
use Doctrine\ORM\Mapping as ORM;
use Kunstmaan\FormBundle\Entity\FormSubmissionField;
use Kunstmaan\FormBundle\Form\StringFormSubmissionType;
/**
* The StringFormSubmissionField can be used to store string values to a FormSubmission
*
* @ORM\Entity
* @ORM\Table(name="kuma_string_form_submission_fields")
*/
class StringFormSubmissionField extends FormSubmissionField
{
/**
* @ORM\Column(name="sfsf_value", type="string")
*/
protected $value;
/**
* Returns the default form type for this FormSubmissionField
*
* @return string
*/
public function getDefaultAdminType()
{
return StringFormSubmissionType::class;
}
/**
* Return a string representation of this FormSubmissionField
*
* @return string
*/
public function __toString()
{
$value = $this->getValue();
return !empty($value) ? $value : '';
}
/**
* Returns the current value of this field
*
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Sets the current value of this field
*
* @param string $value
*
* @return StringFormSubmissionField
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
}
## Instruction:
Add length validation to string form field
## Code After:
<?php
namespace Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes;
use Doctrine\ORM\Mapping as ORM;
use Kunstmaan\FormBundle\Entity\FormSubmissionField;
use Kunstmaan\FormBundle\Form\StringFormSubmissionType;
use Symfony\Component\Validator\Constraints as Assert;
/**
* The StringFormSubmissionField can be used to store string values to a FormSubmission
*
* @ORM\Entity
* @ORM\Table(name="kuma_string_form_submission_fields")
*/
class StringFormSubmissionField extends FormSubmissionField
{
/**
* @ORM\Column(name="sfsf_value", type="string")
* @Assert\Length(max=255)
*/
protected $value;
/**
* Returns the default form type for this FormSubmissionField
*
* @return string
*/
public function getDefaultAdminType()
{
return StringFormSubmissionType::class;
}
/**
* Return a string representation of this FormSubmissionField
*
* @return string
*/
public function __toString()
{
$value = $this->getValue();
return !empty($value) ? $value : '';
}
/**
* Returns the current value of this field
*
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Sets the current value of this field
*
* @param string $value
*
* @return StringFormSubmissionField
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
}
| <?php
namespace Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes;
use Doctrine\ORM\Mapping as ORM;
use Kunstmaan\FormBundle\Entity\FormSubmissionField;
use Kunstmaan\FormBundle\Form\StringFormSubmissionType;
+ use Symfony\Component\Validator\Constraints as Assert;
/**
* The StringFormSubmissionField can be used to store string values to a FormSubmission
*
* @ORM\Entity
* @ORM\Table(name="kuma_string_form_submission_fields")
*/
class StringFormSubmissionField extends FormSubmissionField
{
/**
* @ORM\Column(name="sfsf_value", type="string")
+ * @Assert\Length(max=255)
*/
protected $value;
/**
* Returns the default form type for this FormSubmissionField
*
* @return string
*/
public function getDefaultAdminType()
{
return StringFormSubmissionType::class;
}
/**
* Return a string representation of this FormSubmissionField
*
* @return string
*/
public function __toString()
{
$value = $this->getValue();
return !empty($value) ? $value : '';
}
/**
* Returns the current value of this field
*
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Sets the current value of this field
*
* @param string $value
*
* @return StringFormSubmissionField
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
} | 2 | 0.029851 | 2 | 0 |
0cf67e05821ec4b81a78baa6da1908b46c54e17d | lib/tasks/tolk_tasks.rake | lib/tasks/tolk_tasks.rake | namespace :tolk do
desc "Sync Tolk with the default locale's yml file"
task :sync => :environment do
Tolk::Locale.sync!
end
desc "Generate yml files for all the locales defined in Tolk"
task :dump_all => :environment do
Tolk::Locale.dump_all
end
desc "Imports data all non default locale yml files to Tolk"
task :import => :environment do
Rake::Task['tolk:sync'].invoke
Tolk::Locale.import_secondary_locales
end
desc "Show all the keys potentially containing HTML values and no _html postfix"
task :html_keys => :environment do
bad_translations = Tolk::Locale.primary_locale.translations_with_html
bad_translations.each do |bt|
puts "#{bt.phrase.key} - #{bt.text}"
end
end
end
| namespace :tolk do
desc "Sync Tolk with the default locale's yml file"
task :sync => :environment do
Tolk::Locale.sync!
end
desc "Generate yml files for all the locales defined in Tolk"
task :dump_all => :environment do
Tolk::Locale.dump_all
end
desc "Imports data all non default locale yml files to Tolk"
task :import => :environment do
Rake::Task['tolk:sync'].invoke
Tolk::Locale.import_secondary_locales
end
desc "Show all the keys potentially containing HTML values and no _html postfix"
task :html_keys => :environment do
bad_translations = Tolk::Locale.primary_locale.translations_with_html
bad_translations.each do |bt|
puts "#{bt.phrase.key} - #{bt.text}"
end
end
desc "Copies required assets from tolk to application's public/ directory"
task :import_assets do
tolk_assets = File.expand_path(File.join(File.dirname(__FILE__), '../../public/tolk'))
command = "cp -R #{tolk_assets} #{Rails.root}/public/"
puts command
system(command)
end
end
| Add rake tolk:import_assets for copying asstes to the app | Add rake tolk:import_assets for copying asstes to the app
| Ruby | mit | rdunlop/tolk,joe-bader/tolk,tmp8/tolk,rdunlop/tolk,joe-bader/tolk,10to1/tolk,tolk/tolk,MyMedsAndMe/tolk,MyMedsAndMe/tolk,rdunlop/tolk,MyMedsAndMe/tolk,munirent/tolk,munirent/tolk,tmp8/tolk,tolk/tolk,tolk/tolk,10to1/tolk | ruby | ## Code Before:
namespace :tolk do
desc "Sync Tolk with the default locale's yml file"
task :sync => :environment do
Tolk::Locale.sync!
end
desc "Generate yml files for all the locales defined in Tolk"
task :dump_all => :environment do
Tolk::Locale.dump_all
end
desc "Imports data all non default locale yml files to Tolk"
task :import => :environment do
Rake::Task['tolk:sync'].invoke
Tolk::Locale.import_secondary_locales
end
desc "Show all the keys potentially containing HTML values and no _html postfix"
task :html_keys => :environment do
bad_translations = Tolk::Locale.primary_locale.translations_with_html
bad_translations.each do |bt|
puts "#{bt.phrase.key} - #{bt.text}"
end
end
end
## Instruction:
Add rake tolk:import_assets for copying asstes to the app
## Code After:
namespace :tolk do
desc "Sync Tolk with the default locale's yml file"
task :sync => :environment do
Tolk::Locale.sync!
end
desc "Generate yml files for all the locales defined in Tolk"
task :dump_all => :environment do
Tolk::Locale.dump_all
end
desc "Imports data all non default locale yml files to Tolk"
task :import => :environment do
Rake::Task['tolk:sync'].invoke
Tolk::Locale.import_secondary_locales
end
desc "Show all the keys potentially containing HTML values and no _html postfix"
task :html_keys => :environment do
bad_translations = Tolk::Locale.primary_locale.translations_with_html
bad_translations.each do |bt|
puts "#{bt.phrase.key} - #{bt.text}"
end
end
desc "Copies required assets from tolk to application's public/ directory"
task :import_assets do
tolk_assets = File.expand_path(File.join(File.dirname(__FILE__), '../../public/tolk'))
command = "cp -R #{tolk_assets} #{Rails.root}/public/"
puts command
system(command)
end
end
| namespace :tolk do
desc "Sync Tolk with the default locale's yml file"
task :sync => :environment do
Tolk::Locale.sync!
end
desc "Generate yml files for all the locales defined in Tolk"
task :dump_all => :environment do
Tolk::Locale.dump_all
end
desc "Imports data all non default locale yml files to Tolk"
task :import => :environment do
Rake::Task['tolk:sync'].invoke
Tolk::Locale.import_secondary_locales
end
desc "Show all the keys potentially containing HTML values and no _html postfix"
task :html_keys => :environment do
bad_translations = Tolk::Locale.primary_locale.translations_with_html
bad_translations.each do |bt|
puts "#{bt.phrase.key} - #{bt.text}"
end
end
+
+ desc "Copies required assets from tolk to application's public/ directory"
+ task :import_assets do
+ tolk_assets = File.expand_path(File.join(File.dirname(__FILE__), '../../public/tolk'))
+ command = "cp -R #{tolk_assets} #{Rails.root}/public/"
+ puts command
+ system(command)
+ end
+
end | 9 | 0.36 | 9 | 0 |
dae08723793053d283a0a3d127d5e903e4fcee1b | src/app/db-status.service.ts | src/app/db-status.service.ts | import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { CookieService } from './cookie.service';
import { Observable, of } from 'rxjs';
import { map, retry, catchError } from 'rxjs/operators';
import { environment } from '../environments/environment'
import { apiURL, apiRetry } from './api-utils'
import { FolderStatus, Folder } from './folder'
@Injectable({
providedIn: 'root'
})
export class DbStatusService {
private folderStatus: Object = {};
// TODO why isn't this working?
private httpOptions: { headers: HttpHeaders } | { params: HttpParams };
private dbStatusUrl = environment.production ? apiURL + 'rest/db/status' : 'api/dbStatus';
constructor(private http: HttpClient, private cookieService: CookieService) {
this.httpOptions = { headers: new HttpHeaders(this.cookieService.getCSRFHeader()) };
}
getFolderStatus(id: string): Observable<FolderStatus> {
/*
if (id) {
this.httpOptions["params"] = new HttpParams().set('folder', id);
}
*/
return this.http
.get<FolderStatus>(this.dbStatusUrl, this.httpOptions)
.pipe(
retry(apiRetry),
map(res => {
return res;
})
);
}
} | import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { CookieService } from './cookie.service';
import { Observable, of } from 'rxjs';
import { map, retry, catchError } from 'rxjs/operators';
import { environment } from '../environments/environment'
import { apiURL, apiRetry } from './api-utils'
import { FolderStatus, Folder } from './folder'
@Injectable({
providedIn: 'root'
})
export class DbStatusService {
private folderStatus: Object = {};
private headers: HttpHeaders;
private dbStatusUrl = environment.production ? apiURL + 'rest/db/status' : 'api/dbStatus';
constructor(private http: HttpClient, private cookieService: CookieService) {
this.headers = new HttpHeaders(this.cookieService.getCSRFHeader())
}
getFolderStatus(id: string): Observable<FolderStatus> {
let httpOptions: { headers: HttpHeaders } |
{ headers: HttpHeaders, params: HttpParams };
if (id) {
httpOptions = {
headers: this.headers,
params: new HttpParams().set('folder', id)
};
} else {
httpOptions = { headers: this.headers };
}
return this.http
.get<FolderStatus>(this.dbStatusUrl, httpOptions)
.pipe(
retry(apiRetry),
map(res => {
// Remove from array in developement
// in-memory-web-api returns arrays
if (!environment.production) {
const a: any = res as any;
if (a.length > 0) {
return res[0];
}
}
return res;
})
);
}
} | Remove Folder object from array in development only | Remove Folder object from array in development only
| TypeScript | mpl-2.0 | wweich/syncthing,syncthing/syncthing,syncthing/syncthing,wweich/syncthing,wweich/syncthing,syncthing/syncthing,wweich/syncthing,syncthing/syncthing,syncthing/syncthing,syncthing/syncthing | typescript | ## Code Before:
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { CookieService } from './cookie.service';
import { Observable, of } from 'rxjs';
import { map, retry, catchError } from 'rxjs/operators';
import { environment } from '../environments/environment'
import { apiURL, apiRetry } from './api-utils'
import { FolderStatus, Folder } from './folder'
@Injectable({
providedIn: 'root'
})
export class DbStatusService {
private folderStatus: Object = {};
// TODO why isn't this working?
private httpOptions: { headers: HttpHeaders } | { params: HttpParams };
private dbStatusUrl = environment.production ? apiURL + 'rest/db/status' : 'api/dbStatus';
constructor(private http: HttpClient, private cookieService: CookieService) {
this.httpOptions = { headers: new HttpHeaders(this.cookieService.getCSRFHeader()) };
}
getFolderStatus(id: string): Observable<FolderStatus> {
/*
if (id) {
this.httpOptions["params"] = new HttpParams().set('folder', id);
}
*/
return this.http
.get<FolderStatus>(this.dbStatusUrl, this.httpOptions)
.pipe(
retry(apiRetry),
map(res => {
return res;
})
);
}
}
## Instruction:
Remove Folder object from array in development only
## Code After:
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { CookieService } from './cookie.service';
import { Observable, of } from 'rxjs';
import { map, retry, catchError } from 'rxjs/operators';
import { environment } from '../environments/environment'
import { apiURL, apiRetry } from './api-utils'
import { FolderStatus, Folder } from './folder'
@Injectable({
providedIn: 'root'
})
export class DbStatusService {
private folderStatus: Object = {};
private headers: HttpHeaders;
private dbStatusUrl = environment.production ? apiURL + 'rest/db/status' : 'api/dbStatus';
constructor(private http: HttpClient, private cookieService: CookieService) {
this.headers = new HttpHeaders(this.cookieService.getCSRFHeader())
}
getFolderStatus(id: string): Observable<FolderStatus> {
let httpOptions: { headers: HttpHeaders } |
{ headers: HttpHeaders, params: HttpParams };
if (id) {
httpOptions = {
headers: this.headers,
params: new HttpParams().set('folder', id)
};
} else {
httpOptions = { headers: this.headers };
}
return this.http
.get<FolderStatus>(this.dbStatusUrl, httpOptions)
.pipe(
retry(apiRetry),
map(res => {
// Remove from array in developement
// in-memory-web-api returns arrays
if (!environment.production) {
const a: any = res as any;
if (a.length > 0) {
return res[0];
}
}
return res;
})
);
}
} | import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { CookieService } from './cookie.service';
import { Observable, of } from 'rxjs';
import { map, retry, catchError } from 'rxjs/operators';
import { environment } from '../environments/environment'
import { apiURL, apiRetry } from './api-utils'
import { FolderStatus, Folder } from './folder'
@Injectable({
providedIn: 'root'
})
export class DbStatusService {
private folderStatus: Object = {};
+ private headers: HttpHeaders;
-
- // TODO why isn't this working?
- private httpOptions: { headers: HttpHeaders } | { params: HttpParams };
private dbStatusUrl = environment.production ? apiURL + 'rest/db/status' : 'api/dbStatus';
constructor(private http: HttpClient, private cookieService: CookieService) {
- this.httpOptions = { headers: new HttpHeaders(this.cookieService.getCSRFHeader()) };
? ---------------- ^ ---
+ this.headers = new HttpHeaders(this.cookieService.getCSRFHeader())
? ^^
}
getFolderStatus(id: string): Observable<FolderStatus> {
- /*
+ let httpOptions: { headers: HttpHeaders } |
+ { headers: HttpHeaders, params: HttpParams };
if (id) {
+ httpOptions = {
+ headers: this.headers,
- this.httpOptions["params"] = new HttpParams().set('folder', id);
? ^^^^^^^^^^^^^^^^^^ ^^^^ -
+ params: new HttpParams().set('folder', id)
? ^^ ^
+ };
+ } else {
+ httpOptions = { headers: this.headers };
}
- */
return this.http
- .get<FolderStatus>(this.dbStatusUrl, this.httpOptions)
? -----
+ .get<FolderStatus>(this.dbStatusUrl, httpOptions)
.pipe(
retry(apiRetry),
map(res => {
+ // Remove from array in developement
+ // in-memory-web-api returns arrays
+ if (!environment.production) {
+ const a: any = res as any;
+ if (a.length > 0) {
+ return res[0];
+ }
+ }
return res;
})
);
}
} | 27 | 0.642857 | 19 | 8 |
6d7934079d60f3a7ef6d1a07e9f60bcedde16f01 | app/helpers/quick_jump_targets_helper.rb | app/helpers/quick_jump_targets_helper.rb | module QuickJumpTargetsHelper
def default_quickjump_targets
targets = find_last_active_contents(:limit => 8, :type => Page).map(&:holder).compact.uniq
quick_jumpify(targets)
end
def default_quickjump_projects(_limit = 20)
targets = current_domain.projects.where(:active => true).limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def default_quickjump_pages(_limit = 20)
targets = current_domain.pages.where("context_id IS NULL").limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def quick_jumpify(targets)
targets.map do |record|
url = url_for(record)
record.attributes.merge(:type => record.class.to_s, :title => record.title, :url => url)
end
end
# TODO: this solution seems terrible
def find_last_active_contents(options = {})
limit = options.fetch(:limit, 8)
types = [options.fetch(:type)].flatten.compact.map(&:to_s)
chain = Activity.accessible_by(current_ability).where(:user_id => current_user.id)
chain = chain.where("verb <> 'read'").order("created_at DESC")
offset = 0
contents = []
while contents.length < limit && offset < chain.count do
activity = chain.offset(offset).first
content = activity.try(:content).presence
if content.present? && !contents.include?(content)
if !types.present? || types.include?(content.holder_type)
contents << activity.content
end
end
offset += 1
end
contents
end
end
| module QuickJumpTargetsHelper
def default_quickjump_targets
if current_project
quick_jumpify(current_project.pages)
else
default_quickjump_pages(8)
end
end
def default_quickjump_projects(_limit = 20)
targets = current_domain.projects.where(:active => true).limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def default_quickjump_pages(_limit = 20)
targets = current_domain.pages.where("context_id IS NULL").limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def quick_jumpify(targets)
targets.map do |record|
url = url_for(record)
record.attributes.merge(:type => record.class.to_s, :title => record.title, :url => url)
end
end
end
| Simplify default targets in QuickJumpHelper | Simplify default targets in QuickJumpHelper
| Ruby | mit | rrrene/outline,rrrene/outline | ruby | ## Code Before:
module QuickJumpTargetsHelper
def default_quickjump_targets
targets = find_last_active_contents(:limit => 8, :type => Page).map(&:holder).compact.uniq
quick_jumpify(targets)
end
def default_quickjump_projects(_limit = 20)
targets = current_domain.projects.where(:active => true).limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def default_quickjump_pages(_limit = 20)
targets = current_domain.pages.where("context_id IS NULL").limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def quick_jumpify(targets)
targets.map do |record|
url = url_for(record)
record.attributes.merge(:type => record.class.to_s, :title => record.title, :url => url)
end
end
# TODO: this solution seems terrible
def find_last_active_contents(options = {})
limit = options.fetch(:limit, 8)
types = [options.fetch(:type)].flatten.compact.map(&:to_s)
chain = Activity.accessible_by(current_ability).where(:user_id => current_user.id)
chain = chain.where("verb <> 'read'").order("created_at DESC")
offset = 0
contents = []
while contents.length < limit && offset < chain.count do
activity = chain.offset(offset).first
content = activity.try(:content).presence
if content.present? && !contents.include?(content)
if !types.present? || types.include?(content.holder_type)
contents << activity.content
end
end
offset += 1
end
contents
end
end
## Instruction:
Simplify default targets in QuickJumpHelper
## Code After:
module QuickJumpTargetsHelper
def default_quickjump_targets
if current_project
quick_jumpify(current_project.pages)
else
default_quickjump_pages(8)
end
end
def default_quickjump_projects(_limit = 20)
targets = current_domain.projects.where(:active => true).limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def default_quickjump_pages(_limit = 20)
targets = current_domain.pages.where("context_id IS NULL").limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def quick_jumpify(targets)
targets.map do |record|
url = url_for(record)
record.attributes.merge(:type => record.class.to_s, :title => record.title, :url => url)
end
end
end
| module QuickJumpTargetsHelper
def default_quickjump_targets
- targets = find_last_active_contents(:limit => 8, :type => Page).map(&:holder).compact.uniq
- quick_jumpify(targets)
+ if current_project
+ quick_jumpify(current_project.pages)
+ else
+ default_quickjump_pages(8)
+ end
end
def default_quickjump_projects(_limit = 20)
targets = current_domain.projects.where(:active => true).limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def default_quickjump_pages(_limit = 20)
targets = current_domain.pages.where("context_id IS NULL").limit(_limit).order("UPPER(title) ASC")
quick_jumpify(targets)
end
def quick_jumpify(targets)
targets.map do |record|
url = url_for(record)
record.attributes.merge(:type => record.class.to_s, :title => record.title, :url => url)
end
end
- # TODO: this solution seems terrible
- def find_last_active_contents(options = {})
- limit = options.fetch(:limit, 8)
- types = [options.fetch(:type)].flatten.compact.map(&:to_s)
- chain = Activity.accessible_by(current_ability).where(:user_id => current_user.id)
- chain = chain.where("verb <> 'read'").order("created_at DESC")
- offset = 0
- contents = []
- while contents.length < limit && offset < chain.count do
- activity = chain.offset(offset).first
- content = activity.try(:content).presence
- if content.present? && !contents.include?(content)
- if !types.present? || types.include?(content.holder_type)
- contents << activity.content
- end
- end
- offset += 1
- end
- contents
- end
end | 27 | 0.613636 | 5 | 22 |
2993958c5b9399064e4cf29b745be68ef3a78669 | README.md | README.md |
React Native for OS X (Windows, Linux).
## Current stage

## Roadmap to 0.1.0
https://github.com/ptmt/react-native-desktop/issues/1
|
React Native for OS X (Windows, Linux).
## Current stage

## Roadmap to 0.1.0
https://github.com/ptmt/react-native-desktop/issues/1
| Replace dropbox link with imgur | Replace dropbox link with imgur
| Markdown | mit | ptmt/react-native-macos,pvinis/react-native-desktop,pvinis/react-native-desktop,ptmt/react-native-macos,ptmt/react-native-macos,pvinis/react-native-desktop,ptmt/react-native-macos,pvinis/react-native-desktop,pvinis/react-native-desktop,ptmt/react-native-macos,ptmt/react-native-macos,pvinis/react-native-desktop,ptmt/react-native-macos,ptmt/react-native-macos,pvinis/react-native-desktop | markdown | ## Code Before:
React Native for OS X (Windows, Linux).
## Current stage

## Roadmap to 0.1.0
https://github.com/ptmt/react-native-desktop/issues/1
## Instruction:
Replace dropbox link with imgur
## Code After:
React Native for OS X (Windows, Linux).
## Current stage

## Roadmap to 0.1.0
https://github.com/ptmt/react-native-desktop/issues/1
|
React Native for OS X (Windows, Linux).
## Current stage
- 
+ 
## Roadmap to 0.1.0
https://github.com/ptmt/react-native-desktop/issues/1 | 2 | 0.2 | 1 | 1 |
6fd90709733df85f5cac054b70f37185e04cda9d | lib/profile/CMakeLists.txt | lib/profile/CMakeLists.txt | add_custom_target(profile)
set(PROFILE_SOURCES
GCDAProfiling.c
InstrProfiling.c
InstrProfilingBuffer.c
InstrProfilingFile.c
InstrProfilingPlatformDarwin.c
InstrProfilingPlatformLinux.c
InstrProfilingPlatformOther.c
InstrProfilingRuntime.cc
InstrProfilingUtil.c)
if(APPLE)
add_compiler_rt_runtime(clang_rt.profile
STATIC
OS ${PROFILE_SUPPORTED_OS}
ARCHS ${PROFILE_SUPPORTED_ARCH}
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
else()
add_compiler_rt_runtime(clang_rt.profile
STATIC
ARCHS ${PROFILE_SUPPORTED_ARCH}
CFLAGS -fPIC
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
endif()
add_dependencies(compiler-rt profile)
| add_custom_target(profile)
set(PROFILE_SOURCES
GCDAProfiling.c
InstrProfiling.c
InstrProfilingBuffer.c
InstrProfilingFile.c
InstrProfilingPlatformDarwin.c
InstrProfilingPlatformLinux.c
InstrProfilingPlatformOther.c
InstrProfilingRuntime.cc
InstrProfilingUtil.c)
include_directories("${LLVM_MAIN_INCLUDE_DIR}")
if(APPLE)
add_compiler_rt_runtime(clang_rt.profile
STATIC
OS ${PROFILE_SUPPORTED_OS}
ARCHS ${PROFILE_SUPPORTED_ARCH}
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
else()
add_compiler_rt_runtime(clang_rt.profile
STATIC
ARCHS ${PROFILE_SUPPORTED_ARCH}
CFLAGS -fPIC
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
endif()
add_dependencies(compiler-rt profile)
| Add LLVM main include dir to profile runtime build | [PGO] Add LLVM main include dir to profile runtime build
Runtime code implicitly depends on the defintions and const
values defined in LLVM proper, but currently such dependency
is made implicitly by duplicating code across two dirs. As
part of the PGO cleanup effort, there will be changes to share
common sources. This is a preparation patch to enable it (NFC).
Differential Revision: http://reviews.llvm.org/D14487
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@252570 91177308-0d34-0410-b5e6-96231b3b80d8
| Text | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt | text | ## Code Before:
add_custom_target(profile)
set(PROFILE_SOURCES
GCDAProfiling.c
InstrProfiling.c
InstrProfilingBuffer.c
InstrProfilingFile.c
InstrProfilingPlatformDarwin.c
InstrProfilingPlatformLinux.c
InstrProfilingPlatformOther.c
InstrProfilingRuntime.cc
InstrProfilingUtil.c)
if(APPLE)
add_compiler_rt_runtime(clang_rt.profile
STATIC
OS ${PROFILE_SUPPORTED_OS}
ARCHS ${PROFILE_SUPPORTED_ARCH}
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
else()
add_compiler_rt_runtime(clang_rt.profile
STATIC
ARCHS ${PROFILE_SUPPORTED_ARCH}
CFLAGS -fPIC
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
endif()
add_dependencies(compiler-rt profile)
## Instruction:
[PGO] Add LLVM main include dir to profile runtime build
Runtime code implicitly depends on the defintions and const
values defined in LLVM proper, but currently such dependency
is made implicitly by duplicating code across two dirs. As
part of the PGO cleanup effort, there will be changes to share
common sources. This is a preparation patch to enable it (NFC).
Differential Revision: http://reviews.llvm.org/D14487
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@252570 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
add_custom_target(profile)
set(PROFILE_SOURCES
GCDAProfiling.c
InstrProfiling.c
InstrProfilingBuffer.c
InstrProfilingFile.c
InstrProfilingPlatformDarwin.c
InstrProfilingPlatformLinux.c
InstrProfilingPlatformOther.c
InstrProfilingRuntime.cc
InstrProfilingUtil.c)
include_directories("${LLVM_MAIN_INCLUDE_DIR}")
if(APPLE)
add_compiler_rt_runtime(clang_rt.profile
STATIC
OS ${PROFILE_SUPPORTED_OS}
ARCHS ${PROFILE_SUPPORTED_ARCH}
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
else()
add_compiler_rt_runtime(clang_rt.profile
STATIC
ARCHS ${PROFILE_SUPPORTED_ARCH}
CFLAGS -fPIC
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
endif()
add_dependencies(compiler-rt profile)
| add_custom_target(profile)
set(PROFILE_SOURCES
GCDAProfiling.c
InstrProfiling.c
InstrProfilingBuffer.c
InstrProfilingFile.c
InstrProfilingPlatformDarwin.c
InstrProfilingPlatformLinux.c
InstrProfilingPlatformOther.c
InstrProfilingRuntime.cc
InstrProfilingUtil.c)
+
+ include_directories("${LLVM_MAIN_INCLUDE_DIR}")
if(APPLE)
add_compiler_rt_runtime(clang_rt.profile
STATIC
OS ${PROFILE_SUPPORTED_OS}
ARCHS ${PROFILE_SUPPORTED_ARCH}
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
else()
add_compiler_rt_runtime(clang_rt.profile
STATIC
ARCHS ${PROFILE_SUPPORTED_ARCH}
CFLAGS -fPIC
SOURCES ${PROFILE_SOURCES}
PARENT_TARGET profile)
endif()
add_dependencies(compiler-rt profile) | 2 | 0.066667 | 2 | 0 |
db208404da01ae397d3a524506df0f95c44db163 | src/java/com/cloudrobotics/hello-world-client/Main.java | src/java/com/cloudrobotics/hello-world-client/Main.java | package com.cloudrobotics.hello_world_client;
import cloudrobotics.hello_world.v1alpha1.K8sHelloWorldGrpc;
import cloudrobotics.hello_world.v1alpha1.Service;
import io.grpc.ManagedChannelBuilder;
import java.util.logging.Logger;
/** */
final class Main {
private static final Logger logger = Logger.getLogger(Main.class.getName());
public static void main(String[] args) {
K8sHelloWorldGrpc.K8sHelloWorldBlockingStub stub =
K8sHelloWorldGrpc.newBlockingStub(
ManagedChannelBuilder.forAddress("localhost", 50051).usePlaintext().build());
Service.HelloWorld world =
stub.get(Service.GetHelloWorldRequest.newBuilder().setName("foo").build());
System.out.println(world.getMetadata().getResourceVersion());
}
}
| package com.cloudrobotics.hello_world_client;
import cloudrobotics.hello_world.v1alpha1.K8sHelloWorldGrpc;
import cloudrobotics.hello_world.v1alpha1.Service;
import io.grpc.ManagedChannelBuilder;
import java.util.logging.Logger;
/** */
final class Main {
private static final Logger logger = Logger.getLogger(Main.class.getName());
public static void main(String[] args) {
K8sHelloWorldGrpc.K8sHelloWorldBlockingStub stub =
K8sHelloWorldGrpc.newBlockingStub(
ManagedChannelBuilder.forAddress("localhost", 50051).usePlaintext().build());
Service.CreateHelloWorldRequest.Builder req = Service.CreateHelloWorldRequest.newBuilder();
req.getObjectBuilder().getMetadataBuilder().setName("foo");
stub.create(req.build());
Service.HelloWorld world =
stub.get(Service.GetHelloWorldRequest.newBuilder().setName("foo").build());
System.out.println(world.getMetadata().getResourceVersion());
stub.delete(Service.DeleteHelloWorldRequest.newBuilder().setName("foo").build());
}
}
| Add coverage the Hello World client example. | Add coverage the Hello World client example.
This is now free-standing and also covers edge cases like timestamps.
b/124437335
Change-Id: I9496504b638ae6af3885a20aeedf18e267aca683
GitOrigin-RevId: b7c8694f2f920371ee228bb53a6e499e3b727783
| Java | apache-2.0 | googlecloudrobotics/core,googlecloudrobotics/core,googlecloudrobotics/core | java | ## Code Before:
package com.cloudrobotics.hello_world_client;
import cloudrobotics.hello_world.v1alpha1.K8sHelloWorldGrpc;
import cloudrobotics.hello_world.v1alpha1.Service;
import io.grpc.ManagedChannelBuilder;
import java.util.logging.Logger;
/** */
final class Main {
private static final Logger logger = Logger.getLogger(Main.class.getName());
public static void main(String[] args) {
K8sHelloWorldGrpc.K8sHelloWorldBlockingStub stub =
K8sHelloWorldGrpc.newBlockingStub(
ManagedChannelBuilder.forAddress("localhost", 50051).usePlaintext().build());
Service.HelloWorld world =
stub.get(Service.GetHelloWorldRequest.newBuilder().setName("foo").build());
System.out.println(world.getMetadata().getResourceVersion());
}
}
## Instruction:
Add coverage the Hello World client example.
This is now free-standing and also covers edge cases like timestamps.
b/124437335
Change-Id: I9496504b638ae6af3885a20aeedf18e267aca683
GitOrigin-RevId: b7c8694f2f920371ee228bb53a6e499e3b727783
## Code After:
package com.cloudrobotics.hello_world_client;
import cloudrobotics.hello_world.v1alpha1.K8sHelloWorldGrpc;
import cloudrobotics.hello_world.v1alpha1.Service;
import io.grpc.ManagedChannelBuilder;
import java.util.logging.Logger;
/** */
final class Main {
private static final Logger logger = Logger.getLogger(Main.class.getName());
public static void main(String[] args) {
K8sHelloWorldGrpc.K8sHelloWorldBlockingStub stub =
K8sHelloWorldGrpc.newBlockingStub(
ManagedChannelBuilder.forAddress("localhost", 50051).usePlaintext().build());
Service.CreateHelloWorldRequest.Builder req = Service.CreateHelloWorldRequest.newBuilder();
req.getObjectBuilder().getMetadataBuilder().setName("foo");
stub.create(req.build());
Service.HelloWorld world =
stub.get(Service.GetHelloWorldRequest.newBuilder().setName("foo").build());
System.out.println(world.getMetadata().getResourceVersion());
stub.delete(Service.DeleteHelloWorldRequest.newBuilder().setName("foo").build());
}
}
| package com.cloudrobotics.hello_world_client;
import cloudrobotics.hello_world.v1alpha1.K8sHelloWorldGrpc;
import cloudrobotics.hello_world.v1alpha1.Service;
import io.grpc.ManagedChannelBuilder;
import java.util.logging.Logger;
/** */
final class Main {
private static final Logger logger = Logger.getLogger(Main.class.getName());
public static void main(String[] args) {
K8sHelloWorldGrpc.K8sHelloWorldBlockingStub stub =
K8sHelloWorldGrpc.newBlockingStub(
ManagedChannelBuilder.forAddress("localhost", 50051).usePlaintext().build());
+ Service.CreateHelloWorldRequest.Builder req = Service.CreateHelloWorldRequest.newBuilder();
+ req.getObjectBuilder().getMetadataBuilder().setName("foo");
+ stub.create(req.build());
Service.HelloWorld world =
stub.get(Service.GetHelloWorldRequest.newBuilder().setName("foo").build());
System.out.println(world.getMetadata().getResourceVersion());
+ stub.delete(Service.DeleteHelloWorldRequest.newBuilder().setName("foo").build());
}
} | 4 | 0.190476 | 4 | 0 |
71c9235a7e48882fc8c1393e9527fea4531c536c | filter_plugins/fap.py | filter_plugins/fap.py |
import ipaddress
def site_code(ipv4):
# Verify IP address
_ = ipaddress.ip_address(ipv4)
segments = ipv4.split(".")
return int(segments[1])
class FilterModule(object):
def filters(self):
return {"site_code": site_code}
|
import ipaddress
def site_code(ipv4):
# Verify IP address
_ = ipaddress.ip_address(ipv4)
segments = ipv4.split(".")
return int(segments[1])
# rest:https://restic.storage.tjoda.fap.no/rpi1.ldn.fap.no
# rclone:Jotta:storage.tjoda.fap.no
# /Volumes/storage/restic/kramacbook
def restic_repo_friendly_name(repo: str) -> str:
if "https://" in repo:
repo = repo.replace("https://", "")
print(repo)
type_, address, *_ = repo.split(":")
(r, *_) = address.split("/")
return "_".join([type_, r]).replace(".", "_")
elif ":" not in repo:
# Most likely a file path
type_ = "disk"
path = list(filter(None, repo.split("/")))
if path[0] == "Volumes":
return "_".join([type_, path[1]])
return "_".join([type_, repo.replace("/", "_")])
else:
type_, *rest = repo.split(":")
return "_".join([type_, rest[0]])
class FilterModule(object):
def filters(self):
return {
"site_code": site_code,
"restic_repo_friendly_name": restic_repo_friendly_name,
}
| Add really hacky way to reformat restic repos | Add really hacky way to reformat restic repos
| Python | mit | kradalby/plays,kradalby/plays | python | ## Code Before:
import ipaddress
def site_code(ipv4):
# Verify IP address
_ = ipaddress.ip_address(ipv4)
segments = ipv4.split(".")
return int(segments[1])
class FilterModule(object):
def filters(self):
return {"site_code": site_code}
## Instruction:
Add really hacky way to reformat restic repos
## Code After:
import ipaddress
def site_code(ipv4):
# Verify IP address
_ = ipaddress.ip_address(ipv4)
segments = ipv4.split(".")
return int(segments[1])
# rest:https://restic.storage.tjoda.fap.no/rpi1.ldn.fap.no
# rclone:Jotta:storage.tjoda.fap.no
# /Volumes/storage/restic/kramacbook
def restic_repo_friendly_name(repo: str) -> str:
if "https://" in repo:
repo = repo.replace("https://", "")
print(repo)
type_, address, *_ = repo.split(":")
(r, *_) = address.split("/")
return "_".join([type_, r]).replace(".", "_")
elif ":" not in repo:
# Most likely a file path
type_ = "disk"
path = list(filter(None, repo.split("/")))
if path[0] == "Volumes":
return "_".join([type_, path[1]])
return "_".join([type_, repo.replace("/", "_")])
else:
type_, *rest = repo.split(":")
return "_".join([type_, rest[0]])
class FilterModule(object):
def filters(self):
return {
"site_code": site_code,
"restic_repo_friendly_name": restic_repo_friendly_name,
}
|
import ipaddress
def site_code(ipv4):
# Verify IP address
_ = ipaddress.ip_address(ipv4)
segments = ipv4.split(".")
return int(segments[1])
+ # rest:https://restic.storage.tjoda.fap.no/rpi1.ldn.fap.no
+ # rclone:Jotta:storage.tjoda.fap.no
+ # /Volumes/storage/restic/kramacbook
+ def restic_repo_friendly_name(repo: str) -> str:
+ if "https://" in repo:
+ repo = repo.replace("https://", "")
+ print(repo)
+ type_, address, *_ = repo.split(":")
+ (r, *_) = address.split("/")
+ return "_".join([type_, r]).replace(".", "_")
+ elif ":" not in repo:
+ # Most likely a file path
+ type_ = "disk"
+ path = list(filter(None, repo.split("/")))
+ if path[0] == "Volumes":
+ return "_".join([type_, path[1]])
+
+ return "_".join([type_, repo.replace("/", "_")])
+
+ else:
+ type_, *rest = repo.split(":")
+ return "_".join([type_, rest[0]])
+
+
class FilterModule(object):
def filters(self):
+ return {
- return {"site_code": site_code}
? ------ ^ ^
+ "site_code": site_code,
? ^^^ ^
+ "restic_repo_friendly_name": restic_repo_friendly_name,
+ } | 29 | 1.8125 | 28 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.