commit stringlengths 40 40 | old_file stringlengths 4 237 | new_file stringlengths 4 237 | old_contents stringlengths 1 4.24k | new_contents stringlengths 5 4.84k | subject stringlengths 15 778 | message stringlengths 16 6.86k | lang stringlengths 1 30 | license stringclasses 13
values | repos stringlengths 5 116k | config stringlengths 1 30 | content stringlengths 105 8.72k |
|---|---|---|---|---|---|---|---|---|---|---|---|
a2a4975a52645a7cf28327a15438ec2ddcb28bfd | src/actions/actions.js | src/actions/actions.js | const ADD_TABLE_ROW = "ADD_TABLE_ROW"
const EDIT_TABLE_ROW = "EDIT_TABLE_ROW"
const UPDATE_TABLE_CELL = "UPDATE_TABLE_CELL"
let nextTableRowId = 0
const addTableRow = (tableRow) => {
return {
type: ADD_TABLE_ROW,
tableRow,
id: nextTableRowId++
}
}
const editTableRow = (id) => {
return {
type: ED... | const ADD_TABLE_ROW = "ADD_TABLE_ROW"
const EDIT_TABLE_ROW = "EDIT_TABLE_ROW"
const SAVE_TABLE_ROW = "SAVE_TABLE_ROW"
let nextTableRowId = 0
const addTableRow = (tableRow) => {
return {
type: ADD_TABLE_ROW,
tableRow,
id: nextTableRowId++
}
}
//Remove editing state from TableRow, use this passed down a... | Add save table row action | Add save table row action
| JavaScript | mit | severnsc/brewing-app,severnsc/brewing-app | javascript | ## Code Before:
const ADD_TABLE_ROW = "ADD_TABLE_ROW"
const EDIT_TABLE_ROW = "EDIT_TABLE_ROW"
const UPDATE_TABLE_CELL = "UPDATE_TABLE_CELL"
let nextTableRowId = 0
const addTableRow = (tableRow) => {
return {
type: ADD_TABLE_ROW,
tableRow,
id: nextTableRowId++
}
}
const editTableRow = (id) => {
retur... |
ee0a26fa7ad897ecb7db6abfb18a2eed8cdf0473 | framework/stagestack.cpp | framework/stagestack.cpp |
namespace OpenApoc {
void StageStack::Push(std::shared_ptr<Stage> newStage)
{
// Pause any current stage
if(this->Current())
this->Current()->Pause();
this->Stack.push(newStage);
newStage->Begin();
}
std::shared_ptr<Stage> StageStack::Pop()
{
std::shared_ptr<Stage> result = this->Current();
if (result)
{... |
namespace OpenApoc {
void StageStack::Push(std::shared_ptr<Stage> newStage)
{
// Pause any current stage
if(this->Current())
this->Current()->Pause();
this->Stack.push(newStage);
newStage->Begin();
}
std::shared_ptr<Stage> StageStack::Pop()
{
std::shared_ptr<Stage> result = this->Current();
if (result)
{... | Call Finish() on Stages removed from the stack | Call Finish() on Stages removed from the stack
| C++ | mit | steveschnepp/OpenApoc,ShadowDancer/OpenApoc,Istrebitel/OpenApoc,ShadowDancer/OpenApoc,FranciscoDA/OpenApoc,agry/x-com,AndO3131/OpenApoc,AndO3131/OpenApoc,steveschnepp/OpenApoc,agry/x-com,pmprog/OpenApoc,agry/x-com,FranciscoDA/OpenApoc,pmprog/OpenApoc,Istrebitel/OpenApoc,FranciscoDA/OpenApoc,AndO3131/OpenApoc | c++ | ## Code Before:
namespace OpenApoc {
void StageStack::Push(std::shared_ptr<Stage> newStage)
{
// Pause any current stage
if(this->Current())
this->Current()->Pause();
this->Stack.push(newStage);
newStage->Begin();
}
std::shared_ptr<Stage> StageStack::Pop()
{
std::shared_ptr<Stage> result = this->Current();
... |
2679bee67e0af83f81336476f76c081813c99b3b | qbs/modules/cutehmi/qmltypes/qmltypes.qbs | qbs/modules/cutehmi/qmltypes/qmltypes.qbs | import qbs
import qbs.Environment
import qbs.Utilities
import "functions.js" as Functions
/**
This module generates 'plugins.qmltypes' artifact.
*/
Module {
additionalProductTypes: ["qmltypes"]
condition: qbs.targetOS.contains("windows")
Depends { name: "Qt.core" }
Rule {
multiplex: true
inputs: ["qml"... | import qbs
import qbs.Environment
import qbs.Utilities
import "functions.js" as Functions
/**
This module generates 'plugins.qmltypes' artifact.
*/
Module {
additionalProductTypes: ["qmltypes"]
Depends { name: "Qt.core" }
Rule {
condition: qbs.targetOS.contains("windows")
multiplex: true
inputs: ["qml... | Move condition to `Rule` item. | Move condition to `Rule` item.
| QML | mit | michpolicht/CuteHMI,michpolicht/CuteHMI,michpolicht/CuteHMI,michpolicht/CuteHMI,michpolicht/CuteHMI | qml | ## Code Before:
import qbs
import qbs.Environment
import qbs.Utilities
import "functions.js" as Functions
/**
This module generates 'plugins.qmltypes' artifact.
*/
Module {
additionalProductTypes: ["qmltypes"]
condition: qbs.targetOS.contains("windows")
Depends { name: "Qt.core" }
Rule {
multiplex: true
... |
ba57f2f031de3f615e3a36e2ceb42ca8d14af807 | gobbler/views/addGibletView.html | gobbler/views/addGibletView.html | <template name="addGiblet">
<nav>
{{>navBar}}
</nav>
<form action="/" class="addGiblet">
<input type="text" name="taskname" placeholder="Title for this job/giblet">
<input type="url" name="url" placeholder="Url to search">
<input type="text" name="keywords" placeholder="Keywords to search for, eg. key... | <template name="dashboardTemplate">
<div class='dashboard'>
{{>navBar}}
<form action="/" class="addGiblet">
<input type="text" name="taskname" placeholder="Title for this job/giblet">
<input type="url" name="url" placeholder="Url to search">
<input type="text" name="keywords" placeholder=... | Refactor and rename giblet view to dashboard | Refactor and rename giblet view to dashboard
| HTML | mit | UnfetteredCheddar/UnfetteredCheddar,UnfetteredCheddar/UnfetteredCheddar | html | ## Code Before:
<template name="addGiblet">
<nav>
{{>navBar}}
</nav>
<form action="/" class="addGiblet">
<input type="text" name="taskname" placeholder="Title for this job/giblet">
<input type="url" name="url" placeholder="Url to search">
<input type="text" name="keywords" placeholder="Keywords to sea... |
18ec52a1c34e263e4d909fc1ee19500f9adac26b | examples/django_example/example/app/models.py | examples/django_example/example/app/models.py | from django.db import models
# Create your models here.
| from django.contrib.auth.models import AbstractUser, UserManager
class CustomUser(AbstractUser):
objects = UserManager()
| Define a custom user model | Define a custom user model
| Python | bsd-3-clause | S01780/python-social-auth,tobias47n9e/social-core,falcon1kr/python-social-auth,ByteInternet/python-social-auth,muhammad-ammar/python-social-auth,contracode/python-social-auth,S01780/python-social-auth,clef/python-social-auth,lawrence34/python-social-auth,python-social-auth/social-storage-sqlalchemy,fearlessspider/pytho... | python | ## Code Before:
from django.db import models
# Create your models here.
## Instruction:
Define a custom user model
## Code After:
from django.contrib.auth.models import AbstractUser, UserManager
class CustomUser(AbstractUser):
objects = UserManager()
|
a90f6a12c5607ed7ba5bf7d3d93c15676df8afad | .travis.yml | .travis.yml | language: go
go: 1.1
install:
- export PATH=$PATH:$HOME/gopath/bin
# Annoyingly, we can not use go get revel/... because references to app/routes package fail
- go get -v github.com/robfig/revel/revel
- go get -v github.com/robfig/revel/harness
- go get -v github.com/coopernurse/gorp
- go get -v code.google... | language: go
go: 1.1
install:
- export PATH=$PATH:$HOME/gopath/bin
# Annoyingly, we can not use go get revel/... because references to app/routes package fail
- go get -v github.com/robfig/revel/revel
- go get -v github.com/robfig/revel/harness
- go get -v github.com/coopernurse/gorp
- go get -v code.google... | Remove revel cache test we aren't using that | Remove revel cache test we aren't using that
| YAML | mit | FunnyMonkey/sally | yaml | ## Code Before:
language: go
go: 1.1
install:
- export PATH=$PATH:$HOME/gopath/bin
# Annoyingly, we can not use go get revel/... because references to app/routes package fail
- go get -v github.com/robfig/revel/revel
- go get -v github.com/robfig/revel/harness
- go get -v github.com/coopernurse/gorp
- go ge... |
130df743b14cf329c09f0c514ec0d6991b21dd45 | examples/mnist-deepautoencoder.py | examples/mnist-deepautoencoder.py |
import matplotlib.pyplot as plt
import theanets
from utils import load_mnist, plot_layers, plot_images
train, valid, _ = load_mnist()
e = theanets.Experiment(
theanets.Autoencoder,
layers=(784, 256, 64, 36, 64, 256, 784),
train_batches=100,
tied_weights=True,
)
e.train(train, valid, optimize='layer... |
import matplotlib.pyplot as plt
import theanets
from utils import load_mnist, plot_layers, plot_images
train, valid, _ = load_mnist()
e = theanets.Experiment(
theanets.Autoencoder,
layers=(784, 256, 64, 36, 64, 256, 784),
train_batches=100,
tied_weights=True,
)
e.train(train, valid, optimize='layer... | Decrease patience for each layerwise trainer. | Decrease patience for each layerwise trainer.
| Python | mit | chrinide/theanets,lmjohns3/theanets,devdoer/theanets | python | ## Code Before:
import matplotlib.pyplot as plt
import theanets
from utils import load_mnist, plot_layers, plot_images
train, valid, _ = load_mnist()
e = theanets.Experiment(
theanets.Autoencoder,
layers=(784, 256, 64, 36, 64, 256, 784),
train_batches=100,
tied_weights=True,
)
e.train(train, valid,... |
060d23439de45065aec734b031e4be2445acbd40 | src/processTailwindFeatures.js | src/processTailwindFeatures.js | import _ from 'lodash'
import postcss from 'postcss'
import substituteTailwindAtRules from './lib/substituteTailwindAtRules'
import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions'
import substituteVariantsAtRules from './lib/substituteVariantsAtRules'
import substituteResponsiveAtRules from './lib/sub... | import _ from 'lodash'
import postcss from 'postcss'
import substituteTailwindAtRules from './lib/substituteTailwindAtRules'
import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions'
import substituteVariantsAtRules from './lib/substituteVariantsAtRules'
import substituteResponsiveAtRules from './lib/sub... | Remove code obsoleted by upgrading PostCSS | Remove code obsoleted by upgrading PostCSS
| JavaScript | mit | tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss | javascript | ## Code Before:
import _ from 'lodash'
import postcss from 'postcss'
import substituteTailwindAtRules from './lib/substituteTailwindAtRules'
import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions'
import substituteVariantsAtRules from './lib/substituteVariantsAtRules'
import substituteResponsiveAtRules... |
d5893107e1139bbb1a34be1c57f86646da4eac97 | Stately/app/src/main/java/com/lloydtorres/stately/dto/NationOverviewCardData.java | Stately/app/src/main/java/com/lloydtorres/stately/dto/NationOverviewCardData.java | package com.lloydtorres.stately.dto;
/**
* Created by Lloyd on 2016-07-24.
* A holder for data in the main nation overview card.
*/
public class NationOverviewCardData {
public String category;
public String region;
public String inflDesc;
public int inflScore;
public String population;
publ... | package com.lloydtorres.stately.dto;
/**
* Created by Lloyd on 2016-07-24.
* A holder for data in the main nation overview card.
*/
public class NationOverviewCardData {
public String category;
public String region;
public String inflDesc;
public int inflScore;
public String population;
publ... | Add last seen parameter to nation overview card DTO | Add last seen parameter to nation overview card DTO
| Java | apache-2.0 | lloydtorres/stately | java | ## Code Before:
package com.lloydtorres.stately.dto;
/**
* Created by Lloyd on 2016-07-24.
* A holder for data in the main nation overview card.
*/
public class NationOverviewCardData {
public String category;
public String region;
public String inflDesc;
public int inflScore;
public String popu... |
220cf5627ec4d94af2d114f04a9fb1c97596b39e | lib/collate/engine.rb | lib/collate/engine.rb | require_relative 'active_record_extension'
require_relative 'action_view_extension'
require 'rails'
module Collate
class Engine < ::Rails::Engine
isolate_namespace Collate
ActiveSupport.on_load :action_view do
include Collate::ActionViewExtension
end
ActiveSupport.on_load :active_record do
... | require_relative 'active_record_extension'
require_relative 'action_view_extension'
require 'rails'
module Collate
class Engine < ::Rails::Engine
isolate_namespace Collate
ActiveSupport.on_load :action_view do
include Collate::ActionViewExtension
end
ActiveSupport.on_load :active_record do
... | Check if constant is initialized (won’t be in the tests so far). | Check if constant is initialized (won’t be in the tests so far).
| Ruby | mit | trackingboard/collate,trackingboard/collate,trackingboard/collate | ruby | ## Code Before:
require_relative 'active_record_extension'
require_relative 'action_view_extension'
require 'rails'
module Collate
class Engine < ::Rails::Engine
isolate_namespace Collate
ActiveSupport.on_load :action_view do
include Collate::ActionViewExtension
end
ActiveSupport.on_load :ac... |
905577841e43e049972d089750c27529367006cb | src/TableParser/TypeInfo.php | src/TableParser/TypeInfo.php | <?php
namespace Maghead\TableParser;
class TypeInfo
{
public $type;
public $length;
public $precision;
public $isa;
public $fullQualifiedTypeName;
public $unsigned;
public $enum = array();
public $set = array();
public function __construct($typeName = null, $length = null)
... | <?php
namespace Maghead\TableParser;
/**
* Plain old object for column type info
*/
class TypeInfo
{
public $type;
public $length;
public $precision;
public $isa;
public $fullQualifiedTypeName;
public $unsigned;
public $enum = array();
public $set = array();
public functi... | Clean up type info interfaces | Clean up type info interfaces
| PHP | bsd-3-clause | c9s/LazyRecord,c9s/LazyRecord,c9s/LazyRecord | php | ## Code Before:
<?php
namespace Maghead\TableParser;
class TypeInfo
{
public $type;
public $length;
public $precision;
public $isa;
public $fullQualifiedTypeName;
public $unsigned;
public $enum = array();
public $set = array();
public function __construct($typeName = null, ... |
c8a20cabb71b249072a001ccf9c1c306640a511a | include/llvm/MC/MCParser/MCAsmParserUtils.h | include/llvm/MC/MCParser/MCAsmParserUtils.h | //===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | Make header parse standalone. NFC. | Make header parse standalone. NFC.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@240814 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,d... | c | ## Code Before:
//===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===---------------------------------------... |
00b5174f0f97e59a5dd90cab83d69e15b3fb6145 | ecplurkbot/config/keywords.sample.json | ecplurkbot/config/keywords.sample.json | {
"summon_keywords": {
"召喚詞1": ["回應1"]
},
"keywords": [
{"關鍵詞1": ["回應1"]},
{"關鍵詞2": ["回應2"]},
{"關鍵詞3": ["回應3"]},
{"關鍵詞4": ["回應4"]}
]
}
| {
"summon_keywords": {
"召喚詞1": ["回應1"]
},
"keywords": [
{"關鍵詞1": ["回應1", "回應2"]},
{"關鍵詞2": ["回應1", "回應2"]},
{"關鍵詞3": ["回應1", "回應2"]},
{"關鍵詞4": ["回應1", "回應2"]}
]
}
| Edit the example keywords.json for easy to understand | Edit the example keywords.json for easy to understand
| JSON | apache-2.0 | dollars0427/ecplurkbot | json | ## Code Before:
{
"summon_keywords": {
"召喚詞1": ["回應1"]
},
"keywords": [
{"關鍵詞1": ["回應1"]},
{"關鍵詞2": ["回應2"]},
{"關鍵詞3": ["回應3"]},
{"關鍵詞4": ["回應4"]}
]
}
## Instruction:
Edit the example keywords.json for easy to understand
## Code After:
{
"summon_keywords": {
"召喚詞1": ["回應1"]
},
"keywords": [
{"關鍵詞... |
6dfaf51c8bd498f9e955d6f7cdf92388b4ce9d68 | java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_sed.properties | java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_sed.properties | delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*]
| delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*],JRE - JDBC
| Fix derbynet/sysinfo test on JDK 1.3 by sed'ing out new JDK version string. | Fix derbynet/sysinfo test on JDK 1.3 by sed'ing out new JDK version string.
git-svn-id: e32e6781feeb0a0de14883205950ae267a8dad4f@152920 13f79535-47bb-0310-9956-ffa450edef68
| INI | apache-2.0 | apache/derby,trejkaz/derby,apache/derby,trejkaz/derby,apache/derby,apache/derby,trejkaz/derby | ini | ## Code Before:
delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*]
## Instruction:
Fix derbynet/sysinfo test on JDK 1.3 by sed'ing out new JDK version string.
git-svn-id: e32e6781feeb0a0de14883205950ae267a8dad4f@152920 13f79535-47bb-0310-9956-ffa450edef68
## Code After:
delete=Version,version,Java,OS,[0-9*].[0-9*]... |
7f144d1545a5547cdd7901bf61347a5ce4cff7d3 | app/views/shared/_sidebar.html.erb | app/views/shared/_sidebar.html.erb | <% if current_subdomain %>
<div id="sidebar">
<div id="sidebar-glow"></div>
<div id="header">
<div id="title">
<div class="top"></div>
<div class="content">
<h1><%= link_to current_subdomain.name, dashboard_path %></h1>
<span class="tagline">Mine Gems™</span>
</div>... | <% if defined?(:current_subdomain) && current_subdomain %>
<div id="sidebar">
<div id="sidebar-glow"></div>
<div id="header">
<div id="title">
<div class="top"></div>
<div class="content">
<h1><%= link_to current_subdomain.name, dashboard_path %></h1>
<span class="tagline">Mine... | Fix error undefined local variable or method `current_subdomain' | Fix error undefined local variable or method `current_subdomain'
This is a temporary fix, I suggest the product layout to be different than the promotional site layout. | HTML+ERB | mit | jodosha/minegems,jodosha/minegems | html+erb | ## Code Before:
<% if current_subdomain %>
<div id="sidebar">
<div id="sidebar-glow"></div>
<div id="header">
<div id="title">
<div class="top"></div>
<div class="content">
<h1><%= link_to current_subdomain.name, dashboard_path %></h1>
<span class="tagline">Mine Gems™</sp... |
191642d9ad1367ce0bb83db72051861ded7aa202 | lib/tasks/travis-ci.rake | lib/tasks/travis-ci.rake | begin
namespace :travis do
desc "Run all specs in except for the request specs"
RSpec::Core::RakeTask.new(:ci => :environment) do |task|
ENV["RAILS_ENV"] = "test"
task.pattern = FileList["spec/**/*_spec.rb"].exclude("spec/requests/**/*_spec.rb")
end
end
rescue LoadError
# In production, ... | begin
require 'rspec/core/rake_task'
namespace :travis do
desc "Run all specs in except for the request specs"
RSpec::Core::RakeTask.new(:ci => :environment) do |task|
ENV["RAILS_ENV"] = "test"
task.pattern = FileList["spec/**/*_spec.rb"].exclude("spec/requests/**/*_spec.rb")
end
end
res... | Add the rspec load call for rake_task | Add the rspec load call for rake_task
This is needed to actually trigger the LoadError. If it isn't present
then the rescue block will never fire and the uninitialized constant
error for RSpec will still happen in prod.
| Ruby | apache-2.0 | charlesjohnson/chef-server,chef/chef-server,rmoorman/chef-server,chef/chef-server,stephenbm/chef-server,chef/oc-id,itmustbejj/chef-server,poliva83/chef-server,stephenbm/chef-server,charlesjohnson/chef-server,juliandunn/chef-server-1,juliandunn/chef-server-1,marcparadise/chef-server,juliandunn/chef-server-1,itmustbejj/c... | ruby | ## Code Before:
begin
namespace :travis do
desc "Run all specs in except for the request specs"
RSpec::Core::RakeTask.new(:ci => :environment) do |task|
ENV["RAILS_ENV"] = "test"
task.pattern = FileList["spec/**/*_spec.rb"].exclude("spec/requests/**/*_spec.rb")
end
end
rescue LoadError
#... |
9c995511e10c82c9fe13fe27c5c4221b207477e6 | docker-compose-unit-tests.yml | docker-compose-unit-tests.yml | version: '3.2'
services:
#############################################
# Start app as a container
#############################################
web:
# build from local Dockerfile
build: .
# if not --build and kth-azure-app already exists in
# your local computers registry 'image' is used.
i... | version: '3.2'
services:
#############################################
# Start app as a container
#############################################
web:
# build from local Dockerfile
build: .
# if not --build and kth-azure-app already exists in
# your local computers registry 'image' is used.
i... | Remove unused variable in .yml file | Remove unused variable in .yml file
| YAML | mit | KTH/lms-sync,KTH/lms-sync | yaml | ## Code Before:
version: '3.2'
services:
#############################################
# Start app as a container
#############################################
web:
# build from local Dockerfile
build: .
# if not --build and kth-azure-app already exists in
# your local computers registry 'image... |
2da9bd4f2177b1d9c0f58d2f19e3b83257e45ded | sample/src/main/java/io/rapidpro/sdk/sample/Application.java | sample/src/main/java/io/rapidpro/sdk/sample/Application.java | package io.rapidpro.sdk.sample;
import io.rapidpro.sdk.FcmClient;
import io.rapidpro.sdk.UiConfiguration;
import io.rapidpro.sdk.sample.services.PushRegistrationService;
/**
* Created by John Cordeiro on 5/10/17.
* Copyright © 2017 rapidpro-android-sdk, Inc. All rights reserved.
*/
public class Application extend... | package io.rapidpro.sdk.sample;
import android.support.annotation.ColorRes;
import android.support.v4.content.res.ResourcesCompat;
import io.rapidpro.sdk.FcmClient;
import io.rapidpro.sdk.UiConfiguration;
import io.rapidpro.sdk.sample.services.PushRegistrationService;
/**
* Created by John Cordeiro on 5/10/17.
* C... | Add missing ui configuration on sample project | Add missing ui configuration on sample project
| Java | agpl-3.0 | Ilhasoft/rapidpro-android-sdk | java | ## Code Before:
package io.rapidpro.sdk.sample;
import io.rapidpro.sdk.FcmClient;
import io.rapidpro.sdk.UiConfiguration;
import io.rapidpro.sdk.sample.services.PushRegistrationService;
/**
* Created by John Cordeiro on 5/10/17.
* Copyright © 2017 rapidpro-android-sdk, Inc. All rights reserved.
*/
public class Ap... |
2e5ab02ea17ab5c89057433283b77192946736a7 | .codeclimate.yml | .codeclimate.yml | engines:
checkstyle:
enabled: true
channel: "beta"
ratings:
paths:
- "**.java"
| engines:
checkstyle:
enabled: true
channel: "beta"
ratings:
paths:
- "**.java"
exclude_patterns:
- "src/main/java/io/prometheus/common/ConfigVals.java"
| Remove ConfigVals.java from Code Climate review | Remove ConfigVals.java from Code Climate review
| YAML | apache-2.0 | pambrose/prometheus-proxy,pambrose/prometheus-proxy,pambrose/prometheus-proxy | yaml | ## Code Before:
engines:
checkstyle:
enabled: true
channel: "beta"
ratings:
paths:
- "**.java"
## Instruction:
Remove ConfigVals.java from Code Climate review
## Code After:
engines:
checkstyle:
enabled: true
channel: "beta"
ratings:
paths:
- "**.java"
exclude_patterns:
- "src/main/jav... |
a364196814c3b33e7fd51a42b4c3a48a3aaeaee8 | volaparrot/constants.py | volaparrot/constants.py | ADMINFAG = ["RealDolos"]
PARROTFAG = "Parrot"
BLACKFAGS = [i.casefold() for i in (
"kalyx", "merc", "loliq", "annoying", "bot", "RootBeats", "JEW2FORU", "quag", "mire", "perici")]
OBAMAS = [i.casefold() for i in (
"counselor", "briseis", "apha", "bread", "ark3", "jizzbomb", "acid", "elkoalemos", "tarta")]
BLA... | ADMINFAG = ["RealDolos"]
PARROTFAG = "Parrot"
BLACKFAGS = [i.casefold() for i in (
"kalyx", "merc", "loliq", "annoying", "RootBeats", "JEW2FORU", "quag", "mire", "perici", "Voldemort", "briseis", "brisis", "GNUsuks", "rhooes", "n1sm4n", "honeyhole", "Printer", "yume1")]
OBAMAS = [i.casefold() for i in (
"couns... | Update list of extraordinary gentlemen | Update list of extraordinary gentlemen
| Python | mit | RealDolos/volaparrot | python | ## Code Before:
ADMINFAG = ["RealDolos"]
PARROTFAG = "Parrot"
BLACKFAGS = [i.casefold() for i in (
"kalyx", "merc", "loliq", "annoying", "bot", "RootBeats", "JEW2FORU", "quag", "mire", "perici")]
OBAMAS = [i.casefold() for i in (
"counselor", "briseis", "apha", "bread", "ark3", "jizzbomb", "acid", "elkoalemos"... |
f7531d1a3d5621a5c03fe31febc0b2fa0c11604f | config/govuk_index/migrated_formats.yaml | config/govuk_index/migrated_formats.yaml | migrated:
- help_page
indexable:
- answer
- guide
- licence
- transaction
- simple_smart_answer
| migrated:
- help_page
indexable:
- answer
- guide
- licence
- local_transaction
- transaction
- simple_smart_answer
| Make local transaction format indexable | Make local transaction format indexable
| YAML | mit | alphagov/rummager,alphagov/rummager | yaml | ## Code Before:
migrated:
- help_page
indexable:
- answer
- guide
- licence
- transaction
- simple_smart_answer
## Instruction:
Make local transaction format indexable
## Code After:
migrated:
- help_page
indexable:
- answer
- guide
- licence
- local_transaction
- transaction
- simple_smart_answer
|
bc77f307e5c2bd6eb23fa5c8c46f678e6fcc4888 | swig/perl/CMakeLists.txt | swig/perl/CMakeLists.txt | include(UseSWIG)
include(FindPerlLibs)
set(CMAKE_SWIG_FLAGS "-module" "openscap_pm")
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(openscap_pm perl5 ../openscap.i)
else()
swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i)
endif()
swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY})
... | include(UseSWIG)
include(FindPerlLibs)
set(CMAKE_SWIG_FLAGS "-module" "openscap_pm")
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(openscap_pm perl5 ../openscap.i)
else()
swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i)
endif()
swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY})
... | Fix the build for FreeBSD. | Fix the build for FreeBSD.
Commit 69b9b1519 ("Changing hardcoded libperl path for FindPerlLibs
method") caused openscap to fail to build on FreeBSD with the
following errors:
CMake Error at swig/perl/CMakeLists.txt:22 (install):
install TARGETS given no LIBRARY DESTINATION for module target
"openscap_pm".
CMake E... | Text | lgpl-2.1 | OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap | text | ## Code Before:
include(UseSWIG)
include(FindPerlLibs)
set(CMAKE_SWIG_FLAGS "-module" "openscap_pm")
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(openscap_pm perl5 ../openscap.i)
else()
swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i)
endif()
swig_link_libraries(openscap_pm openscap $... |
f5b768cec7f837000695aff1062bf0d2013bd6ee | core/spec/entities/menu/menu_entry_spec.rb | core/spec/entities/menu/menu_entry_spec.rb | require 'spec_helper'
require 'menu/menu_entry'
module Abc
describe MenuEntry do
it "wraps passed children" do
e = MenuEntry.new('My title', [{:title => 'Child 1'}])
e.children.first.class.should == MenuEntry
end
end
end
| require 'spec_helper'
require 'menu/menu_entry'
module Abc
describe MenuEntry do
it "wraps passed children" do
e = MenuEntry.new('My title', [{:title => 'Child 1'}])
expect(e.children.first).to be_kind_of Abc::MenuEntry
end
end
end
| Use be_kind_of in class comparison. | Use be_kind_of in class comparison.
| Ruby | bsd-3-clause | grounded/afterburnercms,grounded/afterburnercms | ruby | ## Code Before:
require 'spec_helper'
require 'menu/menu_entry'
module Abc
describe MenuEntry do
it "wraps passed children" do
e = MenuEntry.new('My title', [{:title => 'Child 1'}])
e.children.first.class.should == MenuEntry
end
end
end
## Instruction:
Use be_kind_of in class comparison.
## C... |
a9755fc4b30629ea2c9db51aa6d4218f99fcabc3 | frigg/deployments/migrations/0004_auto_20150725_1456.py | frigg/deployments/migrations/0004_auto_20150725_1456.py | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
model_name='prdeployment',
name='imag... | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
model_name='prde... | Set FRIGG_PREVIEW_IMAGE in db migrations | Set FRIGG_PREVIEW_IMAGE in db migrations
| Python | mit | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | python | ## Code Before:
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
model_name='prdeployment',
... |
b054fafb626a43393c418b089eda4acb00a0820b | _data/navigation.yml | _data/navigation.yml | - text: Project
submenu:
- text: Why HospitalRun?
url: /blog/why-hospitalrun/
- text: Features
url: /features
- text: Try it
url: /demo
- text: FAQs
url: /faq
- text: Roadmap
url: /roadmap
- text: Deploy it
url: http://eepurl.com/c7uKJ5
- text: Blog
url: /... | - text: Project
submenu:
- text: Why HospitalRun?
url: /blog/why-hospitalrun/
- text: Features
url: /features
- text: Try it
url: /demo
- text: FAQs
url: /faq
- text: Roadmap
url: /roadmap
- text: Deploy it
url: http://eepurl.com/c7uKJ5
- text: Blog
url: /... | Add a link to Community's submenu | Add a link to Community's submenu
I've added in Community's submenu a link to Standards' page with mandatory rules for every creator of HospitalRun. | YAML | mit | HospitalRun/hospitalrun.github.io,HospitalRun/hospitalrun.github.io,HospitalRun/hospitalrun.github.io | yaml | ## Code Before:
- text: Project
submenu:
- text: Why HospitalRun?
url: /blog/why-hospitalrun/
- text: Features
url: /features
- text: Try it
url: /demo
- text: FAQs
url: /faq
- text: Roadmap
url: /roadmap
- text: Deploy it
url: http://eepurl.com/c7uKJ5
- tex... |
7a5733d26e9a7314da2934494a4ccf048956bbb3 | config.xml | config.xml | <?xml version='1.0' encoding='utf-8'?>
<widget id="se.rishie.ccdiff" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CCdiff</name>
<description>
An app for comparing Chinese character strokes between different languages and regions.
</description>
... | <?xml version='1.0' encoding='utf-8'?>
<widget id="se.rishie.ccdiff" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CCdiff</name>
<description>
An app for comparing Chinese character strokes between different languages and regions.
</description>
... | Change to white status bar color | Change to white status bar color
| XML | mpl-2.0 | fishie/ccdiff,fishie/ccdiff,fishie/ccdiff | xml | ## Code Before:
<?xml version='1.0' encoding='utf-8'?>
<widget id="se.rishie.ccdiff" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CCdiff</name>
<description>
An app for comparing Chinese character strokes between different languages and regions.
<... |
0b8faccaf2decc8628c376ba85e18f237bff6935 | data/class_groups/glance_all.yaml | data/class_groups/glance_all.yaml | classes:
- glance
- glance::api
- glance::registry
- "glance::backend::%{glance_backend}"
| classes:
- glance
- glance::api
- glance::registry
- "glance::backend::%{glance_backend}"
- glance::cache::pruner
| Add glance cache pruner job | Add glance cache pruner job
On nodes where we set up glance, we currently don't set up a
glance cache pruning job. This is a recommended practice as
it can allow glance images to take up more disk space than
they should be allowed to by the image_cache_max_size setting
(refer to http://docs.openstack.org/developer/gl... | YAML | apache-2.0 | CiscoSystems/puppet_openstack_builder,phchoic/puppet_openstack_builder,michaeltchapman/puppet_openstack_builder,michaeltchapman/puppet_openstack_builder,michaeltchapman/vagrant-consul,michaeltchapman/vagrant-consul,phchoic/puppet_openstack_builder,CiscoSystems/puppet_openstack_builder,michaeltchapman/puppet_openstack_b... | yaml | ## Code Before:
classes:
- glance
- glance::api
- glance::registry
- "glance::backend::%{glance_backend}"
## Instruction:
Add glance cache pruner job
On nodes where we set up glance, we currently don't set up a
glance cache pruning job. This is a recommended practice as
it can allow glance images to take up ... |
6f33921cc33dac50b0d17c496bc58f46d888c841 | app/js/arethusa.review/directives/review_linker.js | app/js/arethusa.review/directives/review_linker.js | "use strict";
angular.module('arethusa.review').directive('reviewLinker', [
'review',
'translator',
function(review, translator) {
return {
restrict: 'A',
scope: {},
link: function(scope, element, attrs) {
scope.review = review;
scope.translations = {};
translator('... | "use strict";
angular.module('arethusa.review').directive('reviewLinker', [
'review',
'translator',
function(review, translator) {
return {
restrict: 'A',
scope: {},
link: function(scope, element, attrs) {
scope.review = review;
scope.translations = {};
translator('... | Fix prematurely firing reviewLinker directive | Fix prematurely firing reviewLinker directive
| JavaScript | mit | fbaumgardt/arethusa,alpheios-project/arethusa,Masoumeh/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,PonteIneptique/arethusa,Masoumeh/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa | javascript | ## Code Before:
"use strict";
angular.module('arethusa.review').directive('reviewLinker', [
'review',
'translator',
function(review, translator) {
return {
restrict: 'A',
scope: {},
link: function(scope, element, attrs) {
scope.review = review;
scope.translations = {};
... |
9e06868011d7045b014dbe766c65dde40b8f41d1 | spec/ruby_spec.rb | spec/ruby_spec.rb | require "spec_helper_#{ENV['SPEC_TARGET_BACKEND']}"
describe package('ruby'), :if => os[:family] == 'darwin' do
it { should be_installed.by('homebrew') }
end
describe package('ruby'), :if => os[:family] == 'debian' do
it { should be_installed.by('apt') }
end
describe package('ruby') do
its(:version) { should >... | require "spec_helper_#{ENV['SPEC_TARGET_BACKEND']}"
# In default, Serverspec uses the context specified environment variables are clear.
# Ref. https://github.com/mizzy/specinfra/blob/master/lib/specinfra/backend/exec.rb#L128
set :env, :GEM_PATH => ENV['GEM_PATH']
describe package('ruby'), :if => os[:family] == 'darw... | Set GEM_PATH to Specinfra config. | Set GEM_PATH to Specinfra config.
Or, Serverspec can't find gems Ansible playbooks install.
| Ruby | mit | FGtatsuro/ansible-ruby | ruby | ## Code Before:
require "spec_helper_#{ENV['SPEC_TARGET_BACKEND']}"
describe package('ruby'), :if => os[:family] == 'darwin' do
it { should be_installed.by('homebrew') }
end
describe package('ruby'), :if => os[:family] == 'debian' do
it { should be_installed.by('apt') }
end
describe package('ruby') do
its(:ver... |
2c86c4f865baed1235e7432c928d02c50eb1080a | popup.html | popup.html | <!DOCTYPE html>
<html>
<head>
<script src="popup.js"></script>
<script src="jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="popup.css" />
</head>
<body>
<header>
<h1>Tumblr Batch Block</h1>
</header>
<main>
<section id="instructions">
<h1>Instructions:</h1>
<o... | <!DOCTYPE html>
<html>
<head>
<script src="popup.js"></script>
<script src="jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="popup.css" />
</head>
<body>
<header>
<h1>Tumblr Batch Block</h1>
</header>
<main>
<section id="instructions">
<h1>Instructions:</h1>
<o... | Add instructions on how to find the exported blocklist | Add instructions on how to find the exported blocklist
| HTML | agpl-3.0 | realityfabric/Tumblr-Batch-Block,realityfabric/Tumblr-Batch-Block | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<script src="popup.js"></script>
<script src="jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="popup.css" />
</head>
<body>
<header>
<h1>Tumblr Batch Block</h1>
</header>
<main>
<section id="instructions">
<h1>Instructi... |
bbcada86c706520c09e13320cb4edf6b1b8eaf41 | Cargo.toml | Cargo.toml | [package]
name = "chorus_studio"
version = "0.1.0"
authors = ["Daniel Hauser <daniel.hauser@liwest.at>"]
[dependencies]
gl = "0.7.0"
glutin = "0.12.0"
nalgebra = "0.13.1"
unicode-normalization = "0.1.5"
# indextree = "1.1.0"
[dependencies.nanovg]
git = "https://github.com/KevinKelley/nanovg-rs"
features = ["gl3"]
[d... | [package]
name = "chorus_studio"
version = "0.1.0"
authors = ["Daniel Hauser <daniel.hauser@liwest.at>"]
[dependencies]
gl = "0.7.0"
glutin = "0.12.0"
nalgebra = "0.13.1"
unicode-normalization = "0.1.5"
# indextree = "1.1.0"
[dependencies.nanovg]
git = "https://github.com/KevinKelley/nanovg-rs"
features = ["gl3"]
[d... | Use git version of indextree instead of rel path | Use git version of indextree instead of rel path
Awaiting a crates.io version bump with my pull request.
| TOML | apache-2.0 | Lisoph/chorus_studio | toml | ## Code Before:
[package]
name = "chorus_studio"
version = "0.1.0"
authors = ["Daniel Hauser <daniel.hauser@liwest.at>"]
[dependencies]
gl = "0.7.0"
glutin = "0.12.0"
nalgebra = "0.13.1"
unicode-normalization = "0.1.5"
# indextree = "1.1.0"
[dependencies.nanovg]
git = "https://github.com/KevinKelley/nanovg-rs"
featur... |
3259c2e382b736e13069265eb264079e3d3b9148 | production/bin/start.sh | production/bin/start.sh |
LOGFILE=${DEPLOYDIR}/log/${RAILS_ENV}.log
SERVER_PORT=3300
#since GITHUB_TOKEN environment variable is a json object, we need parse the value
#This function is here due to a limitation by "secrets manager"
if [[ -z ${GITHUB_TOKEN+x} || -z ${DEPLOY_ENV+x} || -z ${APP+x} ]]; then
echo "GITHUB_TOKEN, DEPLOY_ENV and AP... |
LOGFILE=${DEPLOYDIR}/log/${RAILS_ENV}.log
SERVER_PORT=3300
#since GITHUB_TOKEN environment variable is a json object, we need parse the value
#This function is here due to a limitation by "secrets manager"
if [[ -z ${GITHUB_TOKEN+x} || -z ${DEPLOY_ENV+x} || -z ${APP+x} ]]; then
echo "GITHUB_TOKEN, DEPLOY_ENV and AP... | Update worker timeout and threads | Update worker timeout and threads
| Shell | mit | meedan/check-api,meedan/check-api,meedan/check-api,meedan/check-api,meedan/check-api | shell | ## Code Before:
LOGFILE=${DEPLOYDIR}/log/${RAILS_ENV}.log
SERVER_PORT=3300
#since GITHUB_TOKEN environment variable is a json object, we need parse the value
#This function is here due to a limitation by "secrets manager"
if [[ -z ${GITHUB_TOKEN+x} || -z ${DEPLOY_ENV+x} || -z ${APP+x} ]]; then
echo "GITHUB_TOKEN, D... |
0cd621e5433b739c6b1e227fd700066876958791 | partials/navbar-menu.html | partials/navbar-menu.html | <li id="usermenu">
<a href="catalogs">
<span class="glyphicon glyphicon-inbox"></span>
{{'navbar_manage_catalogs' | transl8}}
</a>
<a href="editUser">
<span class="glyphicon glyphicon-pencil"></span>
{{ 'navbar_edit_profile' | transl8 }}
</a>
<a href="pwdreset">
... | <li id="usermenu">
<a href="catalogs">
<span class="glyphicon glyphicon-inbox"></span>
{{'navbar_manage_catalogs' | transl8}}
</a>
<a href="editUser">
<span class="glyphicon glyphicon-pencil"></span>
{{ 'navbar_edit_profile' | transl8 }}
</a>
<!--<a href="pwdreset"></... | Remove non working (for logged in users) )link to pwdreset. | Remove non working (for logged in users) )link to pwdreset.
| HTML | apache-2.0 | codarchlab/arachnefrontend,dainst/arachnefrontend,codarchlab/arachnefrontend,dainst/arachnefrontend | html | ## Code Before:
<li id="usermenu">
<a href="catalogs">
<span class="glyphicon glyphicon-inbox"></span>
{{'navbar_manage_catalogs' | transl8}}
</a>
<a href="editUser">
<span class="glyphicon glyphicon-pencil"></span>
{{ 'navbar_edit_profile' | transl8 }}
</a>
<a href="... |
02e7738a6c698f4f488e95f2932490b26f0b53a7 | src/js/components/TimeColumn.js | src/js/components/TimeColumn.js | import React, { Component, PropTypes } from 'react';
export default class TimeColumn extends Component {
// static propTypes = {
// times: PropTypes.array.isRequired
// };
render() {
const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
const minutes = ['00', '15', '30', '45... | import React, { Component, PropTypes } from 'react';
export default class TimeColumn extends Component {
// static propTypes = {
// times: PropTypes.array.isRequired
// };
render() {
const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
const minutes = ['00', '15', '30', '45']
const... | Update length of Times to go to 10pm | Update length of Times to go to 10pm
| JavaScript | mit | gregRV/myoutsidelands-frontend,gregRV/myoutsidelands-frontend | javascript | ## Code Before:
import React, { Component, PropTypes } from 'react';
export default class TimeColumn extends Component {
// static propTypes = {
// times: PropTypes.array.isRequired
// };
render() {
const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
const minutes = ['00',... |
9e805906ec1ba090bb6aebe630458ff817aaf995 | test/CXX/dcl.dcl/dcl.link/p7-2.cpp | test/CXX/dcl.dcl/dcl.link/p7-2.cpp | // RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s
extern "C" void f(void);
// CHECK: extern "C" void f()
extern "C" void v;
// CHECK: extern "C" void v
| // RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s
extern "C" int f(void);
// CHECK: extern "C" int f()
extern "C" int v;
// CHECK: extern "C" int v
| Replace void with int to make this a valid C++ file. | Replace void with int to make this a valid C++ file.
The test was passing because clang would still print the ast before exiting
with an error. Since that didn't seem to be the intent of the test, I change
the test instead of adding 'not' to the command line.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@18563... | C++ | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-cl... | c++ | ## Code Before:
// RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s
extern "C" void f(void);
// CHECK: extern "C" void f()
extern "C" void v;
// CHECK: extern "C" void v
## Instruction:
Replace void with int to make this a valid C++ file.
The test was passing because clang would still print the ast before exiting
... |
0bd6c1126a111084d69990ef25440ad6d858d936 | config/schedule.rb | config/schedule.rb |
@root_path = File.expand_path('../..', __FILE__)
set :output, "#{@root_path}/tmp/cron_log.log"
every :sunday, :at => '18:13pm' do
command "#{@root_path}/bin/deliciousletter"
end
|
@root_path = File.expand_path('../..', __FILE__)
set :output, "#{@root_path}/tmp/cron_log.log"
every :sunday, :at => '18:13pm' do
command "bundle exec #{@root_path}/bin/deliciousletter"
end
| Use bundler when calling wheneverized commands | Use bundler when calling wheneverized commands
| Ruby | mit | shakaman/DeliciousLetter | ruby | ## Code Before:
@root_path = File.expand_path('../..', __FILE__)
set :output, "#{@root_path}/tmp/cron_log.log"
every :sunday, :at => '18:13pm' do
command "#{@root_path}/bin/deliciousletter"
end
## Instruction:
Use bundler when calling wheneverized commands
## Code After:
@root_path = File.expand_path('../..', __... |
2b40c556a544c0ba8ac9bab53dd073623a80f7dd | src/rest/core.clj | src/rest/core.clj | (ns rest.core
(:require
[ring.util.response :as resp]
[compojure.handler :as handler]
[compojure.core :refer [routes]]
; Auth
[cemerick.friend :as friend]
(cemerick.friend [credentials :as credentials]
[workflows :as workflows])
[rest.auth.views :refer [unauthorized]]
... | (ns rest.core
(:require
[ring.util.response :as resp]
[compojure.handler :as handler]
[compojure.core :refer [routes]]
; Auth
[cemerick.friend :as friend]
(cemerick.friend [credentials :as credentials]
[workflows :as workflows])
[rest.auth.views :refer [unauthorized]]
... | Use /tasks as the landing URI after login | Use /tasks as the landing URI after login
| Clojure | apache-2.0 | Alotor/poc-clojure-rest | clojure | ## Code Before:
(ns rest.core
(:require
[ring.util.response :as resp]
[compojure.handler :as handler]
[compojure.core :refer [routes]]
; Auth
[cemerick.friend :as friend]
(cemerick.friend [credentials :as credentials]
[workflows :as workflows])
[rest.auth.views :refer ... |
b91d14fd6cc0d4be8611451813ee7ecbea85f713 | tests/cases/fourslash/declarationExpressions.ts | tests/cases/fourslash/declarationExpressions.ts | /// <reference path="fourslash.ts"/>
////class A {}
////const B = class C {
//// public x;
////};
////function D() {}
////const E = function F() {}
////console.log(function inner() {})
////String(function fun() { class cls { public prop; } }))
function navExact(name: string, kind: string) {
verify.nav... | /// <reference path="fourslash.ts"/>
////class A {}
////const B = class C {
//// public x;
////};
////function D() {}
////const E = function F() {}
////console.log(function() {}, class {}); // Expression with no name should have no effect.
////console.log(function inner() {});
////String(function fun() { ... | Test expressions with no name | Test expressions with no name
| TypeScript | apache-2.0 | erikmcc/TypeScript,minestarks/TypeScript,kitsonk/TypeScript,jwbay/TypeScript,RyanCavanaugh/TypeScript,DLehenbauer/TypeScript,thr0w/Thr0wScript,Eyas/TypeScript,alexeagle/TypeScript,nojvek/TypeScript,TukekeSoft/TypeScript,plantain-00/TypeScript,kpreisser/TypeScript,chuckjaz/TypeScript,SaschaNaz/TypeScript,DLehenbauer/Typ... | typescript | ## Code Before:
/// <reference path="fourslash.ts"/>
////class A {}
////const B = class C {
//// public x;
////};
////function D() {}
////const E = function F() {}
////console.log(function inner() {})
////String(function fun() { class cls { public prop; } }))
function navExact(name: string, kind: string) {
verify... |
3669f58975b30e41fab9839c1209d93cabdfc393 | src/Console/FacebookCommand.php | src/Console/FacebookCommand.php | <?php
namespace Stratedge\PassportFacebook\Console;
use Illuminate\Console\Command;
class FacebookCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'passport:facebook {client_id : ID of the client}';
/**
* Th... | <?php
namespace Stratedge\PassportFacebook\Console;
use Illuminate\Console\Command;
use Laravel\Passport\Client;
class FacebookCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'passport:facebook {client_id : ID of the... | Fix dependency injection in Facebook command | Fix dependency injection in Facebook command
| PHP | mit | stratedge/passport-facebook | php | ## Code Before:
<?php
namespace Stratedge\PassportFacebook\Console;
use Illuminate\Console\Command;
class FacebookCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'passport:facebook {client_id : ID of the client}';
... |
6aace8d82612e82a99c03aeaf1e8436800e35b28 | tests/server/signs-test.js | tests/server/signs-test.js | const app = require('../../tools/app.js')
const request = require('supertest')
const assert = require('assert')
describe('Sign functionality', () => {
let sessionID
before(() => {
return request(app)
.post('/resources/cgi-bin/scrollery-cgi.pl')
.send({
USER_NAME: 'test',
PASSWORD: '... | const app = require('../../tools/app.js')
const request = require('supertest')
const assert = require('assert')
// describe('Sign functionality', () => {
// let sessionID
// before(() => {
// return request(app)
// .post('/resources/cgi-bin/scrollery-cgi.pl')
// .send({
// USER_NAME: 'test'... | Comment out test that does nothing and fails. | Comment out test that does nothing and fails.
| JavaScript | mit | Scripta-Qumranica-Electronica/Scrollery-website,Scripta-Qumranica-Electronica/Scrollery-website,Scripta-Qumranica-Electronica/Scrollery-website,Scripta-Qumranica-Electronica/Scrollery-website | javascript | ## Code Before:
const app = require('../../tools/app.js')
const request = require('supertest')
const assert = require('assert')
describe('Sign functionality', () => {
let sessionID
before(() => {
return request(app)
.post('/resources/cgi-bin/scrollery-cgi.pl')
.send({
USER_NAME: 'test',
... |
817f340f4313553cc0c8a386cc4984d244a0bc2c | app/models/user.rb | app/models/user.rb | class User < ActiveRecord::Base
has_secure_password
has_many :photo_queues
has_many :photos, through: :photo_queues
validates :username, :email, presence: true
validates :username, :email, uniqueness: true
validates :username, format: { with: /\A[a-zA-Z0-9]+\z/,
message: "... | class User < ActiveRecord::Base
has_secure_password
has_many :photo_queues
has_many :photos, through: :photo_queues
validates :username, :email, presence: true
validates :username, :email, uniqueness: true
validates :username, format: { with: /\A[a-zA-Z0-9]+\z/,
message: "... | Remove unused code in User model | Remove unused code in User model
| Ruby | mit | snsavage/photovistas,snsavage/photovistas | ruby | ## Code Before:
class User < ActiveRecord::Base
has_secure_password
has_many :photo_queues
has_many :photos, through: :photo_queues
validates :username, :email, presence: true
validates :username, :email, uniqueness: true
validates :username, format: { with: /\A[a-zA-Z0-9]+\z/,
... |
035be40c5869ea9e65dd89c0ea16aafac2636a3e | frontend/src/lib/StatusCalculator.ts | frontend/src/lib/StatusCalculator.ts | import Status from 'models/Status';
import Step from 'models/Step';
import Feature from 'models/Feature';
type ScenarioDetails = {
backgroundSteps: Step[];
steps: Step[];
};
const STATUS_PRIORITY_ORDER = [Status.Failed, Status.Undefined, Status.Skipped, Status.Passed];
export const calculateFeatureStatus = (featu... | import Status from 'models/Status';
import Step from 'models/Step';
import Feature from 'models/Feature';
type ScenarioDetails = {
backgroundSteps: Step[];
steps: Step[];
};
const STATUS_PRIORITY_ORDER = [Status.Failed, Status.Undefined, Status.Skipped, Status.Passed];
export const calculateFeatureStatus = (featu... | Check for null backgroundSteps just in case. | Check for null backgroundSteps just in case.
| TypeScript | apache-2.0 | orionhealth/XBDD,orionhealth/XBDD,orionhealth/XBDD,orionhealth/XBDD,orionhealth/XBDD | typescript | ## Code Before:
import Status from 'models/Status';
import Step from 'models/Step';
import Feature from 'models/Feature';
type ScenarioDetails = {
backgroundSteps: Step[];
steps: Step[];
};
const STATUS_PRIORITY_ORDER = [Status.Failed, Status.Undefined, Status.Skipped, Status.Passed];
export const calculateFeatur... |
b6e61319ed50ce05623cd77bdde82bcf9c58b0bd | src/css/components/task-file-list.less | src/css/components/task-file-list.less | /* ==============
* Task File List (table)
* ==============
*/
.task-file-list {
tr {
.btn {
float: right;
opacity: 0;
margin-top: -@horizontal-spacing-unit;
margin-bottom: -@horizontal-spacing-unit;
}
&:hover {
.btn {
opacity: 1;
}
}
}
}
| /* ==============
* Task File List (table)
* ==============
*/
.task-file-list {
margin-top: @base-spacing-unit * 3;
tr {
.btn {
float: right;
opacity: 0;
margin-top: -@horizontal-spacing-unit;
margin-bottom: -@horizontal-spacing-unit;
}
&:hover {
.btn {
opaci... | Adjust task file list styles | Adjust task file list styles
| Less | apache-2.0 | cribalik/marathon-ui,cribalik/marathon-ui,mesosphere/marathon-ui,mesosphere/marathon-ui | less | ## Code Before:
/* ==============
* Task File List (table)
* ==============
*/
.task-file-list {
tr {
.btn {
float: right;
opacity: 0;
margin-top: -@horizontal-spacing-unit;
margin-bottom: -@horizontal-spacing-unit;
}
&:hover {
.btn {
opacity: 1;
}
}
}... |
36a4730d95742d6500198d8289aa083b3b2af3cb | master/assets/javascript/admin.min.js | master/assets/javascript/admin.min.js | $(document).ready(function(){
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href));
if (results==null){
return null;
}
else{
return results[1] || 0;
}
}
/*
* Defaults to Active Page
* Can be Ma... | $(document).ready(function(){
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href));
if (results==null){
return null;
}
else{
return results[1] || 0;
}
}
function getPageName(url) {
var index =... | Fix jQuery for selecting active tab | Fix jQuery for selecting active tab
| JavaScript | apache-2.0 | PufferPanel/PufferPanel,PufferPanel/PufferPanel,PufferPanel/PufferPanel,PufferPanel/PufferPanel | javascript | ## Code Before:
$(document).ready(function(){
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href));
if (results==null){
return null;
}
else{
return results[1] || 0;
}
}
/*
* Defaults to Active Pa... |
d2e75449e20050f12b1fd028ea8250c7dadbdebe | lib/door.js | lib/door.js | 'use strict'
let Gpio = require('onoff').Gpio
let EventEmitter = require('events').EventEmitter
class Door extends EventEmitter {
constructor(options) {
super()
EventEmitter.call(this)
this.options = options
this.isOpen = false
let pins = options.pins
let sensor = new Gpio(pins.sensor, 'in'... | 'use strict'
let Gpio = require('onoff').Gpio
let EventEmitter = require('events').EventEmitter
class Door extends EventEmitter {
constructor(options) {
super()
EventEmitter.call(this)
this.options = options
this.isOpen = false
let pins = options.pins
let sensor = new Gpio(pins.sensor, 'in'... | Make sure state is different | Make sure state is different
| JavaScript | mit | rosie-home-automation/garage_door_core | javascript | ## Code Before:
'use strict'
let Gpio = require('onoff').Gpio
let EventEmitter = require('events').EventEmitter
class Door extends EventEmitter {
constructor(options) {
super()
EventEmitter.call(this)
this.options = options
this.isOpen = false
let pins = options.pins
let sensor = new Gpio(p... |
ee87592bc8f7b340d0d81692a01b4b19dcb7e0cd | script.sh | script.sh |
wget https://releases.hashicorp.com/terraform/0.6.15/terraform_0.6.15_linux_amd64.zip -O /tmp/terraform.zip
mkdir /tmp/terraform
unzip /tmp/terraform.zip -d /tmp/terraform
chmod 755 -R /tmp/terraform
mv /tmp/terraform/* /usr/local/bin/
apt-get update
apt-get install -y unzip python-pip python-dev python-virtualenv
pip... |
wget https://releases.hashicorp.com/terraform/0.6.16/terraform_0.6.16_linux_amd64.zip -O /tmp/terraform.zip
mkdir /tmp/terraform
unzip /tmp/terraform.zip -d /tmp/terraform
chmod 755 -R /tmp/terraform
mv /tmp/terraform/* /usr/local/bin/
apt-get update
apt-get install -y unzip python-pip python-dev python-virtualenv lib... | Add package for Ansible and MoFo schedule - Install libffi to fix Ansible/MoFo schedule deps - Upgrade cffi to fix dep chain - Upgrade Terraform to 0.6.16 | Add package for Ansible and MoFo schedule
- Install libffi to fix Ansible/MoFo schedule deps
- Upgrade cffi to fix dep chain
- Upgrade Terraform to 0.6.16
| Shell | mpl-2.0 | flamingspaz/partinfra-jenkins | shell | ## Code Before:
wget https://releases.hashicorp.com/terraform/0.6.15/terraform_0.6.15_linux_amd64.zip -O /tmp/terraform.zip
mkdir /tmp/terraform
unzip /tmp/terraform.zip -d /tmp/terraform
chmod 755 -R /tmp/terraform
mv /tmp/terraform/* /usr/local/bin/
apt-get update
apt-get install -y unzip python-pip python-dev pytho... |
1218da61bce4270182f37dea508809d2d67c72d4 | spec/orm/active_record.rb | spec/orm/active_record.rb | ActiveRecord::Migration.verbose = false
ActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__))
| ActiveRecord::Migration.verbose = false
migration_path = File.expand_path('../../rails_app/db/migrate/', __FILE__)
if ActiveRecord.version.release < Gem::Version.new('5.2.0')
ActiveRecord::Migrator.migrate(migration_path)
else
ActiveRecord::MigrationContext.new(migration_path).migrate
end
| Fix specs on Rails 5.2 | Fix specs on Rails 5.2
| Ruby | mit | allenwq/devise-multi_email,allenwq/devise-multi_email,allenwq/devise-multi_email | ruby | ## Code Before:
ActiveRecord::Migration.verbose = false
ActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__))
## Instruction:
Fix specs on Rails 5.2
## Code After:
ActiveRecord::Migration.verbose = false
migration_path = File.expand_path('../../rails_app/db/migrate/', __FILE__)
i... |
fe4beb01974c8a57baaa957e7d1f4b5bd9ed3b63 | common/engine/keyboardprocessor/src/keyboard.cpp | common/engine/keyboardprocessor/src/keyboard.cpp | /*
Copyright: © 2018 SIL International.
Description: Internal keyboard class and adaptor class for the API.
Create Date: 2 Oct 2018
Authors: Tim Eves (TSE)
History: 7 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp
*/
#include "keyboard.hpp"
#include "json.hpp"
using namespace km::... | /*
Copyright: © 2018 SIL International.
Description: Internal keyboard class and adaptor class for the API.
Create Date: 2 Oct 2018
Authors: Tim Eves (TSE)
History: 7 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp
*/
#include "keyboard.hpp"
#include "json.hpp"
using namespace km::... | Make sure to convert path to utf8 for json output of folder name. | Make sure to convert path to utf8 for json output of folder name.
| C++ | apache-2.0 | tavultesoft/keymanweb,tavultesoft/keymanweb | c++ | ## Code Before:
/*
Copyright: © 2018 SIL International.
Description: Internal keyboard class and adaptor class for the API.
Create Date: 2 Oct 2018
Authors: Tim Eves (TSE)
History: 7 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp
*/
#include "keyboard.hpp"
#include "json.hpp"
usin... |
a720bf5023cf9fdab60ef668aa3a3f9371a0bcb0 | questions/styledbutton-20642553/main.cpp | questions/styledbutton-20642553/main.cpp |
int main(int argc, char *argv[])
{
QApplication a{argc, argv};
QWidget w;
QHBoxLayout layout{&w};
QPushButton button1{"Default"};
button1.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
layout.addWidget(&button1);
QPushButton button2{"Styled"};
button2.setSizePolicy(QSizePolicy::Ex... | // https://github.com/KubaO/stackoverflown/tree/master/questions/styledbutton-20642553
#include <QPushButton>
#include <QHBoxLayout>
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a{argc, argv};
QWidget w;
QHBoxLayout layout{&w};
QPushButton button1{"Default"};
button1.setSizePo... | Add github link, make code narrower. | Add github link, make code narrower.
| C++ | unlicense | KubaO/stackoverflown,KubaO/stackoverflown,KubaO/stackoverflown | c++ | ## Code Before:
int main(int argc, char *argv[])
{
QApplication a{argc, argv};
QWidget w;
QHBoxLayout layout{&w};
QPushButton button1{"Default"};
button1.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
layout.addWidget(&button1);
QPushButton button2{"Styled"};
button2.setSizePolicy... |
a61701fbece30628912034c48383a37ef2b93a3c | .travis.yml | .travis.yml | language: rust
script:
- cargo test --features="live_tests"
- cargo test --features="tls"
sudo: false
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
cargo doc &&
echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > targ... | language: rust
matrix:
include:
- rust: nightly
- rust: beta
- rust: stable
script:
- cargo test --features="live_tests"
- cargo test --features="tls"
sudo: false
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
[ $TRAVIS_RUST_VERSION = stable ] &&
cargo do... | Enable test matrix with all three rustc channels | ci/Travis: Enable test matrix with all three rustc channels
| YAML | mit | tempbottle/solicit,gwicke/solicit,mlalic/solicit,stepancheg/solicit | yaml | ## Code Before:
language: rust
script:
- cargo test --features="live_tests"
- cargo test --features="tls"
sudo: false
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
cargo doc &&
echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/ind... |
41b5a95a5c396c131d1426dd926e0a1a4beccc86 | mrp_workorder_sequence/models/mrp_production.py | mrp_workorder_sequence/models/mrp_production.py |
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_sequence = 1
for work in rec.workorder_ids:
work.sequence = current_sequence
current_sequence ... |
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_sequence = 1
for work in rec.workorder_ids:
work.sequence = current_sequence
current_sequence ... | Call method changed on v14 | [FIX] mrp_workorder_sequence: Call method changed on v14
| Python | agpl-3.0 | OCA/manufacture,OCA/manufacture | python | ## Code Before:
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_sequence = 1
for work in rec.workorder_ids:
work.sequence = current_sequence
c... |
6e12974b1099044dff95fb632307cd6c5500c411 | corehq/apps/builds/utils.py | corehq/apps/builds/utils.py | import re
from .models import CommCareBuild, CommCareBuildConfig
def get_all_versions(versions=None):
"""
Returns a list of all versions found in the database,
plus those in the optional list parameter.
"""
versions = versions or []
db = CommCareBuild.get_db()
results = db.view('builds/al... | import re
from .models import CommCareBuild, CommCareBuildConfig
def get_all_versions(versions):
"""
Returns a list of all versions found in the database,
plus those in the optional list parameter.
"""
db = CommCareBuild.get_db()
results = db.view('builds/all', group_level=1).all()
versio... | Remove optional arg that's now always used | Remove optional arg that's now always used
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | python | ## Code Before:
import re
from .models import CommCareBuild, CommCareBuildConfig
def get_all_versions(versions=None):
"""
Returns a list of all versions found in the database,
plus those in the optional list parameter.
"""
versions = versions or []
db = CommCareBuild.get_db()
results = db... |
06c4d38ee41ed5ce0b59e2670d8a952aeaffb97d | desktop/src/main/scala/org/talkingpuffin/Main.scala | desktop/src/main/scala/org/talkingpuffin/Main.scala | package org.talkingpuffin
import javax.swing.{UIManager, JFrame}
import mac.MacInit
import twitter.{Credentials, CredentialsRepository, AuthenticatedSession}
import ui.{TopFrame}
/**
* TalkingPuffin main object
*/
object Main {
val title = "TalkingPuffin"
def main(args: Array[String]): Unit = {
MacInit ... | package org.talkingpuffin
import javax.swing.{UIManager, JFrame}
import mac.MacInit
import twitter.{Credentials, CredentialsRepository, AuthenticatedSession}
import ui.{TopFrame}
/**
* TalkingPuffin main object
*/
object Main {
val title = "TalkingPuffin"
def main(args: Array[String]): Unit = {
MacInit ... | Rework Leif’s essential fix slightly to avoid calling CredentialsRepository.getAll twice. | Rework Leif’s essential fix slightly to avoid calling CredentialsRepository.getAll twice.
| Scala | mit | dcbriccetti/talking-puffin,dcbriccetti/talking-puffin | scala | ## Code Before:
package org.talkingpuffin
import javax.swing.{UIManager, JFrame}
import mac.MacInit
import twitter.{Credentials, CredentialsRepository, AuthenticatedSession}
import ui.{TopFrame}
/**
* TalkingPuffin main object
*/
object Main {
val title = "TalkingPuffin"
def main(args: Array[String]): Unit ... |
022bc01fb857c018cfba54825d8bac10181355fe | app/overrides/add_events_to_order_tabs.rb | app/overrides/add_events_to_order_tabs.rb | Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs",
:name => "add_events_to_order_tabs",
:insert_bottom => "[data-hook='admin_order_tabs']",
:text => %q{
<li<%== ' class="active"' if current == 'Events' %>>
... | Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs",
:name => "add_events_to_order_tabs",
:insert_bottom => "[data-hook='admin_order_tabs']",
:text => %q{
<li<%== ' class="active"' if current == 'Events' %>>
... | Use exclamation sign icon for order events tab | Use exclamation sign icon for order events tab
| Ruby | bsd-3-clause | spree/spree_pro_connector,spree/spree_hub_connector,spree/spree_pro_connector,spree/spree_hub_connector | ruby | ## Code Before:
Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs",
:name => "add_events_to_order_tabs",
:insert_bottom => "[data-hook='admin_order_tabs']",
:text => %q{
<li<%== ' class="active"' if current == 'Eve... |
bd2a007f4d46bdb690d3f160e21a0360e7cdeb3a | app.yaml | app.yaml | application: sympy-live-hrd
version: 31
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /static
static_dir: static
expiration: 1d
# if you're adding the shell to your own app, change this regex url to the URL
# endpoint where you want the shell to run, e.g. /shell . You'll also probably
# want... | application: sympy-live-hrd
version: 31
runtime: python27
threadsafe: true
api_version: 1
libraries:
- name: numpy
version: latest
handlers:
- url: /static
static_dir: static
expiration: 1d
# if you're adding the shell to your own app, change this regex url to the URL
# endpoint where you want the shell to ru... | Enable the external library numpy | Enable the external library numpy
This will let people import numpy in the SymPy Live shell.
| YAML | bsd-3-clause | wyom/sympy-live,wyom/sympy-live | yaml | ## Code Before:
application: sympy-live-hrd
version: 31
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /static
static_dir: static
expiration: 1d
# if you're adding the shell to your own app, change this regex url to the URL
# endpoint where you want the shell to run, e.g. /shell . You'll also... |
9b5b542bc807f7bd6370495946867efad29b541d | rust/hamming/src/lib.rs | rust/hamming/src/lib.rs | pub fn hamming_distance<'a, 'b>(a: &'a str, b: &'a str) -> Result<usize, &'b str> {
if a.len() != b.len() {
return Err("Length is not same");
}
let max = a.len();
let mut ai = a.chars();
let mut bi = b.chars();
let mut count = 0;
for _ in 0..max {
if ai.next() != bi.next(... | pub fn hamming_distance(a: &str, b: &str) -> Result<usize, &'static str> {
if a.len() != b.len() {
return Result::Err("Length is not same");
}
let count = a.chars()
.zip(b.chars())
.filter(|&(an, bn)| an != bn)
.count();
Result::Ok(count)
}
| Use a smart way stolen from others | Use a smart way stolen from others
I like functional programming style now
| Rust | bsd-2-clause | gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism | rust | ## Code Before:
pub fn hamming_distance<'a, 'b>(a: &'a str, b: &'a str) -> Result<usize, &'b str> {
if a.len() != b.len() {
return Err("Length is not same");
}
let max = a.len();
let mut ai = a.chars();
let mut bi = b.chars();
let mut count = 0;
for _ in 0..max {
if ai.ne... |
51dac8664492a264d403ae6b5fd00cf9710f6871 | get_reverse_geocode.js | get_reverse_geocode.js | const _ = require('lodash');
const GoogleMapsAPI = require('googlemaps');
const gmAPI = new GoogleMapsAPI();
module.exports = function(latitude, longitude, language = 'zh-TW') {
return new Promise(function(resolve, reject) {
gmAPI.reverseGeocode({
latlng: `${latitude},${longitude}`,
... | const _ = require('lodash');
const GoogleMapsAPI = require('googlemaps');
const gmAPI = new GoogleMapsAPI();
module.exports = function(latitude, longitude, language = 'zh-TW') {
return new Promise(function(resolve, reject) {
gmAPI.reverseGeocode({
latlng: `${latitude},${longitude}`,
... | Check the response body from google geocode api | Check the response body from google geocode api
| JavaScript | mit | dimotsai/pokemongo-notification | javascript | ## Code Before:
const _ = require('lodash');
const GoogleMapsAPI = require('googlemaps');
const gmAPI = new GoogleMapsAPI();
module.exports = function(latitude, longitude, language = 'zh-TW') {
return new Promise(function(resolve, reject) {
gmAPI.reverseGeocode({
latlng: `${latitude},${longitud... |
85bdd4fac9c463982ef05c93e70ff0bc29e3a754 | plugin.yml | plugin.yml | name: PvPTeleport
main: net.simpvp.PvPTeleport.PvPTeleport
version: 1.8
depend: [MultiWorld]
commands:
world:
description: Teleports player between overworld and pvp world.
usage: Error. Please report at https://github.com/C4K3/PvPTeleport
pvplist:
description: Lists all players in the pvp world.
us... | name: PvPTeleport
main: net.simpvp.PvPTeleport.PvPTeleport
version: 1.8
commands:
world:
description: Teleports player between overworld and pvp world.
usage: Error. Please report at https://github.com/C4K3/PvPTeleport
pvplist:
description: Lists all players in the pvp world.
usage: Error. Please re... | Remove bukkit dependency on Multiworld | Remove bukkit dependency on Multiworld
Multiple plugins can be used to provide multiworld support, and just
having a multiworld plugin is not a guarantee that the pvp world will be
loaded. Rather it should be a dynamic check whenever people use the
command.
| YAML | unlicense | C4K3/PvPTeleport | yaml | ## Code Before:
name: PvPTeleport
main: net.simpvp.PvPTeleport.PvPTeleport
version: 1.8
depend: [MultiWorld]
commands:
world:
description: Teleports player between overworld and pvp world.
usage: Error. Please report at https://github.com/C4K3/PvPTeleport
pvplist:
description: Lists all players in the p... |
4955cd290ec3b753e801cf7d38c15047a5eeed27 | .goreleaser.yml | .goreleaser.yml | env:
- GO111MODULE=on
- GOPROXY=https://gocenter.io
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm
- arm64
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
changelog:
sort: asc
filters:... | env:
- GO111MODULE=on
- GOPROXY=https://gocenter.io
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm
- arm64
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
changelog:
sort: asc
filters:... | Change package_name because it's not debian compatible | Change package_name because it's not debian compatible
| YAML | apache-2.0 | aleroyer/rsyslog_exporter | yaml | ## Code Before:
env:
- GO111MODULE=on
- GOPROXY=https://gocenter.io
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm
- arm64
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
changelog:
sort... |
7eb7c333a57ef7da6296bd52e2e4e6e03672c83f | zable.gemspec | zable.gemspec | Gem::Specification.new do |s|
s.name = "zable"
s.summary = "HTML tables"
s.description = "HTML searching, sorting and pagination made dead simple"
s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.version = "0.0.1"
s.authors = ["Derek Croft"]
s.add_runtime_dependency 'will_... | Gem::Specification.new do |s|
s.name = "zable"
s.summary = "HTML tables"
s.description = "HTML searching, sorting and pagination made dead simple"
s.files = Dir["lib/**/*", "app/**/*", "public/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.version = "0.0.1"
s.authors = ["Derek Croft"]
s.ad... | Add app and public to requires | Add app and public to requires
| Ruby | mit | derekcroft/zable,derekcroft/zable | ruby | ## Code Before:
Gem::Specification.new do |s|
s.name = "zable"
s.summary = "HTML tables"
s.description = "HTML searching, sorting and pagination made dead simple"
s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.version = "0.0.1"
s.authors = ["Derek Croft"]
s.add_runtime_dependenc... |
9f58a739e8704e1e2a5a33c4db01927b78f5597b | setup.cfg | setup.cfg | [build_sphinx]
config-dir = doc
source-dir = doc
build-dir = build/doc
builder = html
all_files = 1
| [build_sphinx]
config-dir = doc
source-dir = doc
build-dir = build/doc
builder = html
all_files = 1
[coverage:run]
branch = True
source = clique
| Add default coverage run options. | Add default coverage run options.
| INI | apache-2.0 | 4degrees/clique | ini | ## Code Before:
[build_sphinx]
config-dir = doc
source-dir = doc
build-dir = build/doc
builder = html
all_files = 1
## Instruction:
Add default coverage run options.
## Code After:
[build_sphinx]
config-dir = doc
source-dir = doc
build-dir = build/doc
builder = html
all_files = 1
[coverage:run]
branch = True
source ... |
ee2d4906fdf8685bb618d6cc4e04c4ffdf5d7c36 | .github/workflows/ci.yml | .github/workflows/ci.yml | name: ci
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]
toolchain: [stable, beta, nightly]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Install Rust
uses: actions-rs/toolchain@v1... | name: ci
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
toolchain: [stable, beta, nightly]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Install Rust
uses: actions-rs/too... | Disable Mac OS for now for the CI | Disable Mac OS for now for the CI
See https://github.com/rust-windowing/winit/pull/2078
| YAML | apache-2.0 | glium/glium | yaml | ## Code Before:
name: ci
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]
toolchain: [stable, beta, nightly]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Install Rust
uses: actions... |
93fc6b584d3313ac8ae16f7fe14833711476f522 | custom/10-circe.el | custom/10-circe.el | ;; IRC reconnect
(eval-after-load 'rcirc
'(defun-rcirc-command reconnect (arg)
"Reconnect the server process."
(interactive "i")
(unless process
(error "There's no process for this target"))
(let* ((server (car (process-contact process)))
(port (process-contact process :service))
(nick (rcirc-nick pro... | ;; IRC reconnect
(eval-after-load 'rcirc
'(defun-rcirc-command reconnect (arg)
"Reconnect the server process."
(interactive "i")
(unless process
(error "There's no process for this target"))
(let* ((server (car (process-contact process)))
(port (process-contact process :service))
(nick (rcirc-nick pro... | Add more to irc config | Add more to irc config
| Emacs Lisp | mit | map7/emacs-config,map7/emacs-config,map7/emacs-config | emacs-lisp | ## Code Before:
;; IRC reconnect
(eval-after-load 'rcirc
'(defun-rcirc-command reconnect (arg)
"Reconnect the server process."
(interactive "i")
(unless process
(error "There's no process for this target"))
(let* ((server (car (process-contact process)))
(port (process-contact process :service))
(nick... |
c1e5750140ebff37e306a373439570ab98610fdf | ansible/vagrant.yml | ansible/vagrant.yml | ---
- hosts: all
become: yes
become_method: sudo
gather_facts: no
pre_tasks:
- name: 'install python2'
raw: sudo apt-get -y install python-simplejson
tasks:
- name: update apt cache
apt: update_cache=yes
- name: install packages
apt: name={{ item }} state=present
... | ---
- hosts: all
become: yes
become_method: sudo
gather_facts: no
pre_tasks:
- name: 'install python2'
raw: sudo apt-get -y install python-simplejson
tasks:
- name: update apt cache
apt: update_cache=yes
- name: install packages
apt: name={{ item }} state=present
... | Add missing zip package in ansible inventory | Add missing zip package in ansible inventory
| YAML | mit | neuronalmotion/qtrpi,neuronalmotion/qtrpi | yaml | ## Code Before:
---
- hosts: all
become: yes
become_method: sudo
gather_facts: no
pre_tasks:
- name: 'install python2'
raw: sudo apt-get -y install python-simplejson
tasks:
- name: update apt cache
apt: update_cache=yes
- name: install packages
apt: name={{ item }} s... |
72c03b58a7542c590b4e27df3ecf126188b8131f | xml/Menu/speakcivi.xml | xml/Menu/speakcivi.xml | <?xml version="1.0"?>
<menu>
<item>
<path>civicrm/speakcivi</path>
<page_callback>CRM_Speakcivi_Page_Speakcivi</page_callback>
<title>Speakcivi</title>
<access_callback>1</access_callback>
<is_public>true</is_public>
</item>
<item>
<path>civicrm/speakcivi/settings</path>
<page_callback... | <?xml version="1.0"?>
<menu>
<item>
<path>civicrm/bsd</path>
<page_callback>CRM_Speakcivi_Page_Speakcivi</page_callback>
<title>Speakcivi</title>
<access_callback>1</access_callback>
<is_public>true</is_public>
</item>
<item>
<path>civicrm/bsd/settings</path>
<page_callback>CRM_Speakci... | Rename repository on SpeakCivi (1) | Rename repository on SpeakCivi (1)
| XML | agpl-3.0 | WeMoveEU/bsd_api,scardinius/speakcivi,scardinius/bsd_api | xml | ## Code Before:
<?xml version="1.0"?>
<menu>
<item>
<path>civicrm/speakcivi</path>
<page_callback>CRM_Speakcivi_Page_Speakcivi</page_callback>
<title>Speakcivi</title>
<access_callback>1</access_callback>
<is_public>true</is_public>
</item>
<item>
<path>civicrm/speakcivi/settings</path>
... |
e02b31012d0d87faa9ed6360e4e2e65589061c73 | core/src/main/java/com/dtolabs/rundeck/core/storage/StorageTimestamperConverter.java | core/src/main/java/com/dtolabs/rundeck/core/storage/StorageTimestamperConverter.java | package com.dtolabs.rundeck.core.storage;
import com.dtolabs.rundeck.plugins.storage.StorageConverterPlugin;
import org.rundeck.storage.api.HasInputStream;
import org.rundeck.storage.api.Path;
import java.util.Date;
/**
* StorageTimestamperConverter sets modification and creation timestamp metadata for updated/crea... | package com.dtolabs.rundeck.core.storage;
import com.dtolabs.rundeck.plugins.storage.StorageConverterPlugin;
import org.rundeck.storage.api.HasInputStream;
import org.rundeck.storage.api.Path;
import java.util.Date;
/**
* StorageTimestamperConverter sets modification and creation timestamp metadata for updated/crea... | Include a modification time on resource creation | Include a modification time on resource creation
| Java | apache-2.0 | damageboy/rundeck,variacode/rundeck,jgpacker/rundeck,paul-krohn/rundeck,variacode95/rundeck,tjordanchat/rundeck,variacode/rundeck,patcadelina/rundeck,jamieps/rundeck,jgpacker/rundeck,rophy/rundeck,jgpacker/rundeck,damageboy/rundeck,rophy/rundeck,variacode/rundeck,paul-krohn/rundeck,rundeck/rundeck,jamieps/rundeck,damag... | java | ## Code Before:
package com.dtolabs.rundeck.core.storage;
import com.dtolabs.rundeck.plugins.storage.StorageConverterPlugin;
import org.rundeck.storage.api.HasInputStream;
import org.rundeck.storage.api.Path;
import java.util.Date;
/**
* StorageTimestamperConverter sets modification and creation timestamp metadata ... |
a672fa6d385f2de391ea5bc5bbff09e6fc7673fc | templates/listing/dashboard_tag_list.hbs | templates/listing/dashboard_tag_list.hbs | <div class="list-group">
<a class="list-group-item {{#unless tag}}active{{/unless}}" href="/dashboards">All <span class="badge badge-primary pull-right"></span></a>
{{#each tags}}
<a class="list-group-item " data-ds-tag="{{name}}" href="/dashboards/tagged/{{name}}">
{{name}}
<span class="badge b... | <ul class="nav nav-pills nav-stacked">
<li class="{{#unless tag}}active{{/unless}}">
<a href="/dashboards">
All <span class="badge badge-primary pull-right"></span>
</a>
</li>
{{#each tags}}
<li data-ds-tag="{{name}}">
<a href="/dashboards/tagged/{{name}}">
{{name}}
<span class=... | Use nave for tag listing, it looks cleaner | Use nave for tag listing, it looks cleaner
| Handlebars | apache-2.0 | jmptrader/tessera,urbanairship/tessera,tessera-metrics/tessera,Slach/tessera,aalpern/tessera,tessera-metrics/tessera,section-io/tessera,jmptrader/tessera,tessera-metrics/tessera,filippog/tessera,Slach/tessera,jmptrader/tessera,Slach/tessera,filippog/tessera,jmptrader/tessera,Slach/tessera,section-io/tessera,urbanairshi... | handlebars | ## Code Before:
<div class="list-group">
<a class="list-group-item {{#unless tag}}active{{/unless}}" href="/dashboards">All <span class="badge badge-primary pull-right"></span></a>
{{#each tags}}
<a class="list-group-item " data-ds-tag="{{name}}" href="/dashboards/tagged/{{name}}">
{{name}}
<spa... |
3107ff61cca3c811ea2df2af3797f1a30a032021 | app/authorizers/inventory_authorizer.rb | app/authorizers/inventory_authorizer.rb | class InventoryAuthorizer < ApplicationAuthorizer
def creatable_by?(user)
true
end
def updatable_by?(user)
resource.facilitator?(user: user)
end
def readable_by?(user)
resource.member?(user: user)
end
def deletable_by?(user)
resource.facilitator?(user: user)
end
end
| class InventoryAuthorizer < ApplicationAuthorizer
def creatable_by?(user)
true
end
def updatable_by?(user)
resource.member?(user: user)
end
def readable_by?(user)
resource.member?(user: user)
end
def deletable_by?(user)
resource.facilitator?(user: user)
end
end
| Allow inventory members edit the inventory | Allow inventory members edit the inventory
| Ruby | mit | MobilityLabs/pdredesign-server,MobilityLabs/pdredesign-server,MobilityLabs/pdredesign-server,MobilityLabs/pdredesign-server | ruby | ## Code Before:
class InventoryAuthorizer < ApplicationAuthorizer
def creatable_by?(user)
true
end
def updatable_by?(user)
resource.facilitator?(user: user)
end
def readable_by?(user)
resource.member?(user: user)
end
def deletable_by?(user)
resource.facilitator?(user: user)
end
end
#... |
5284cde440e54c6a841efb6a5864afdf3a0aa78e | sdl2cubes/tests/test_mesh.c | sdl2cubes/tests/test_mesh.c |
int main(int argc, char *args[]) {
if(argc < 2) {
printf("test_mesh test-mesh-name.obj\n");
return 0;
}
// read mesh from standard input, push into obj parser
Mesh *mesh = meshReadOBJ(args[1]);
if(!mesh) {
return 0;
}
unsigned numFloats = meshGetNumFloats(mesh);
... |
int main(int argc, char *args[]) {
if(argc < 2) {
printf("usage: test_mesh filename.obj\n");
printf(" pass - (a dash character) as filename to read from stdin\n");
return 0;
}
Mesh *mesh;
// read mesh from standard input or file, push into obj parser
if(!strcmp("-", args[1]... | Make mesh loader actually read stdin | tests: Make mesh loader actually read stdin
| C | unlicense | teistiz/instanssi-samples | c | ## Code Before:
int main(int argc, char *args[]) {
if(argc < 2) {
printf("test_mesh test-mesh-name.obj\n");
return 0;
}
// read mesh from standard input, push into obj parser
Mesh *mesh = meshReadOBJ(args[1]);
if(!mesh) {
return 0;
}
unsigned numFloats = meshGetNumF... |
317926c18ac2e139d2018acd767d10b4f53428f3 | installer/installer_config/views.py | installer/installer_config/views.py | from django.shortcuts import render
from django.shortcuts import render_to_response
from django.views.generic import CreateView, UpdateView, DeleteView
from installer_config.models import EnvironmentProfile, UserChoice, Step
from installer_config.forms import EnvironmentForm
from django.core.urlresolvers import reverse... | from django.shortcuts import render
from django.shortcuts import render_to_response
from django.views.generic import CreateView, UpdateView, DeleteView
from installer_config.models import EnvironmentProfile, UserChoice, Step
from installer_config.forms import EnvironmentForm
from django.core.urlresolvers import reverse... | Remove unneeded post method from CreateEnvProfile view | Remove unneeded post method from CreateEnvProfile view
| Python | mit | ezPy-co/ezpy,alibulota/Package_Installer,ezPy-co/ezpy,alibulota/Package_Installer | python | ## Code Before:
from django.shortcuts import render
from django.shortcuts import render_to_response
from django.views.generic import CreateView, UpdateView, DeleteView
from installer_config.models import EnvironmentProfile, UserChoice, Step
from installer_config.forms import EnvironmentForm
from django.core.urlresolver... |
51a11b61451ab94d6606c66fffd5485c04c8f91f | Modules/TubeGraph/CMakeLists.txt | Modules/TubeGraph/CMakeLists.txt | MITK_CREATE_MODULE(
INCLUDE_DIRS PRIVATE src/Algorithms src/DataStructure src/Interactions src/Rendering src/IO
DEPENDS MitkSceneSerializationBase
PACKAGE_DEPENDS Boost
#WARNINGS_AS_ERRORS
)
#add_subdirectory(test)
| set(disable_module 0)
if(GCC_VERSION VERSION_GREATER 0 AND
GCC_VERSION VERSION_LESS 4.7)
# The Boost Graph library at least up to version 1.57 does not
# compile with gcc < 4.7 and -std=c++0x, see
# http://stackoverflow.com/questions/25395805/compile-error-with-boost-graph-1-56-0-and-g-4-6-4
set(disable_modu... | Disable TubeGraph if gcc < 4.7 is used. | COMP: Disable TubeGraph if gcc < 4.7 is used.
| Text | bsd-3-clause | iwegner/MITK,fmilano/mitk,fmilano/mitk,NifTK/MITK,iwegner/MITK,iwegner/MITK,iwegner/MITK,NifTK/MITK,fmilano/mitk,RabadanLab/MITKats,MITK/MITK,MITK/MITK,iwegner/MITK,fmilano/mitk,MITK/MITK,fmilano/mitk,RabadanLab/MITKats,MITK/MITK,MITK/MITK,RabadanLab/MITKats,MITK/MITK,RabadanLab/MITKats,RabadanLab/MITKats,NifTK/MITK,Ni... | text | ## Code Before:
MITK_CREATE_MODULE(
INCLUDE_DIRS PRIVATE src/Algorithms src/DataStructure src/Interactions src/Rendering src/IO
DEPENDS MitkSceneSerializationBase
PACKAGE_DEPENDS Boost
#WARNINGS_AS_ERRORS
)
#add_subdirectory(test)
## Instruction:
COMP: Disable TubeGraph if gcc < 4.7 is used.
## Code After:
s... |
3cb84621e985128099e973874d5795c9c62c5524 | src/Query/Capability/HasOrderBy.php | src/Query/Capability/HasOrderBy.php | <?php
declare(strict_types=1);
namespace Latitude\QueryBuilder\Query\Capability;
use Latitude\QueryBuilder\ExpressionInterface;
use Latitude\QueryBuilder\StatementInterface;
use function Latitude\QueryBuilder\listing;
use function Latitude\QueryBuilder\order;
trait HasOrderBy
{
/** @var StatementInterface[] */
... | <?php
declare(strict_types=1);
namespace Latitude\QueryBuilder\Query\Capability;
use Latitude\QueryBuilder\ExpressionInterface;
use Latitude\QueryBuilder\StatementInterface;
use function Latitude\QueryBuilder\listing;
use function Latitude\QueryBuilder\order;
trait HasOrderBy
{
/** @var StatementInterface[] */
... | Allow nullable order by to clear out the order | Allow nullable order by to clear out the order | PHP | mit | shadowhand/latitude | php | ## Code Before:
<?php
declare(strict_types=1);
namespace Latitude\QueryBuilder\Query\Capability;
use Latitude\QueryBuilder\ExpressionInterface;
use Latitude\QueryBuilder\StatementInterface;
use function Latitude\QueryBuilder\listing;
use function Latitude\QueryBuilder\order;
trait HasOrderBy
{
/** @var Statemen... |
ad5e3b01c32527c34291fe8f4a0240c8c4e14ede | lib/statsd/instrument/environment.rb | lib/statsd/instrument/environment.rb | require 'logger'
module StatsD::Instrument::Environment
extend self
def default_backend
case environment
when 'production'
StatsD::Instrument::Backends::UDPBackend.new(ENV['STATSD_ADDR'], ENV['STATSD_IMPLEMENTATION'])
when 'test'
StatsD::Instrument::Backends::NullBackend.new
else
... | require 'logger'
module StatsD::Instrument::Environment
extend self
def default_backend
case environment
when 'production'
StatsD::Instrument::Backends::UDPBackend.new(ENV['STATSD_ADDR'], ENV['STATSD_IMPLEMENTATION'])
when 'test'
StatsD::Instrument::Backends::NullBackend.new
else
... | Use StatsD.logger for logger backend | Use StatsD.logger for logger backend
| Ruby | mit | yakovenkodenis/statsd-instrument,Shopify/statsd-instrument | ruby | ## Code Before:
require 'logger'
module StatsD::Instrument::Environment
extend self
def default_backend
case environment
when 'production'
StatsD::Instrument::Backends::UDPBackend.new(ENV['STATSD_ADDR'], ENV['STATSD_IMPLEMENTATION'])
when 'test'
StatsD::Instrument::Backends::NullBackend.ne... |
cc83cdc16cf5e7ba911d5f1735b3a48c7ed83644 | binder/src/main/java/jp/satorufujiwara/binder/recycler/RecyclerBinder.java | binder/src/main/java/jp/satorufujiwara/binder/recycler/RecyclerBinder.java | package jp.satorufujiwara.binder.recycler;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import jp.satorufujiwara.binder.Binder;
import jp.satorufujiwara.binder.ViewType;
public abs... | package jp.satorufujiwara.binder.recycler;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import jp.satorufujiwara.binder.Binder;
import jp.satoruf... | Fix inflated view using parent view. | Fix inflated view using parent view.
| Java | apache-2.0 | MaTriXy/recyclerview-binder,satorufujiwara/recyclerview-binder | java | ## Code Before:
package jp.satorufujiwara.binder.recycler;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import jp.satorufujiwara.binder.Binder;
import jp.satorufujiwara.binder.ViewT... |
20dc917d01e7188bc1e31c95cf0af4c44e7ed7b6 | .travis.yml | .travis.yml | language: node_js
node_js:
- "0.11"
script: "bin/test.sh"
services:
- mongodb
after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"
| language: node_js
node_js:
- "0.11"
script: "bin/test.sh"
services:
- mongodb
| Remove failing coverage after script | Remove failing coverage after script
| YAML | mit | Wercajk/KaThinka,Wercajk/KaThinka | yaml | ## Code Before:
language: node_js
node_js:
- "0.11"
script: "bin/test.sh"
services:
- mongodb
after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"
## Instruction:
Remove failing coverage after script
## Code After:
language: node_js
node_js:
- "0.11"
script: "bin/test.sh"
service... |
4496a3c2dc452da375c940449fb7f3d8f08a5536 | src/Channels/FirebaseChannel.php | src/Channels/FirebaseChannel.php | <?php
namespace DouglasResende\FCM\Channels;
use DouglasResende\FCM\Messages\FirebaseMessage;
use Illuminate\Contracts\Config\Repository as Config;
use GuzzleHttp\Client;
use DouglasResende\FCM\Contracts\FirebaseNotification as Notification;
/**
* Class FirebaseChannel
* @package DouglasResende\FCM\Channels
*/
cl... | <?php
namespace DouglasResende\FCM\Channels;
use DouglasResende\FCM\Messages\FirebaseMessage;
use Illuminate\Contracts\Config\Repository as Config;
use GuzzleHttp\Client;
use Illuminate\Notifications\Notification;
/**
* Class FirebaseChannel
* @package DouglasResende\FCM\Channels
*/
class FirebaseChannel
{
/*... | Remove dependency on FirebaseNotification Contract | Remove dependency on FirebaseNotification Contract
| PHP | mit | douglasresendemaciel/fcm-laravel-notification | php | ## Code Before:
<?php
namespace DouglasResende\FCM\Channels;
use DouglasResende\FCM\Messages\FirebaseMessage;
use Illuminate\Contracts\Config\Repository as Config;
use GuzzleHttp\Client;
use DouglasResende\FCM\Contracts\FirebaseNotification as Notification;
/**
* Class FirebaseChannel
* @package DouglasResende\FCM... |
184d0753b1743eafa1044f99831d14297871a7ce | _config.yml | _config.yml | name: Arch Linux 臺灣社群
name_en: Arch Linux Taiwan Community
url: http://archlinux.tw
markdown: redcarpet
highlighter: 'pygments'
timezone: 'Asia/Taipei'
exclude: ['Gemfile', 'Gemfile.lock', 'AUTHORS', 'LICENSE', 'NOTICE', 'README.md', 'CHRONICLES.md', 'config.rb', 'build.sh', 'bootstrap']
rss_post_limit: 10
paginate: 5
... | name: Arch Linux 臺灣社群
name_en: Arch Linux Taiwan Community
url: http://archlinux.tw
markdown: redcarpet
highlighter: 'pygments'
timezone: 'Asia/Taipei'
exclude: ['Gemfile', 'Gemfile.lock', 'AUTHORS', 'LICENSE', 'NOTICE', 'README.md', 'CHRONICLES.md', 'config.rb', 'build.sh']
keep_files: ['bootstrap']
rss_post_limit: 10... | Fix Twitter Bootstrap submodule locating | Fix Twitter Bootstrap submodule locating
Signed-off-by: Huei-Horng Yo <2f041d5c1b2d2a0d1ca5b8fec69b348877f4bcd5@ghostsinthelab.org>
| YAML | mit | hiroshiyui/arch.linux.org.tw,xatier/arch.linux.org.tw,xatier/arch.linux.org.tw,xatier/arch.linux.org.tw,hiroshiyui/arch.linux.org.tw,linux-taiwan/arch.linux.org.tw,hiroshiyui/arch.linux.org.tw,linux-taiwan/arch.linux.org.tw,hiroshiyui/arch.linux.org.tw,linux-taiwan/arch.linux.org.tw,linux-taiwan/arch.linux.org.tw,xatie... | yaml | ## Code Before:
name: Arch Linux 臺灣社群
name_en: Arch Linux Taiwan Community
url: http://archlinux.tw
markdown: redcarpet
highlighter: 'pygments'
timezone: 'Asia/Taipei'
exclude: ['Gemfile', 'Gemfile.lock', 'AUTHORS', 'LICENSE', 'NOTICE', 'README.md', 'CHRONICLES.md', 'config.rb', 'build.sh', 'bootstrap']
rss_post_limit:... |
f16e910dd2a83f1b51153b8904be5f25a3884376 | lib/puppet/type/java_ks.rb | lib/puppet/type/java_ks.rb | module Puppet
newtype(:java_ks) do
@doc = 'Manages entries in a java keystore.'
ensurable do
newvalue(:present) do
provider.create
end
newvalue(:absent) do
provider.destroy
end
newvalue(:latest) do
if provider.exists?
provider.update
... | module Puppet
newtype(:java_ks) do
@doc = 'Manages entries in a java keystore.'
ensurable do
newvalue(:present) do
provider.create
end
newvalue(:absent) do
provider.destroy
end
newvalue(:latest) do
if provider.exists?
provider.update
... | Add autorequires for file resources. | Add autorequires for file resources.
This patch sets up dependancies on file resources for private_key,
certificate, and target's directory. Before this you had to do it
yourself.
| Ruby | apache-2.0 | synyx/puppet-keytool,arthurbarton/puppetlabs-java_ks | ruby | ## Code Before:
module Puppet
newtype(:java_ks) do
@doc = 'Manages entries in a java keystore.'
ensurable do
newvalue(:present) do
provider.create
end
newvalue(:absent) do
provider.destroy
end
newvalue(:latest) do
if provider.exists?
provider... |
8418da4072b1579a7b51c13468bc36d0c2335255 | src/condor_ckpt/machdep.h | src/condor_ckpt/machdep.h |
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(ULTRIX43)
extern "C" char *brk( char * );
extern "C" char *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(SUNOS41)
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*... |
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(ULTRIX43)
extern "C" char *brk( char * );
extern "C" char *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(SUNOS41)
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*... | Add definitions for AIX 3.2. | Add definitions for AIX 3.2.
| C | apache-2.0 | bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,m... | c | ## Code Before:
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(ULTRIX43)
extern "C" char *brk( char * );
extern "C" char *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(SUNOS41)
extern "C" int brk( void * );
extern "C" void *sbrk( int );
... |
40681d1553455e5ccd2b749808203dd39cf26452 | README.md | README.md |
This benchmark compares gRPC, Aeron and KryoNet.


Please see the
[latest results](https://github.com/benalexau/rpc-bench/blob/master/results/20161024/README.md).
| [](https://travis-ci.org/benalexau/rpc-bench)
[](http://www.apache.org/licenses/LICENSE-2.0.txt)
# RPC Benchmark
This benchmark compares gRPC, Aeron and KryoNet.


Please see the
[latest results](https://github.com/benalexau/rpc-bench/blob/master/results/20161024/README.md).
## Instruction:
Add badge for Travis CI status
## Code Af... |
4b782555199a6b797b610a84691d11042da0e7db | src/components/HomePage.js | src/components/HomePage.js | import React from 'react';
import { Link } from 'react-router';
import DatesPage from './DatesPage';
function weeks_between(date1, date2) {
const ONE_WEEK = 1000 * 60 * 60 * 24 * 7;
const date1_ms = date1.getTime();
const date2_ms = date2.getTime();
const difference_ms = Math.abs(date1_ms - date2_ms);
return... | import React from 'react';
import { Link } from 'react-router';
import DatesPage from './DatesPage';
import moment from 'moment';
const HomePage = () => {
const natka = moment([2016, 10, 3]);
const days = moment().diff(natka, 'days');
const weeks = moment().diff(natka, 'weeks');
const months = moment().diff(na... | Use moment lib to get diifs | Use moment lib to get diifs
| JavaScript | mit | gregorysl/date-minder,gregorysl/date-minder | javascript | ## Code Before:
import React from 'react';
import { Link } from 'react-router';
import DatesPage from './DatesPage';
function weeks_between(date1, date2) {
const ONE_WEEK = 1000 * 60 * 60 * 24 * 7;
const date1_ms = date1.getTime();
const date2_ms = date2.getTime();
const difference_ms = Math.abs(date1_ms - dat... |
5eb55023030d34902f4af9e063875554a349c945 | core/app/mailers/spree/carton_mailer.rb | core/app/mailers/spree/carton_mailer.rb |
module Spree
class CartonMailer < BaseMailer
# Send an email to customers to notify that an individual carton has been
# shipped. If a carton contains items from multiple orders then this will be
# called with that carton one time for each order.
#
# @param carton [Spree::Carton] the shipped cart... |
module Spree
class CartonMailer < BaseMailer
# Send an email to customers to notify that an individual carton has been
# shipped. If a carton contains items from multiple orders then this will be
# called with that carton one time for each order.
#
# @option options carton [Spree::Carton] the shi... | Fix yard doc of carton mailer | Fix yard doc of carton mailer
| Ruby | bsd-3-clause | pervino/solidus,pervino/solidus,pervino/solidus,pervino/solidus | ruby | ## Code Before:
module Spree
class CartonMailer < BaseMailer
# Send an email to customers to notify that an individual carton has been
# shipped. If a carton contains items from multiple orders then this will be
# called with that carton one time for each order.
#
# @param carton [Spree::Carton] ... |
198b12b992be72288fb63816e978b45d78680289 | src/test/resources/testng.xml | src/test/resources/testng.xml | <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="jenjin-io" verbose="1" >
<test name="io">
<packages>
<package name="com.jenjinstudios.io" />
</packages>
</test>
</suite>
| <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="jenjin-io" verbose="1" >
<test name="io">
<packages>
<package name="com.jenjinstudios.io" />
</packages>
</test>
<test name="serialization" verbose="1" >
<packages>
<package name="com.je... | Add test for serialization package | Add test for serialization package
| XML | mit | floralvikings/jenjin-io | xml | ## Code Before:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="jenjin-io" verbose="1" >
<test name="io">
<packages>
<package name="com.jenjinstudios.io" />
</packages>
</test>
</suite>
## Instruction:
Add test for serialization package
## Code After:
<!DO... |
19aaa32a846e66e50270963aa85ae80c0ed35b38 | roles/db/tasks/main.yml | roles/db/tasks/main.yml | ---
- name: Install PostgreSQL
apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed
with_items:
- postgresql
- postgresql-contrib
- libpq-dev
- python-psycopg2
tags: packages
- name: Ensure the PostgreSQL service is running
service: name=postgresql state=started enabled=yes... | ---
- name: Install PostgreSQL
apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed
with_items:
- postgresql
- postgresql-contrib
- libpq-dev
- python-psycopg2
tags: packages
- name: Ensure the PostgreSQL service is running
service: name=postgresql state=started enabled=yes... | Use UTF8 when creating the database. | Use UTF8 when creating the database. | YAML | mit | YPCrumble/ansible-django-stack,jcalazan/ansible-django-stack,jcalazan/ansible-django-stack,DavidCain/mitoc-ansible,DavidCain/mitoc-ansible,jcalazan/ansible-django-stack,YPCrumble/ansible-django-stack,DavidCain/mitoc-ansible,YPCrumble/ansible-django-stack | yaml | ## Code Before:
---
- name: Install PostgreSQL
apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed
with_items:
- postgresql
- postgresql-contrib
- libpq-dev
- python-psycopg2
tags: packages
- name: Ensure the PostgreSQL service is running
service: name=postgresql state=sta... |
fd94a11a0bb27f7686d175a6e620810ec8c2e236 | bin/generate/design.rb | bin/generate/design.rb | <% clock = aModuleInfo.clock_port.name rescue "YOUR_CLOCK_SIGNAL_HERE" %>
# Simulates the design under test for one clock cycle.
def DUT.cycle!
<%= clock %>.high!
advance_time
<%= clock %>.low!
advance_time
end
<% reset = aModuleInfo.reset_port.name rescue "YOUR_RESET_SIGNAL_HERE" %>
# Brings the design under... | <% clock = aModuleInfo.clock_port.name rescue "YOUR_CLOCK_SIGNAL_HERE" %>
# Simulates the design under test for one clock cycle.
def DUT.cycle!
<%= clock %>.t!
advance_time
<%= clock %>.f!
advance_time
end
<% reset = aModuleInfo.reset_port.name rescue "YOUR_RESET_SIGNAL_HERE" %>
# Brings the design under test... | Fix 'ArgumentError: "VpiHigh" is not a valid VPI property' | Fix 'ArgumentError: "VpiHigh" is not a valid VPI property'
This is done by replacing .high! and .low! wigh .t! and .f! in generated
*_design.rb files.
This only affects generation of files using "ruby-vpi generate".
| Ruby | isc | sunaku/ruby-vpi,sunaku/ruby-vpi | ruby | ## Code Before:
<% clock = aModuleInfo.clock_port.name rescue "YOUR_CLOCK_SIGNAL_HERE" %>
# Simulates the design under test for one clock cycle.
def DUT.cycle!
<%= clock %>.high!
advance_time
<%= clock %>.low!
advance_time
end
<% reset = aModuleInfo.reset_port.name rescue "YOUR_RESET_SIGNAL_HERE" %>
# Brings ... |
244934a7ac6f5a0f565fc68e5a265d79f955d901 | bin/custom_authenticate_ns_ldap.pl | bin/custom_authenticate_ns_ldap.pl | use strict;
# use warning;
# Custom modules
use lib "/exlibris/primo/p3_1/pds/custom/lib";
use lib "/exlibris/primo/p3_1/pds/custom/vendor/lib";
# PDS program modules
use lib "/exlibris/primo/p3_1/pds/program";
# NYU Libraries modules
use NYU::Libraries::Util qw(parse_conf);
use NYU::Libraries::PDS;
# PDS Core modul... | use strict;
# use warning;
# Custom modules
use lib "/exlibris/primo/p3_1/pds/custom/lib";
use lib "/exlibris/primo/p3_1/pds/custom/vendor/lib";
# PDS program modules
use lib "/exlibris/primo/p3_1/pds/program";
# NYU Libraries modules
use NYU::Libraries::Util qw(parse_conf);
use NYU::Libraries::PDS;
# PDS Core modul... | Update authentication and glue :rainbow: | Update authentication and glue :rainbow:
| Perl | mit | NYULibraries/pds-custom | perl | ## Code Before:
use strict;
# use warning;
# Custom modules
use lib "/exlibris/primo/p3_1/pds/custom/lib";
use lib "/exlibris/primo/p3_1/pds/custom/vendor/lib";
# PDS program modules
use lib "/exlibris/primo/p3_1/pds/program";
# NYU Libraries modules
use NYU::Libraries::Util qw(parse_conf);
use NYU::Libraries::PDS;
... |
6dcb33004c3775d707f362a6f2c8217c1d558f56 | kobin/server_adapters.py | kobin/server_adapters.py | from typing import Dict, Any
class ServerAdapter:
quiet = False
def __init__(self, host: str='127.0.0.1', port: int=8080, **options) -> None:
self.options = options
self.host = host
self.port = int(port)
def run(self, handler):
pass
def __repr__(self):
args =... | from typing import Dict, Any
class ServerAdapter:
quiet = False
def __init__(self, host: str='127.0.0.1', port: int=8080, **options) -> None:
self.options = options
self.host = host
self.port = int(port)
def run(self, handler):
pass
def __repr__(self):
args =... | Add a gunicorn server adpter | Add a gunicorn server adpter
| Python | mit | kobinpy/kobin,kobinpy/kobin,c-bata/kobin,c-bata/kobin | python | ## Code Before:
from typing import Dict, Any
class ServerAdapter:
quiet = False
def __init__(self, host: str='127.0.0.1', port: int=8080, **options) -> None:
self.options = options
self.host = host
self.port = int(port)
def run(self, handler):
pass
def __repr__(self)... |
a2adc67d83874a8a87282459c27f56c2e45bae29 | .travis.yml | .travis.yml | language: go
go:
- 1.x
# skip the install step. don't `go get` deps. only build with code in vendor/
install: true
notifications:
email: false
# install linter
before_script:
- go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint
script:
- golangci-lint run
- go test -v -race ./...
| sudo: false
language: go
go:
- 1.x
# skip the install step. don't `go get` deps. only build with code in vendor/
install: true
notifications:
email: false
# like script, but with set -e
before_script:
- go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint
# like before_script, but with se... | Use fast container-based test runner on Travis (sudo: false) | Use fast container-based test runner on Travis (sudo: false)
| YAML | mit | y0ssar1an/qq,y0ssar1an/qq,y0ssar1an/q | yaml | ## Code Before:
language: go
go:
- 1.x
# skip the install step. don't `go get` deps. only build with code in vendor/
install: true
notifications:
email: false
# install linter
before_script:
- go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint
script:
- golangci-lint run
- go test -v... |
e30e2cf3bc42e1f8b59048855909a7f341647dc7 | src/parsers/guides/axis-domain.js | src/parsers/guides/axis-domain.js | import {Top, Bottom} from './constants';
import guideMark from './guide-mark';
import {RuleMark} from '../marks/marktypes';
import {AxisDomainRole} from '../marks/roles';
import {addEncode} from '../encode/encode-util';
export default function(spec, config, userEncode, dataRef) {
var orient = spec.orient,
zero... | import {Top, Bottom} from './constants';
import guideMark from './guide-mark';
import {RuleMark} from '../marks/marktypes';
import {AxisDomainRole} from '../marks/roles';
import {addEncode} from '../encode/encode-util';
export default function(spec, config, userEncode, dataRef) {
var orient = spec.orient,
zero... | Fix axis domain config lookup. | Fix axis domain config lookup.
| JavaScript | bsd-3-clause | vega/vega-parser | javascript | ## Code Before:
import {Top, Bottom} from './constants';
import guideMark from './guide-mark';
import {RuleMark} from '../marks/marktypes';
import {AxisDomainRole} from '../marks/roles';
import {addEncode} from '../encode/encode-util';
export default function(spec, config, userEncode, dataRef) {
var orient = spec.or... |
0154da942d5d184f3fcd9294da2baee7d5702708 | manifests/haproxy.yml | manifests/haproxy.yml | ---
name: haproxy
addons:
- name: bpm
jobs:
- name: bpm
release: bpm
instance_groups:
- name: haproxy
azs: [z1]
instances: 1
vm_type: default
stemcell: default
networks: [{name: default}]
jobs:
- name: haproxy
release: haproxy
properties:
ha_proxy:
backend_port: ((haproxy-b... | ---
name: haproxy
addons:
- name: bpm
jobs:
- name: bpm
release: bpm
instance_groups:
- name: haproxy
azs: [z1]
instances: 1
vm_type: default
stemcell: default
networks: [{name: default}]
jobs:
- name: haproxy
release: haproxy
properties:
ha_proxy:
backend_port: ((haproxy-b... | Update manifest for compatibility with ci update-manifest script | Update manifest for compatibility with ci update-manifest script
| YAML | apache-2.0 | cloudfoundry-community/cf-haproxy-boshrelease,cloudfoundry-community/cf-haproxy-boshrelease,cloudfoundry-community/cf-haproxy-boshrelease | yaml | ## Code Before:
---
name: haproxy
addons:
- name: bpm
jobs:
- name: bpm
release: bpm
instance_groups:
- name: haproxy
azs: [z1]
instances: 1
vm_type: default
stemcell: default
networks: [{name: default}]
jobs:
- name: haproxy
release: haproxy
properties:
ha_proxy:
backend_p... |
4cda4a912c3206fd566ab62772be33713f690611 | README.md | README.md |
A tiny script to generate a printable HTML page (with QR codes) to back up
your TOTP secrets,
[SSSS](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) passphrase
shards, etc.
## Usage
bundle install
echo 'foo: 12345678901234567890' | gpg --encrypt > my-secrets.yml.gpg
bundle exec ./burn-after-read... |
A tiny script to generate a printable HTML page (with QR codes) to back up
your TOTP secrets,
[SSSS](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) passphrase
shards, etc.
## Usage
bundle install
# There are two options for encrypting the YAML data, choose one...
# 1. Recommended: a private ke... | Fix gpg instructions, offer choice of key-pair or symmetric | Fix gpg instructions, offer choice of key-pair or symmetric
| Markdown | mit | actblue/burn-after-reading,actblue/burn-after-reading | markdown | ## Code Before:
A tiny script to generate a printable HTML page (with QR codes) to back up
your TOTP secrets,
[SSSS](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) passphrase
shards, etc.
## Usage
bundle install
echo 'foo: 12345678901234567890' | gpg --encrypt > my-secrets.yml.gpg
bundle exec .... |
4164f34fa499bc94a3a5a938701d090c6ec695af | app/static/custom/js/custom.js | app/static/custom/js/custom.js | function applyChanges(data, url, showResult) {
var success = false;
$.ajax({
type : "POST",
url : url,
data : JSON.stringify(data),// now data come in this function
contentType : "application/json; charset=utf-8",
crossDomain : true,
dataType : "json",
success : function(data, status, jqXHR) {
... | function applyChanges(data, url, showResult) {
var success = false;
$.ajax({
type : "POST",
url : url,
data : JSON.stringify(data),// now data come in this function
contentType : "application/json; charset=utf-8",
crossDomain : true,
dataType : "json",
success : function(data, status, jqXHR) {
... | Add 'getDataTable' function from old template. | Add 'getDataTable' function from old template. | JavaScript | mit | ngoduykhanh/PowerDNS-Admin,ivanfilippov/PowerDNS-Admin,0x97/PowerDNS-Admin,CaptainQwark/PowerDNS-Admin,CaptainQwark/PowerDNS-Admin,ngoduykhanh/PowerDNS-Admin,0x97/PowerDNS-Admin,CaptainQwark/PowerDNS-Admin,ivanfilippov/PowerDNS-Admin,ngoduykhanh/PowerDNS-Admin,0x97/PowerDNS-Admin,ivanfilippov/PowerDNS-Admin,0x97/PowerD... | javascript | ## Code Before:
function applyChanges(data, url, showResult) {
var success = false;
$.ajax({
type : "POST",
url : url,
data : JSON.stringify(data),// now data come in this function
contentType : "application/json; charset=utf-8",
crossDomain : true,
dataType : "json",
success : function(data, status, jq... |
6a677478e754b1e042356763ef2a52aa5525d8de | rust/run-length-encoding/src/lib.rs | rust/run-length-encoding/src/lib.rs | pub fn encode(text: &str) -> String {
if text.is_empty() {
return "".to_string();
}
let mut last = text.chars().nth(0).unwrap();
let mut count = 0;
let mut result = String::new();
for c in text.chars() {
if c == last {
count += 1;
continue;
}
... | pub fn encode(text: &str) -> String {
let mut count = 0;
let mut result = String::new();
let mut iter = text.chars().peekable();
while let Some(c) = iter.next() {
count += 1;
if iter.peek() != Some(&c) {
if count > 1 {
result.push_str(&count.to_string());
... | Use peekable to simplify rust code for run-length-encoding | Use peekable to simplify rust code for run-length-encoding
It is a good solution to check next element by peek function
| Rust | bsd-2-clause | gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism | rust | ## Code Before:
pub fn encode(text: &str) -> String {
if text.is_empty() {
return "".to_string();
}
let mut last = text.chars().nth(0).unwrap();
let mut count = 0;
let mut result = String::new();
for c in text.chars() {
if c == last {
count += 1;
conti... |
55b1bc48bcc24f1c332369225387aa1ce3f0675b | .travis.yml | .travis.yml | language: ruby
cache: bundler
sudo: false
matrix:
fast_finish: true
include:
- rvm: 2.1
- rvm: 2.2
- rvm: 2.3.0
- rvm: 2.3.1
- rvm: 2.4.0
- rvm: jruby-head
allow_failures:
- rvm: jruby-head
- rvm: 2.4.0
notifications:
email: false
| language: ruby
cache: bundler
sudo: false
dist: trusty
matrix:
fast_finish: true
include:
- rvm: 2.1
- rvm: 2.2
- rvm: 2.3
- rvm: 2.4.0
- rvm: 2.4.1
- rvm: jruby-head
allow_failures:
- rvm: jruby-head
- rvm: 2.4.1
notifications:
email: false
| Tweak what versions we build and what OS | Tweak what versions we build and what OS
We now build on Trusty instead of Precise.
Limiting to just one version of 2.3, and major versions of 2.4.
| YAML | mit | Temikus/fog-google,Temikus/fog-google,fog/fog-google | yaml | ## Code Before:
language: ruby
cache: bundler
sudo: false
matrix:
fast_finish: true
include:
- rvm: 2.1
- rvm: 2.2
- rvm: 2.3.0
- rvm: 2.3.1
- rvm: 2.4.0
- rvm: jruby-head
allow_failures:
- rvm: jruby-head
- rvm: 2.4.0
notifications:
email: false
## Instruction:
Tweak what versi... |
9352d93d471b57bd68826c9b14981c9aacbf342a | src/main/java/com/elmakers/mine/bukkit/api/spell/Spell.java | src/main/java/com/elmakers/mine/bukkit/api/spell/Spell.java | package com.elmakers.mine.bukkit.api.spell;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
/**
* Represents a Spell that may be cast by a Mage.
*
* Each Spell is based on a SpellTemplate, which a... | package com.elmakers.mine.bukkit.api.spell;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
/**
* Represents a Spell that may be cast by a Mage.
*
* Each Spell is based on a SpellTemplate, which a... | Add a projectile hit handler, and allow for hit FX on projectiles | Add a projectile hit handler, and allow for hit FX on projectiles
| Java | mit | elBukkit/MagicPlugin,elBukkit/MagicAPI,elBukkit/MagicPlugin,elBukkit/MagicPlugin | java | ## Code Before:
package com.elmakers.mine.bukkit.api.spell;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
/**
* Represents a Spell that may be cast by a Mage.
*
* Each Spell is based on a SpellT... |
a9d5c56df011f10015601bffe5b8ed6bb984c70c | react-front/src/components/Attendee/Attendee.js | react-front/src/components/Attendee/Attendee.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Attendee.css';
import Clap from '../../components/Clap/Clap.container';
class Atendee extends Component {
constructor(props) {
super(props);
this.confettiClass = 'button button--large button--circle button--withChrome u... | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Attendee.css';
import Clap from '../../components/Clap/Clap.container';
class Atendee extends Component {
constructor(props) {
super(props);
this.confettiClass = 'button button--large button--circle button--withChrome u... | Add style to the attendee | Add style to the attendee
| JavaScript | mit | adaschevici/firebase-demo,adaschevici/firebase-demo,adaschevici/firebase-demo | javascript | ## Code Before:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Attendee.css';
import Clap from '../../components/Clap/Clap.container';
class Atendee extends Component {
constructor(props) {
super(props);
this.confettiClass = 'button button--large button--circle butt... |
15e1bef7e4d96c7f4bdd3c7261e59a083c0fe73f | spec/controllers/gestionnaires/passwords_controller_spec.rb | spec/controllers/gestionnaires/passwords_controller_spec.rb | require "spec_helper"
describe Gestionnaires::PasswordsController, type: :controller do
before do
@request.env["devise.mapping"] = Devise.mappings[:gestionnaire]
end
describe "update" do
context "unified login" do
let(:gestionnaire) { create(:gestionnaire, email: 'unique@plop.com', password: 'pass... | require "spec_helper"
describe Gestionnaires::PasswordsController, type: :controller do
before do
@request.env["devise.mapping"] = Devise.mappings[:gestionnaire]
end
describe "update" do
context "unified login" do
let(:gestionnaire) { create(:gestionnaire, email: 'unique@plop.com', password: 'pass... | Fix DEPRECATION WARNING for spec/controllers/gestionnaires/*.rb | Fix DEPRECATION WARNING for spec/controllers/gestionnaires/*.rb
| Ruby | agpl-3.0 | sgmap/tps,sgmap/tps,sgmap/tps | ruby | ## Code Before:
require "spec_helper"
describe Gestionnaires::PasswordsController, type: :controller do
before do
@request.env["devise.mapping"] = Devise.mappings[:gestionnaire]
end
describe "update" do
context "unified login" do
let(:gestionnaire) { create(:gestionnaire, email: 'unique@plop.com',... |
7f04090c574b48b0e1de4590017c7f9960c515fb | nova/policies/ips.py | nova/policies/ips.py |
from oslo_policy import policy
from nova.policies import base
POLICY_ROOT = 'os_compute_api:ips:%s'
ips_policies = [
policy.RuleDefault(
name=POLICY_ROOT % 'show',
check_str=base.RULE_ADMIN_OR_OWNER),
policy.RuleDefault(
name=POLICY_ROOT % 'index',
check_str=base.RULE_ADMIN... |
from nova.policies import base
POLICY_ROOT = 'os_compute_api:ips:%s'
ips_policies = [
base.create_rule_default(
POLICY_ROOT % 'show',
base.RULE_ADMIN_OR_OWNER,
"""Shows IP addresses details for a network label of a server.""",
[
{
'method': 'GET',
... | Add policy description for Servers IPs | Add policy description for Servers IPs
This commit adds policy doc for Servers IPs policies.
Partial implement blueprint policy-docs
Change-Id: I94a7c023dd97413d30f5be9edc313caeb47cb633
| Python | apache-2.0 | vmturbo/nova,mikalstill/nova,gooddata/openstack-nova,openstack/nova,Juniper/nova,rahulunair/nova,vmturbo/nova,rajalokan/nova,Juniper/nova,gooddata/openstack-nova,vmturbo/nova,rahulunair/nova,vmturbo/nova,mahak/nova,rahulunair/nova,rajalokan/nova,rajalokan/nova,mikalstill/nova,klmitch/nova,klmitch/nova,gooddata/openstac... | python | ## Code Before:
from oslo_policy import policy
from nova.policies import base
POLICY_ROOT = 'os_compute_api:ips:%s'
ips_policies = [
policy.RuleDefault(
name=POLICY_ROOT % 'show',
check_str=base.RULE_ADMIN_OR_OWNER),
policy.RuleDefault(
name=POLICY_ROOT % 'index',
check_str... |
88031f79636541b07c318a9ba10e802e74544a84 | js/lib/ltri-to-url.js | js/lib/ltri-to-url.js |
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = ltriToUrl;
}
/**
* Translate an LTRI to a URL
*
* @param {string} url LTRI or URL
* @return {string}
*/
function ltriToUrl(url) {
if (url.match(/^https?:\/\//)) return url;
var baseElement = document.quer... |
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = ltriToUrl;
}
/**
* Translate an LTRI to a URL
*
* @param {string} url LTRI or URL
* @return {string}
*/
function ltriToUrl(url) {
if (url.match(/^https?:\/\//)) return url;
var baseElement = document.quer... | Replace wordpress host with base_url from config | Replace wordpress host with base_url from config
| JavaScript | mit | legalthings/legalform-js,legalthings/legalform-js | javascript | ## Code Before:
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = ltriToUrl;
}
/**
* Translate an LTRI to a URL
*
* @param {string} url LTRI or URL
* @return {string}
*/
function ltriToUrl(url) {
if (url.match(/^https?:\/\//)) return url;
var baseElement... |
7200e71bd598642c6570babb1c8637a56fc1c9b8 | cmd/root.go | cmd/root.go | package cmd
import (
"log"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "mocli",
Short: "",
Long: `Mobingi API command line interface.`,
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
log.Println(err)
os.Exit(-1)
}
}
func init() {
rootCmd.PersistentFlags().String... | package cmd
import (
"log"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "mocli",
Short: "Mobingi API command line interface.",
Long: `Mobingi API command line interface.`,
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
log.Println(err)
os.Exit(-1)
}
}
func init() ... | Add short description for help. | Add short description for help.
| Go | mpl-2.0 | mobingi/mobingi-cli | go | ## Code Before:
package cmd
import (
"log"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "mocli",
Short: "",
Long: `Mobingi API command line interface.`,
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
log.Println(err)
os.Exit(-1)
}
}
func init() {
rootCmd.Persiste... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.