text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Add debug access to webpack modules. |
import { ErrorPage } from './ErrorPage';
import { LoginPage } from './LoginPage';
import { App } from './actions';
import { Root } from './router';
(function () {
if (!history.pushState) {
return; // see old.js
}
if (typeof __webpack_require__ !== 'undefined') {
Votr.webpackRequire = __webpack_require__;
}
... |
import { ErrorPage } from './ErrorPage';
import { LoginPage } from './LoginPage';
import { App } from './actions';
import { Root } from './router';
(function () {
if (!history.pushState) {
return; // see old.js
}
var query = Votr.settings.destination;
if (query !== undefined && (query == '' || query.substring(... |
Store empty queries in history | package fr.neamar.kiss.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
class DB extends SQLiteOpenHelper {
private final static int DB_VERSION = 1;
private final static String DB_NAME = "kiss.s3db";
public DB(Context con... | package fr.neamar.kiss.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
class DB extends SQLiteOpenHelper {
private final static int DB_VERSION = 1;
private final static String DB_NAME = "summon.s3db";
public DB(Context c... |
Revert "Use BlobBuilder (supported by Chrome for Android)"
This reverts commit 844d4d4410b9fd73cb49a01ab1c975c3bb84d017. | // Based on http://www.html5rocks.com/en/tutorials/workers/basics/
define(function() {
var URL = window.URL || window.webkitURL
if (URL && Worker && Blob) {
var blobUrl = URL.createObjectURL(new Blob(
['self.onmessage = function(event) { setInterval(function() { self.postMessage({}) }, event... | // Based on http://www.html5rocks.com/en/tutorials/workers/basics/
define(function() {
var URL = window.URL || window.webkitURL
// BlobBuilder is deprecated but Chrome for Android fails with an "Illegal constructor"
// instantiating the Blob directly
var BlobBuilder = window.BlobBuilder || window.WebKi... |
Add dot product function to math module. | // Math Library for ISAAC Physics.
// addVector function.
// Takes in two vectors, returns a new vector made by adding
// the inputs together. If the two input vectors don't have the same
// length, the first input vector will be returned.
function addVector (vectorA, vectorB) {
if(vectorA.length === vectorB.length) ... | // Math Library for ISAAC Physics.
// addVector function.
// Takes in two vectors, returns a new vector made by adding
// the inputs together. If the two input vectors don't have the same
// length, the first input vector will be returned.
function addVector (vectorA, vectorB) {
if(vectorA.length === vectorB.length) ... |
Fix dependencies with new package ldap3
Old package 'python3_ldap' is now called 'ldap3'. And 'python3_ldap' version 0.9.5.3 is no more available on pypi | from setuptools import setup, find_packages
from django_python3_ldap import __version__
version_str = ".".join(str(n) for n in __version__)
setup(
name = "django-python3-ldap",
version = version_str,
license = "BSD",
description = "Django LDAP user authentication backend for Python 3.",
... | from setuptools import setup, find_packages
from django_python3_ldap import __version__
version_str = ".".join(str(n) for n in __version__)
setup(
name = "django-python3-ldap",
version = version_str,
license = "BSD",
description = "Django LDAP user authentication backend for Python 3.",
... |
Chore: Remove unused function from the form deletion feature | $(function(){
let elements = $('.vich-image, .cropper');
if(!elements.length) return;
$.get('/wearejust/sonata_theme/delete_dialog', (html) => {
elements.each(function(index,item){
new imageRemove($(item), html);
});
});
});
class imageRemove {
constructor(item, html) {... | $(function(){
let elements = $('.vich-image, .cropper');
if(!elements.length) return;
$.get('/wearejust/sonata_theme/delete_dialog', (html) => {
elements.each(function(index,item){
new imageRemove($(item), html);
});
});
});
class imageRemove {
constructor(item, html) ... |
Add log to check sound | const player = require('play-sound')( opts = {} );
const Random = require('random-js');
const sounds_path = './node_modules/kaamelott-soundboard';
const sound_connect = [];
const sounds_start = [
'en_garde_espece_de_vieille_pute_degarnie',
'en_garde_ma_mignone',
];
const sounds_win = [
'putain_il_est_for... | const player = require('play-sound')( opts = {} );
const Random = require('random-js');
const sounds_path = './node_modules/kaamelott-soundboard';
const sound_connect = [];
const sounds_start = [
'en_garde_espece_de_vieille_pute_degarnie',
'en_garde_ma_mignone',
];
const sounds_win = [
'putain_il_est_for... |
Add -h and -v option | package main
import (
"fmt"
"os"
"os/exec"
"strings"
)
var version = "0.1.0"
var helpMsg = `NAME:
ext - An interface for command extensions
USAGE:
ext commands...
`
func main() {
if len(os.Args) < 2 {
fmt.Println(helpMsg)
os.Exit(1)
}
switch os.Args[1] {
case "-h", "--help":
fmt.Println(helpMs... | package main
import (
"fmt"
"os"
"os/exec"
"strings"
)
func main() {
extArgs, err := LookupExtCmd(os.Args[1:])
if err != nil {
fmt.Println(err)
}
extCmd := exec.Command(extArgs[0], extArgs[1:]...)
extCmd.Stdin = os.Stdin
extCmd.Stdout = os.Stdout
extCmd.Stderr = os.Stderr
extCmd.Run()
}
func LookupEx... |
Add GET request for page with form to add new emoticon | const express = require('express'),
router = express.Router({mergeParams: true}),
db = require('../models');
router.get('/', function(req, res, next) {
db.Emoticon.find({}).then(function(emoticons) {
res.render('emoticons/index', {emoticons});
}).catch(function(err) {
console.log(err);
})... | const express = require('express'),
router = express.Router({mergeParams: true}),
db = require('../models');
router.get('/', function(req, res, next) {
db.Emoticon.find({}).then(function(emoticons) {
res.render('emoticons/index', {emoticons});
}).catch(function(err) {
console.log(err);
})... |
Use new temporary access token for testing. | package com.uwetrottmann.getglue;
import junit.framework.TestCase;
import org.apache.oltu.oauth2.common.exception.OAuthProblemException;
import org.apache.oltu.oauth2.common.exception.OAuthSystemException;
import java.io.IOException;
public abstract class BaseTestCase extends TestCase {
protected static final S... | package com.uwetrottmann.getglue;
import junit.framework.TestCase;
import org.apache.oltu.oauth2.common.exception.OAuthProblemException;
import org.apache.oltu.oauth2.common.exception.OAuthSystemException;
import java.io.IOException;
public abstract class BaseTestCase extends TestCase {
protected static final S... |
Move template directory string to constant | <?php
namespace BNETDocs\Libraries;
use \BNETDocs\Libraries\Exceptions\TemplateNotFoundException;
use \BNETDocs\Libraries\Logger;
use \SplObjectStorage;
final class Template {
const TEMPLATE_DIR = "/templates";
protected $additional_css;
protected $context;
protected $opengraph;
protected $template;
p... | <?php
namespace BNETDocs\Libraries;
use \BNETDocs\Libraries\Exceptions\TemplateNotFoundException;
use \BNETDocs\Libraries\Logger;
use \SplObjectStorage;
final class Template {
protected $additional_css;
protected $context;
protected $opengraph;
protected $template;
public function __construct(&$context, ... |
Fix mob trigger infinite recursion | package com.elmakers.mine.bukkit.magic;
import javax.annotation.Nonnull;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
import com.elmakers.mine.bukkit.api.magic.Mage;
import com.elmakers.mine.bukkit.api.magic.MageController;
public class Mo... | package com.elmakers.mine.bukkit.magic;
import javax.annotation.Nonnull;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
import com.elmakers.mine.bukkit.api.magic.Mage;
import com.elmakers.mine.bukkit.api.magic.MageController;
public class Mo... |
Add an exception to throw when a document does have the expected structure | """Extensions of standard exceptions for PyWXSB events.
Yeah, I'd love this module to be named exceptions.py, but it can't
because the standard library has one of those, and we need to
reference it below.
"""
import exceptions
class PyWXSBException (exceptions.Exception):
"""Base class for exceptions that indica... | """Extensions of standard exceptions for PyWXSB events.
Yeah, I'd love this module to be named exceptions.py, but it can't
because the standard library has one of those, and we need to
reference it below.
"""
import exceptions
class PyWXSBException (exceptions.Exception):
"""Base class for exceptions that indica... |
Add a verbose error reporting on Travis | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... |
Update settings example for tpl directories and other stuff | import os
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '',
'USER': '',
'PASSWORD': '',... | DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '',
}
}
TIME_ZONE = 'Europe/Paris'
LANGUAGE_CO... |
Change github url in WebView | /*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | /*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... |
Complete test for heading IDs | var mock = require('./mock');
describe('Page', function() {
var book;
before(function() {
return mock.setupDefaultBook({
'heading.md': '# Hello\n\n## World'
})
.then(function(_book) {
book = _book;
return book.summary.load();
});
});
... | var mock = require('./mock');
describe('Page', function() {
var book;
before(function() {
return mock.setupDefaultBook({
'heading.md': '# Hello\n\n## World'
})
.then(function(_book) {
book = _book;
return book.summary.load();
});
});
... |
Adjust test_person_made_works to keep consistency. |
def test_team_has_members(fx_people, fx_teams):
assert fx_teams.clamp.members == {
fx_people.clamp_member_1,
fx_people.clamp_member_2,
fx_people.clamp_member_3,
fx_people.clamp_member_4
}
def test_person_has_awards(fx_people, fx_awards):
assert fx_people.peter_jackson.awa... |
def test_team_has_members(fx_people, fx_teams):
assert fx_teams.clamp.members == {
fx_people.clamp_member_1,
fx_people.clamp_member_2,
fx_people.clamp_member_3,
fx_people.clamp_member_4
}
def test_person_has_awards(fx_people, fx_awards):
assert fx_people.peter_jackson.awa... |
Use posixpath for paths in the cloud.
Fixes build break on Windows.
R=borenet@google.com
Review URL: https://codereview.chromium.org/18074002
git-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@9792 2bbb7eff-a529-9590-31e7-b0007b416f81 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Download the image files needed to run skimage tool. """
from build_step import BuildStep
from utils import gs_utils
from util... | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Download the image files needed to run skimage tool. """
from build_step import BuildStep
from utils import gs_utils
from util... |
Add not equals test for version function | import shutil
import tempfile
from os import path
import unittest
from libs.qpanel.upgrader import __first_line as firstline, get_current_version
class UpgradeTestClass(unittest.TestCase):
def setUp(self):
# Create a temporary directory
self.test_dir = tempfile.mkdtemp()
def tearDown(self):
... | import shutil
import tempfile
from os import path
import unittest
from libs.qpanel.upgrader import __first_line as firstline, get_current_version
class UpgradeTestClass(unittest.TestCase):
def setUp(self):
# Create a temporary directory
self.test_dir = tempfile.mkdtemp()
def tearDown(self):
... |
Update Speed 'out of range or invalid' error | var HyperdeckCore = require("./hyperdeck-core.js");
var Hyperdeck = function(ip) {
//Start by connecting to Hyperdeck via HypderdeckCore
var Core = new HyperdeckCore(ip);
Core.makeRequest("notify: remote: true");
Core.makeRequest("notify: transport: true");
Core.makeRequest("notify: slot: true");
Core.mak... | var HyperdeckCore = require("./hyperdeck-core.js");
var Hyperdeck = function(ip) {
//Start by connecting to Hyperdeck via HypderdeckCore
var Core = new HyperdeckCore(ip);
Core.makeRequest("notify: remote: true");
Core.makeRequest("notify: transport: true");
Core.makeRequest("notify: slot: true");
Core.mak... |
Remove toLowerCase so that the env var doesn't need to be set | const winston = require('winston');
const winstonError = require('winston-error');
const levels = {
levels: {
error: 0,
warn: 1,
info: 2,
verbose: 3,
debug: 4,
silly: 5,
database: 6,
},
};
const consoleLogger = new (winston.Logger)({ levels: levels.levels });
if (process.env.NODE_ENV ... | const winston = require('winston');
const winstonError = require('winston-error');
const levels = {
levels: {
error: 0,
warn: 1,
info: 2,
verbose: 3,
debug: 4,
silly: 5,
database: 6,
},
};
const consoleLogger = new (winston.Logger)({ levels: levels.levels });
if (process.env.NODE_ENV ... |
Add support for relativedelta timespecs
This uses the django-relativedeltafield formatter. We could copy the
formatter into here but that's not great either. This can be improved
once we have a pluggable JSON serializer. | import json
import datetime
from uuid import UUID
from django.http import HttpResponse
from .exceptions import BinderRequestError
try:
from dateutil.relativedelta import relativedelta
from relativedeltafield import format_relativedelta
except ImportError:
class relativedelta:
pass
class BinderJSONEncoder(json.... | import json
import datetime
from uuid import UUID
from django.http import HttpResponse
from .exceptions import BinderRequestError
class BinderJSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
# FIXME: was .isoformat(), but that omits the microseconds if they
# a... |
Make sure the fetch date is only returned as date if there's a date | <?php
namespace App\Model;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class Endpoint extends Model
{
protected $fillable = [
'url',
'name',
'description',
];
protected $casts = [
'system' => 'array',
];
protected $dates = [
'endpoint_fetch... | <?php
namespace App\Model;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class Endpoint extends Model
{
protected $fillable = [
'url',
'name',
'description',
];
protected $casts = [
'system' => 'array',
];
protected $dates = [
'endpoint_fetch... |
Update stable builders to pull from 1.4 branch
Review URL: https://codereview.chromium.org/295923003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@271609 0039d316-1c4b-4281-b951-d872f2087c98 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class Channel(object):
def __init__(self, name, branch, position, category_postfix, priority):
self.branch = branch
self.builder_postfix = '-' + na... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class Channel(object):
def __init__(self, name, branch, position, category_postfix, priority):
self.branch = branch
self.builder_postfix = '-' + na... |
Fix bug for template controller | <?php
namespace Butterfly\Plugin\TemplateRouter;
use Butterfly\Adapter\Twig\IRenderer;
use Butterfly\Component\DI\Container;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @author Marat Fakhertdinov <marat.fakhertdinov@gmail.com>
*/
class TemplateController
{
... | <?php
namespace Butterfly\Plugin\TemplateRouter;
use Butterfly\Adapter\Twig\IRenderer;
use Butterfly\Component\DI\Container;
use Symfony\Component\HttpFoundation\Request;
/**
* @author Marat Fakhertdinov <marat.fakhertdinov@gmail.com>
*/
class TemplateController
{
/**
* @var IRenderer
*/
protecte... |
Change "Development Status" to beta | from setuptools import setup
import numpy
from numpy.distutils.core import Extension
import railgun
from railgun import __author__, __version__, __license__
setup(
name='railgun',
version=__version__,
packages=['railgun'],
description=('ctypes utilities for faster and easier '
'simulat... | from setuptools import setup
import numpy
from numpy.distutils.core import Extension
import railgun
from railgun import __author__, __version__, __license__
setup(
name='railgun',
version=__version__,
packages=['railgun'],
description=('ctypes utilities for faster and easier '
'simulat... |
Allow querysets to be jsonified |
from datetime import timedelta
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.query import ValuesQuerySet
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
c... |
from django.core.serializers.json import DjangoJSONEncoder
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
class DjangoJSONEncoder2(DjangoJSONEncoder):
"""A json encoder to deal with th... |
TST: Update import location of TestPluginBase | # ----------------------------------------------------------------------------
# Copyright (c) 2016--, Ben Kaehler
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------... | # ----------------------------------------------------------------------------
# Copyright (c) 2016--, Ben Kaehler
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------... |
Improve alterItems: better null-check for the returned value |
const errors = require('@feathersjs/errors');
const getItems = require('./get-items');
const replaceItems = require('./replace-items');
module.exports = function (func) {
if (!func) {
func = () => {};
}
if (typeof func !== 'function') {
throw new errors.BadRequest('Function required. (alter)');
}
... |
const errors = require('@feathersjs/errors');
const getItems = require('./get-items');
const replaceItems = require('./replace-items');
module.exports = function (func) {
if (!func) {
func = () => {};
}
if (typeof func !== 'function') {
throw new errors.BadRequest('Function required. (alter)');
}
... |
Update README and fix typos | from setuptools import setup
setup(name='mordecai',
version='2.0.0a2',
description='Full text geoparsing and event geocoding',
url='http://github.com/openeventdata/mordecai/',
author='Andy Halterman',
author_email='ahalterman0@gmail.com',
license='MIT',
packages=['mordecai'],
... | from setuptools import setup
setup(name='mordecai',
version='2.0.0a1',
description='Full text geoparsing and event geocoding',
url='http://github.com/openeventdata/mordecai/',
author='Andy Halterman',
author_email='ahalterman0@gmail.com',
license='MIT',
packages=['mordecai'],
... |
Set accepted status when successfully published. | package main
import (
"net/http"
"log"
)
func Index(w http.ResponseWriter, r *http.Request) {
body := NewRequest(r).GetBody()
if config.FastPublish {
if len(body) > 0 {
servicesQueue.Publish(body)
}
return
}
service, err := NewService(body)
response := NewResponse(w)
if err != nil {
response.Bod... | package main
import (
"net/http"
"log"
)
func Index(w http.ResponseWriter, r *http.Request) {
body := NewRequest(r).GetBody()
if config.FastPublish {
if len(body) > 0 {
servicesQueue.Publish(body)
}
return
}
service, err := NewService(body)
response := NewResponse(w)
if err != nil {
response.Bod... |
Java: Move away from deprecated HTTP client API after libraries update. | package org.certificatetransparency.ctlog.comm;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import java... | package org.certificatetransparency.ctlog.comm;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;
import java.io.IOExceptio... |
[AC-9046] Add another constraint for the url | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = ["/people", "/people"]
mentor_url = "/directory"
mentor_refinement_url = "/directory/?refinementList%5Bhome_program_f... | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = "/people"
mentor_url = "/directory"
community_url = "/community"
SiteRedirectPage = apps.get_model('accelerator',... |
Fix coloring of earthquakes above sea level (blue -> red)
[#130153315] | export const TRANSITION_TIME = 750
export function depthToColor(depth) {
// Depth can be negative (earthquake above the sea level) - use 0-100km range color in this case.
const depthRange = Math.max(0, Math.floor(depth / 100))
switch(depthRange) {
case 0: // above the sea level or 0 - 100
return 0xFF0A... | export const TRANSITION_TIME = 750
export function depthToColor(depth) {
const depthRange = Math.floor(depth / 100)
switch(depthRange) {
case 0: // 0 - 100
return 0xFF0A00
case 1: // 100 - 200
return 0xFF7A00
case 2: // 200 - 300
return 0xFFF700
case 3: // 300 - 400
return 0... |
Add classifier for Python 3.3 | #!/usr/bin/env python3
import sys
from distutils.core import setup
setup(
name='pathlib',
version=open('VERSION.txt').read().strip(),
py_modules=['pathlib'],
license='MIT License',
description='Object-oriented filesystem paths',
long_description=open('README.txt').read(),
author='Antoine P... | #!/usr/bin/env python3
import sys
from distutils.core import setup
setup(
name='pathlib',
version=open('VERSION.txt').read().strip(),
py_modules=['pathlib'],
license='MIT License',
description='Object-oriented filesystem paths',
long_description=open('README.txt').read(),
author='Antoine P... |
Disable row rendering for embedded field sets. | <?php
class FieldSetRenderer extends Renderer
{
use RenderableFields;
public function __construct($field, $parent = null, $params = array())
{
parent::__construct($field, $parent, $params);
$this->setParam("row", false);
}
public function render()
{
return $this->getPara... | <?php
class FieldSetRenderer extends Renderer
{
use RenderableFields;
public function render()
{
return $this->getParam("tag") ?
$this->tag(
"fieldset",
$this->renderLegend() .
$this->renderErrors($this) .
$this->renderFields(),
$this->fieldParams()
) :
... |
Return sample categories from API | <?php
namespace Villermen\Soundboard\Model;
use \JsonSerializable;
class Sample implements JsonSerializable
{
protected $file;
protected $name;
protected $mtime;
protected $categories;
public function __construct($file, $mtime)
{
$this->file = $file;
$this->mtime = $mtime;
// Conjure a name out of the ... | <?php
namespace Villermen\Soundboard\Model;
use \JsonSerializable;
class Sample implements JsonSerializable
{
protected $file;
protected $name;
protected $mtime;
public function __construct($file, $mtime)
{
$this->file = $file;
$this->mtime = $mtime;
// Conjure a name out of the filename.
$name = subs... |
[r] Make must_fail fully compatible with nose
Originally, whenever you run a must_fail test alone and directly
with nose, you would get this error message:
'ValueError: no such test method in <test reference>: test_decorated' | from robber import BadExpectation
from robber.matchers.base import Base
expectation_count = 0
fail_count = 0
old_match = Base.match
def new_match(self):
global expectation_count
expectation_count += 1
try:
old_match(self)
except BadExpectation:
global fail_count
fail_count +... | from robber import BadExpectation
from robber.matchers.base import Base
expectation_count = 0
fail_count = 0
old_match = Base.match
def new_match(self):
global expectation_count
expectation_count += 1
try:
old_match(self)
except BadExpectation:
global fail_count
fail_count +... |
Debug update continued:
Removed the cost of mesh position to ints. | package net.piemaster.jario.systems;
import net.piemaster.jario.components.CollisionMesh;
import net.piemaster.jario.components.Transform;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.EntityProcessingSystem;
public class CollisionMeshSystem extends EntityProcessingSystem... | package net.piemaster.jario.systems;
import net.piemaster.jario.components.CollisionMesh;
import net.piemaster.jario.components.Transform;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.EntityProcessingSystem;
public class CollisionMeshSystem extends EntityProcessingSystem... |
Use proper clock if possible | # vim:fileencoding=utf-8:noet
from functools import wraps
try:
# Python>=3.3, the only valid clock source for this job
from time import monotonic as time
except ImportError:
# System time, is affected by clock updates.
from time import time
def default_cache_key(**kwargs):
return frozenset(kwargs.items())
cla... | # vim:fileencoding=utf-8:noet
from functools import wraps
import time
def default_cache_key(**kwargs):
return frozenset(kwargs.items())
class memoize(object):
'''Memoization decorator with timeout.'''
def __init__(self, timeout, cache_key=default_cache_key, cache_reg_func=None):
self.timeout = timeout
self.... |
Change to use a stream() rather than parallelStream() | package uk.sky.cirrus;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Host;
import uk.sky.cirrus.exception.ClusterUnhealthyException;
import java.net.InetAddress;
import java.util.List;
import java.util.stream.Collectors;
class ClusterHealth {
private final Cluster cluster;
Cluste... | package uk.sky.cirrus;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Host;
import uk.sky.cirrus.exception.ClusterUnhealthyException;
import java.net.InetAddress;
import java.util.List;
import java.util.stream.Collectors;
class ClusterHealth {
private final Cluster cluster;
Cluste... |
Update package version to v1.1.0 | from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='django-cra-helper',
version='1.1.0',
description='The missing... | from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='django-cra-helper',
version='1.0.2',
description='The missing... |
Fix lint errors in Object.get | import * as changeCase from 'change-case'
import pluralize from 'pluralize'
export default {
...changeCase,
pluralize,
resourceize: function(string) {
return pluralize(changeCase.camel(string))
}
}
Object.map = function(source, func) {
return Object.keys(source).map(key => {
let value = source[key]
return ... | import * as changeCase from 'change-case'
import pluralize from 'pluralize'
export default {
...changeCase,
pluralize,
resourceize: function(string) {
return pluralize(changeCase.camel(string))
}
}
Object.map = function(source, func) {
return Object.keys(source).map(key => {
let value = source[key]
return ... |
Fix code formatting for PSR-2 compatibility | <?php declare(strict_types=1);
namespace Zubr;
/**
* (PHP 5 >=5.5.0)<br/>
* Return the values from a single column in the input array
* @link http://www.php.net/manual/en/function.array-column.php
* @param array $array <p>A multi-dimensional array (record set) from which to pull a column of values.</p>
* @par... | <?php declare(strict_types=1);
namespace Zubr;
/**
* (PHP 5 >=5.5.0)<br/>
* Return the values from a single column in the input array
* @link http://www.php.net/manual/en/function.array-column.php
* @param array $array <p>A multi-dimensional array (record set) from which to pull a column of values.</p>
* @par... |
Fix pouchdb middleware to handle conflict and retry to update a document | import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
const applyChanges = async (nextState, prevState) => {
try {
const storedDocument = await getDocument(prevState.p... | import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
const storage = store => next => async action => {
const prevState = store.getState();
const result = next(action);... |
Update regular expression for registration code | /* globals Stripe */
import Ember from 'ember';
var $ = Ember.$;
function registrationDataFromUrl(url) {
var matches = url.match(/\?code=([a-z0-9]+)/);
if (matches && matches.length === 2) {
return {registration_code: matches[1]};
} else {
return {};
}
}
function initializeStripe(key) {
Stripe.setP... | /* globals Stripe */
import Ember from 'ember';
var $ = Ember.$;
function registrationDataFromUrl(url) {
var matches = url.match(/\?code=(\d+)/);
if (matches && matches.length === 2) {
return {registration_code: matches[1]};
} else {
return {};
}
}
function initializeStripe(key) {
Stripe.setPublish... |
Use utils to get config and add shebang | #!/usr/bin/env node
var request = require('request');
var utils = require('./utils');
var instanceConfig = utils.getConfig().getActiveInstanceConfig();
function Action(actionPath, payload) {
var actionPathBase = [
'http://',
instanceConfig.username + ':',
instanceConfig.password + '@',
instanceConfig.host +... | var instanceConfig = require('./config').getActiveInstanceConfig();
var request = require('request');
var utils = require('./utils');
function Action(actionPath, payload) {
var actionPathBase = [
'http://',
instanceConfig.username + ':',
instanceConfig.password + '@',
instanceConfig.host + ':',
instanceConf... |
Add encrypt key list item jsx | 'use strict';
import React, { Component } from 'react';
import ReactCSS from 'reactcss';
import { User } from '../common/index';
import colors from '../../styles/variables/colors';
import { spacing, sizing } from '../../styles/variables/utils';
class EncryptKeyListItem extends Component {
classes() {
return {... | 'use strict';
import React, { Component } from 'react';
import ReactCSS from 'reactcss';
import { User } from '../common/index';
import colors from '../../styles/variables/colors';
import { spacing, sizing } from '../../styles/variables/utils';
class EncryptKeyListItem extends Component {
classes() {
return {... |
Fix the doc-explorer-back button overflow. | <style>
#content.pw-content{
padding: 0px;
}
#graphiql {
height: 80vh;
border-right: 1px solid #efefef;
}
#graphiql * {
box-sizing: content-box;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
line-height: 1rem;
}
#graphiql .doc-explorer-title{
overflow: hidd... | <style>
#content.pw-content{
padding: 0px;
}
#content .pw-container, #content .container{
width: 100%;
max-width: none;
}
#graphiql {
height: 100vh;
}
#graphiql * {
box-sizing: content-box;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
line-height: 1rem;
... |
Add some error handling in case there's no connection to the bit.ly servers. | /**
* bit.ly access library code.
*/
var Shortener = new JS.Singleton('Shortener', {
initialize: function() {
this.extend({
CLIENT: BitlyClient || null,
NAMESPACE: BitlyCB || null
});
},
shorten: function() {
var uri, callback;
if (typeof arguments[0] == 'string') {
u... | /**
* bit.ly access library code.
*/
var Shortener = new JS.Singleton('Shortener', {
shorten: function() {
var uri, callback;
if (typeof arguments[0] == 'string') {
uri = arguments[0];
callback = arguments[1];
} else {
uri = window.location.href;
callback = arguments[0];
... |
Fix price calculator class names | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.objects.filter(... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.objects.filter(... |
web: Fix static path for production bundle | var path = require('path'),
webpack = require('webpack');
module.exports = {
cache: true,
entry: './src/main.js',
output: {
path: path.join(__dirname, "build"),
filename: "bundle.js",
publicPath: "/static/"
},
module: {
loaders: [
{test: /\.js$/, loader: 'jsx-loader?harmony'},
... | var path = require('path'),
webpack = require('webpack');
module.exports = {
cache: true,
entry: './src/main.js',
output: {
path: path.join(__dirname, "build"),
filename: "bundle.js"
},
module: {
loaders: [
{test: /\.js$/, loader: 'jsx-loader?harmony'},
{test: /\.css$/, loader: 's... |
Add missing module event type hint | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Z... | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Z... |
Add gRPC specific code to acceptance test | // +build acceptance
package app
import (
"os"
"time"
"github.com/DATA-DOG/godog"
"github.com/goph/stdlib/net"
"google.golang.org/grpc"
)
func init() {
runs = append(runs, func() int {
format := "progress"
for _, arg := range os.Args[1:] {
// go test transforms -v option
if arg == "-test.v=true" {
... | // +build acceptance
package app
import (
"os"
"time"
"github.com/DATA-DOG/godog"
)
func init() {
runs = append(runs, func() int {
format := "progress"
for _, arg := range os.Args[1:] {
// go test transforms -v option
if arg == "-test.v=true" {
format = "pretty"
break
}
}
return godog.... |
Disable Harmony Symbols & Proxies, they're completely broken | 'use strict';
var findup = require('findup-sync');
var spawnSync = require('child_process').spawnSync;
var gruntPath = findup('node_modules/{.,}bin/grunt', {cwd: __dirname});
process.title = 'grunth';
var harmonyFlags = [
'--harmony_scoping',
// '--harmony_modules', // We have `require` and ES6 modules are st... | 'use strict';
var findup = require('findup-sync');
var spawnSync = require('child_process').spawnSync;
var gruntPath = findup('node_modules/{.,}bin/grunt', {cwd: __dirname});
process.title = 'grunth';
var harmonyFlags = [
'--harmony_scoping',
// '--harmony_modules', // We have `require` and ES6 modules are st... |
Use the default buffer instead of current_buffer. | from prompt_toolkit.layout.toolbars import Toolbar
from prompt_toolkit.layout.utils import TokenList
from pygments.token import Token
class PGToolbar(Toolbar):
def __init__(self, token=None):
token = token or Token.Toolbar.Status
super(self.__class__, self).__init__(token=token)
def get_tokens... | from prompt_toolkit.layout.toolbars import Toolbar
from prompt_toolkit.layout.utils import TokenList
from pygments.token import Token
class PGToolbar(Toolbar):
def __init__(self, token=None):
token = token or Token.Toolbar.Status
super(self.__class__, self).__init__(token=token)
def get_tokens... |
Use email variable name where appropriate | from flask import Flask, jsonify, request
from requests import codes
app = Flask(__name__)
@app.route('/login', methods=['POST'])
def login():
email = request.form['email']
password = request.form['password']
response_content = {'email': email, 'password': password}
return jsonify(response_content), c... | from flask import Flask, jsonify, request
from requests import codes
app = Flask(__name__)
@app.route('/login', methods=['POST'])
def login():
username = request.form['email']
password = request.form['password']
response_content = {'email': username, 'password': password}
return jsonify(response_conte... |
Add a "New()" function that allows for custom conf
Signed-off-by: Peter Olds <f516c8e349fcaee4098dbef1ab3f4b8dc00e321e@kyanicorp.com> | package logger
import (
"os"
"strconv"
"github.com/Sirupsen/logrus"
"github.com/polds/logrus/hooks/papertrail"
)
var __l *logrus.Logger
type Config struct {
Appname string
Host string
Port int
*logrus.Logger
}
// Logger returns an instance of
// a logger or creates a new one.
func Logger() *logrus.L... | package logger
import (
"os"
"strconv"
"github.com/Sirupsen/logrus"
"github.com/polds/logrus/hooks/papertrail"
)
var __l *logrus.Logger
// Logger returns an instance of
// a logger or creates a new one.
func Logger() *logrus.Logger {
if __l == nil {
__l = NewLogger()
}
return __l
}
// NewLogger creates a... |
Update test (trying to fix Travis error) | var fs = require('fs')
var assert = require('assert')
var rmrf = require('rimraf')
var Writer = require('../src/writer')
describe('Writer', function() {
this.timeout(10000)
var tempPath = __dirname + '/../tmp'
var filePath = tempPath + '/../tmp/test.txt'
beforeEach(function() {
rmrf.sync(tempPath)
f... | var fs = require('fs')
var assert = require('assert')
var rmrf = require('rimraf')
var Writer = require('../src/writer')
describe('Writer', function() {
this.timeout(5000)
var tempPath = __dirname + '/../tmp'
var filePath = tempPath + '/../tmp/test.txt'
beforeEach(function() {
rmrf.sync(tempPath)
fs... |
Support configuring style include paths | const browser = require('browser-sync');
const config = require('../../config');
const gulp = require('gulp');
const handleError = require('../../utilities/handleError');
const path = require('path');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
/**
... | const browser = require('browser-sync');
const config = require('../../config');
const gulp = require('gulp');
const handleError = require('../../utilities/handleError');
const path = require('path');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
/**
... |
Remove version number from Python shebang.
On special request from someone trying to purge python2.2 from code indexed
internally at Google.
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@7071 0039d316-1c4b-4281-b951-d872f2087c98 | #!/usr/bin/python
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import md5
"""64-bit fingerprint support for strings.
Usage:
from extern import FP
print 'Fingerprint is %ld' % FP.Finge... | #!/usr/bin/python2.2
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import md5
"""64-bit fingerprint support for strings.
Usage:
from extern import FP
print 'Fingerprint is %ld' % FP.Fi... |
Add method to move a module on top of others | (function(app) {
'use strict';
var jCore = require('jcore');
var helper = app.helper || require('../helper.js');
var Module = app.Module || require('./module.js');
var ModuleContainer = helper.inherits(function(props) {
ModuleContainer.super_.call(this);
this.modules = this.prop([]);
this.eleme... | (function(app) {
'use strict';
var jCore = require('jcore');
var helper = app.helper || require('../helper.js');
var Module = app.Module || require('./module.js');
var ModuleContainer = helper.inherits(function(props) {
ModuleContainer.super_.call(this);
this.modules = this.prop([]);
this.eleme... |
Add target attribute to a.fancybox to prevent default theme's links following | 'use strict';
var cheerio = require('cheerio');
var _ = require('underscore');
var multiline = require('multiline');
var template = _.template(multiline(function() {
/*
<a href="<%= url %>" title="<%= title %>" target="_self" class="fancybox">
<img src="<%= url %>" alt="<%= title %>"></img>
</a>
... | 'use strict';
var cheerio = require('cheerio');
var _ = require('underscore');
var multiline = require('multiline');
var template = _.template(multiline(function() {
/*
<a href="<%= url %>" title="<%= title %>" class="fancybox">
<img src="<%= url %>" alt="<%= title %>"></img>
</a>
*/
}));
module... |
Clarify build name for SauceLabs dashboard | // this file is for use in CircleCI continuous integration environment
module.exports = {
seleniumServerURL: {
hostname : 'ondemand.saucelabs.com',
port : 80,
},
driverCapabilities: {
platform : 'Windows 7',
'tunnel-identifier' : 'circle-' + process.env.C... | // this file is for use in CircleCI continuous integration environment
module.exports = {
seleniumServerURL: {
hostname : 'ondemand.saucelabs.com',
port : 80,
},
driverCapabilities: {
platform : 'Windows 7',
'tunnel-identifier' : 'circle-' + process.env.C... |
:art: Simplify nbsp replacing, yet again | 'use babel'
/* @flow */
import type { Message } from '../types'
export function visitMessage(message: Message) {
const messageFile = message.version === 1 ? message.filePath : message.location.file
const messageRange = message.version === 1 ? message.range : message.location.position
atom.workspace.open(messag... | 'use babel'
/* @flow */
import type { Message } from '../types'
const nbsp = String.fromCodePoint(160)
export function visitMessage(message: Message) {
const messageFile = message.version === 1 ? message.filePath : message.location.file
const messageRange = message.version === 1 ? message.range : message.locati... |
Remove array wrapper on storage get() key | import {getJSON} from './fetch.js';
// Retrieve the raw user preferences without defaults merged in
export function getRawPreferences() {
return new Promise((resolve) => {
chrome.storage.sync.get('preferences', (items) => {
resolve(items.preferences);
});
});
}
// Retrieve the map of default values ... | import {getJSON} from './fetch.js';
// Retrieve the raw user preferences without defaults merged in
export function getRawPreferences() {
return new Promise((resolve) => {
chrome.storage.sync.get(['preferences'], (items) => {
resolve(items.preferences);
});
});
}
// Retrieve the map of default value... |
Fix license header violations in messagebus
Change-Id: I3b5f5b3e96716552562498590988097c5d3c1308
Signed-off-by: Thanh Ha <09ea4d3a79c8bee41a16519f6a431f6bc0fd8d6f@linuxfoundation.org> | /*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org... |
/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package or... |
Handle case when YAML is empty. | """
ydf/templating
~~~~~~~~~~~~~~
Contains functions to be exported into the Jinja2 environment and accessible from templates.
"""
import jinja2
import os
from ydf import instructions, __version__
DEFAULT_TEMPLATE_NAME = 'default.tpl'
DEFAULT_TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.dirname... | """
ydf/templating
~~~~~~~~~~~~~~
Contains functions to be exported into the Jinja2 environment and accessible from templates.
"""
import jinja2
import os
from ydf import instructions, __version__
DEFAULT_TEMPLATE_NAME = 'default.tpl'
DEFAULT_TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.dirname... |
Rename `Stop recording` to `Pause recording` | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import RecordIcon from 'react-icons/lib/md/fiber-manual-record';
import PauseIcon from 'react-icons/lib/md/pause-circle-filled';
import Button from '../Button';
import { pauseRecording } from '../../actions';
class RecordButton... | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import RecordIcon from 'react-icons/lib/md/fiber-manual-record';
import StopIcon from 'react-icons/lib/md/stop';
import Button from '../Button';
import { pauseRecording } from '../../actions';
class RecordButton extends Compone... |
Make IRC handler a bit less verbose | /* eslint no-console: 0 */
'use strict';
const irc = require('irc');
const server = process.env.IRC_SERVER;
const user = process.env.IRC_USER;
const channel = process.env.IRC_CHANNEL;
const client = module.exports.client = new irc.Client(server, user, {
autoConnect: false,
autoRejoin: true,
channels: [channel]... | /* eslint no-console: 0 */
'use strict';
const irc = require('irc');
const server = process.env.IRC_SERVER;
const user = process.env.IRC_USER;
const channel = process.env.IRC_CHANNEL;
const client = module.exports.client = new irc.Client(server, user, {
debug: true,
autoConnect: false,
autoRejoin: true,
chan... |
Use medieval font to the outcome text | package br.odb.menu;
import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.TextView;
import br.odb.knights.R;
public class ShowOutcomeActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedI... | package br.odb.menu;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import br.odb.knights.R;
public class ShowOutcomeActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentV... |
Handle case where Status===inherit but no parent available | // const debug = require('debug')('W2:portal:instance/page/compute-document-status');
const Promise = require('bluebird');
function getParentStatus(statusConfig, persistence, entity, instance) {
return Promise.resolve()
.then(() => entity.getParentInstance(persistence, instance))
.then((parentInsta... | // const debug = require('debug')('W2:portal:instance/page/compute-document-status');
const Promise = require('bluebird');
function getParentStatus(statusConfig, persistence, entity, instance) {
return Promise.resolve()
.then(() => entity.getParentInstance(persistence, instance))
.then((parentInsta... |
Use backend type instead of multiple flag | <?php
namespace qnd;
/**
* Loader
*
* @param array $attr
* @param array $item
*
* @return mixed
*/
function loader(array $attr, array $item)
{
$item[$attr['id']] = cast($attr, $item[$attr['id']] ?? null);
$callback = fqn('loader_' . $attr['type']);
if (is_callable($callback)) {
return $call... | <?php
namespace qnd;
/**
* Loader
*
* @param array $attr
* @param array $item
*
* @return mixed
*/
function loader(array $attr, array $item)
{
$item[$attr['id']] = cast($attr, $item[$attr['id']] ?? null);
$callback = fqn('loader_' . $attr['type']);
if (is_callable($callback)) {
return $call... |
Add small message for forgotten link | @extends('layout.layout')
@section('content')
<div class="row">
<div class="eleven wide column">
<!-- TODO use trans()-->
We will send you a mail containing your secret connection link.
<form class="ui form">
<div class="field">
<labe... | @extends('layout.layout')
@section('content')
<div class="row">
<div class="eleven wide column">
<!-- TODO use trans()-->
<form class="ui form">
<div class="field">
<label>Your email adress</label>
<input type="text" name="emai... |
Add the py.test coverage plugin package (pytest-cov) as an extra
dependency. | #!/usr/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup, find_packages
setup(
name="jawa",
packages=find_packages(),
version="1.0",
description="Doing fun stuff with JVM ClassFiles.",
author="Tyler Kennedy",
author_email="tk@tkte.ch",
url="http://github.com/TkTech/Jawa",
... | #!/usr/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup, find_packages
setup(
name="jawa",
packages=find_packages(),
version="1.0",
description="Doing fun stuff with JVM ClassFiles.",
author="Tyler Kennedy",
author_email="tk@tkte.ch",
url="http://github.com/TkTech/Jawa",
... |
Add context when calling UserSerializer | from rest_framework.decorators import api_view
from rest_framework.response import Response
from .utils import absolute_reverse
from api.users.serializers import UserSerializer
@api_view(('GET',))
def root(request, format=None):
if request.user and not request.user.is_anonymous():
user = request.user
... | from rest_framework.decorators import api_view
from rest_framework.response import Response
from .utils import absolute_reverse
from api.users.serializers import UserSerializer
@api_view(('GET',))
def root(request, format=None):
if request.user and not request.user.is_anonymous():
user = request.user
... |
Create a compatible ast.parse with PY3
Created a function compatible with both PY2 and PY3 equivalent to
ast.parse. | from __future__ import print_function
from __future__ import division
import sys
import types
from ast import PyCF_ONLY_AST
PY2 = sys.version_info[0] == 2
PYPY = hasattr(sys, 'pypy_translation_info')
_identity = lambda x: x
if not PY2:
string_types = (str,)
integer_types = (int,)
long = int
class_typ... | import sys
import types
PY2 = sys.version_info[0] == 2
PYPY = hasattr(sys, 'pypy_translation_info')
_identity = lambda x: x
if not PY2:
string_types = (str,)
integer_types = (int,)
long = int
class_types = (type,)
from io import StringIO
import builtins
def to_bytes(s):
return s... |
Fix the Nick command help text | from twisted.plugin import IPlugin
from heufybot.moduleinterface import IBotModule
from heufybot.modules.commandinterface import BotCommand
from zope.interface import implements
class NickCommand(BotCommand):
implements(IPlugin, IBotModule)
name = "Nick"
def triggers(self):
return ["nick"]
... | from twisted.plugin import IPlugin
from heufybot.moduleinterface import IBotModule
from heufybot.modules.commandinterface import BotCommand
from zope.interface import implements
class NickCommand(BotCommand):
implements(IPlugin, IBotModule)
name = "Nick"
def triggers(self):
return ["nick"]
... |
Add empty result sql query message and move instruction to ErrorMsg | /*
* Copyright 2015 Ryan Gilera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | /*
* Copyright 2015 Ryan Gilera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
Add author and author email. | #!/usr/bin/env python
import setuptools
install_requires = [
'PrettyTable==0.7.2',
'kazoo==1.00',
'simplejson',
'argparse',
'kafka-python'
]
setuptools.setup(
name = 'stormkafkamon',
version = '0.1.0',
license = 'Apache',
description = '''Monitor offsets of a storm kafka spout.'''... | #!/usr/bin/env python
import setuptools
install_requires = [
'PrettyTable==0.7.2',
'kazoo==1.00',
'simplejson',
'argparse',
'kafka-python'
]
setuptools.setup(
name = 'stormkafkamon',
version = '0.1.0',
license = 'Apache',
description = '''Monitor offsets of a storm kafka spout.'''... |
Reduce log messages in production | var db = require('./db');
module.exports = function (server, cookieParser, sessionStore) {
var io = require('socket.io').listen(server);
var SessionSockets = require('session.socket.io');
var sessionSockets = new SessionSockets(io, sessionStore, cookieParser);
var env = process.env.NODE_ENV || 'develo... | var db = require('./db');
module.exports = function (server, cookieParser, sessionStore) {
var io = require('socket.io').listen(server);
var SessionSockets = require('session.socket.io');
var sessionSockets = new SessionSockets(io, sessionStore, cookieParser);
sessionSockets.on('connection', function ... |
Make more explicit variable name. | # Neurotopics/code/DataSet.py
import neurosynth.analysis.reduce as nsar
class DataSet:
"""
A DataSet takes a NeuroSynth dataset and extracts the DOI's, and
word subset of interest. It uses reduce.average_within_regions to
get the average activation in the regions of interest (ROIs) of
the img.
... | # Neurotopics/code/DataSet.py
import neurosynth.analysis.reduce as nsar
class DataSet:
"""
A DataSet takes a NeuroSynth dataset and extracts the DOI's, and
word subset of interest. It uses reduce.average_within_regions to
get the average activation in the regions of interest (ROIs) of
the img.
... |
Change encoding name for no reason | # encoding=utf_8
from __future__ import unicode_literals
import socket
from time import sleep
def mount(s, at, uuid=None, label=None, name=None):
for name, value in ((b'uuid', uuid), (b'label', label), (b'name', name)):
if value is not None:
value = value.encode('utf_8')
at = at.e... | # encoding=utf-8
from __future__ import unicode_literals
import socket
from time import sleep
def mount(s, at, uuid=None, label=None, name=None):
for name, value in ((b'uuid', uuid), (b'label', label), (b'name', name)):
if value is not None:
value = value.encode('utf_8')
at = at.e... |
Call Fatalf to use the format specifier
Signed-off-by: John Stephens <7eec02f6af4e6b1fb20edca992e35ddef4347d3d@docker.com> | package winio
import "testing"
func TestLookupInvalidSid(t *testing.T) {
_, err := LookupSidByName(".\\weoifjdsklfj")
aerr, ok := err.(*AccountLookupError)
if !ok || aerr.Err != cERROR_NONE_MAPPED {
t.Fatalf("expected AccountLookupError with ERROR_NONE_MAPPED, got %s", err)
}
}
func TestLookupValidSid(t *testi... | package winio
import "testing"
func TestLookupInvalidSid(t *testing.T) {
_, err := LookupSidByName(".\\weoifjdsklfj")
aerr, ok := err.(*AccountLookupError)
if !ok || aerr.Err != cERROR_NONE_MAPPED {
t.Fatalf("expected AccountLookupError with ERROR_NONE_MAPPED, got %s", err)
}
}
func TestLookupValidSid(t *testi... |
Use AppCompat instead of ActionBar | package org.apache.taverna.mobile.activities;
import org.apache.taverna.mobile.R;
import org.apache.taverna.mobile.fragments.workflowdetails.RunFragment;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
public class RunResult extends A... | package org.apache.taverna.mobile.activities;
import org.apache.taverna.mobile.R;
import org.apache.taverna.mobile.fragments.workflowdetails.RunFragment;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
public class RunResult extends A... |
Fix error in showing expand button when it didn't need it | var CS = CS || {};
CS.BufferLength = 200;
CS.Console = new Array();
CS.LastConsoleLength = 0;
CS.SetProgress = function (percent) {
document.getElementById('bar').style.width = percent + '%';
document.getElementById('percentage').innerHTML = percent + '%';
}
CS.SetStatus = function (status) {
document.getElement... | var CS = CS || {};
CS.BufferLength = 200;
CS.Console = new Array(10000);
CS.LastConsoleLength = 0;
CS.SetProgress = function (percent) {
document.getElementById('bar').style.width = percent + '%';
document.getElementById('percentage').innerHTML = percent + '%';
}
CS.SetStatus = function (status) {
document.getEl... |
Add description to config generator | import { Base } from 'yeoman-generator';
import generatorArguments from './arguments';
import generatorOptions from './options';
import generatorSteps from './steps';
export default class ConfigGenerator extends Base {
constructor(...args) {
super(...args);
Object.keys(generatorArguments).forEach(key => thi... | import { Base } from 'yeoman-generator';
import generatorArguments from './arguments';
import generatorOptions from './options';
import generatorSteps from './steps';
export default class ConfigGenerator extends Base {
constructor(...args) {
super(...args);
Object.keys(generatorArguments).forEach(key => thi... |
Rename asset part and remove image root | /**
* Load configuration objects
*/
import path from 'path'
import * as databaseConfig from './database'
import * as redisConfig from './redis'
import * as awsConfig from './aws'
// Environment
export const env = process.env.NODE_ENV || 'development'
// Server
export const keys = ['keys']
// Database, Redis, AWS
e... | /**
* Load configuration objects
*/
import path from 'path'
import * as databaseConfig from './database'
import * as redisConfig from './redis'
import * as awsConfig from './aws'
// Environment
export const env = process.env.NODE_ENV || 'development'
// Server
export const keys = ['keys']
// Database, Redis, AWS
e... |
Put the content type here.
git-svn-id: 3b6cb4556d214d66df54bca2662d7ef408f367bf@3330 46e82423-29d8-e211-989e-002590a4cdd4 | <?php
#
# $Id: news.php,v 1.1.2.19 2005-05-17 22:47:34 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
#
DEFINE('MAX_PORTS', 20);
require_once($_SERVER['DOCUMENT_ROOT'] . '/include/common.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/include/freshports.php');
require_once($_SERVER['DOCUMENT_R... | <?php
#
# $Id: news.php,v 1.1.2.18 2004-11-26 14:57:20 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
#
DEFINE('MAX_PORTS', 20);
require_once($_SERVER['DOCUMENT_ROOT'] . '/include/common.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/include/freshports.php');
require_once($_SERVER['DOCUMENT_R... |
Create test environment first to prevent the modified bootstrap configuration to be overwritten | <?php
/**
* Definition of class LanguageServiceTest
*
* @copyright 2014-today Justso GmbH
* @author j.schirrmacher@justso.de
* @package justso\justtexts\test
*/
namespace justso\justtexts\test;
use justso\justapi\Bootstrap;
use justso\justapi\testutil\ServiceTestBase;
use justso\justtexts\service\Langua... | <?php
/**
* Definition of class LanguageServiceTest
*
* @copyright 2014-today Justso GmbH
* @author j.schirrmacher@justso.de
* @package justso\justtexts\test
*/
namespace justso\justtexts\test;
use justso\justapi\Bootstrap;
use justso\justapi\testutil\ServiceTestBase;
use justso\justtexts\service\Langua... |
Use the async version of readFile | 'use strict';
var _ = require('lodash');
var fs = require('fs');
var hljs = require('../../build');
var jsdom = require('jsdom').jsdom;
var utility = require('../utility');
describe('special cases tests', function() {
before(function(done) {
var filename = utility.buildPath('fixtures', 'index.ht... | 'use strict';
var _ = require('lodash');
var fs = require('fs');
var hljs = require('../../build');
var jsdom = require('jsdom').jsdom;
var utility = require('../utility');
describe('special cases tests', function() {
before(function() {
var blocks,
filename = utility.buildPath('fixtures... |
Fix broken ME conduit textures | package crazypants.enderio.conduit.me;
import net.minecraft.item.ItemStack;
import crazypants.enderio.ModObject;
import crazypants.enderio.conduit.AbstractItemConduit;
import crazypants.enderio.conduit.IConduit;
import crazypants.enderio.conduit.ItemConduitSubtype;
public class ItemMEConduit extends AbstractItemCondu... | package crazypants.enderio.conduit.me;
import net.minecraft.item.ItemStack;
import crazypants.enderio.ModObject;
import crazypants.enderio.conduit.AbstractItemConduit;
import crazypants.enderio.conduit.IConduit;
import crazypants.enderio.conduit.ItemConduitSubtype;
public class ItemMEConduit extends AbstractItemCondu... |
Create Hash method to engine.Dot | package engine
import "fmt"
type Dot struct {
X uint8
Y uint8
}
// Equals compares two dots
func (d1 Dot) Equals(d2 Dot) bool {
return d1 == d2 || (d1.X == d2.X && d1.Y == d2.Y)
}
// Implementing json.Marshaler interface
func (d Dot) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("[%d,%d]", d.X, d.Y)... | package engine
import "fmt"
type Dot struct {
X uint8
Y uint8
}
// Equals compares two dots
func (d1 Dot) Equals(d2 Dot) bool {
return d1 == d2 || (d1.X == d2.X && d1.Y == d2.Y)
}
// Implementing json.Marshaler interface
func (d Dot) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("[%d,%d]", d.X, d.Y)... |
Fix a typo in description: it's => its | from setuptools import setup
setup(
name='python-binary-memcached',
version='0.24.6',
author='Jayson Reis',
author_email='santosdosreis@gmail.com',
description='A pure python module to access memcached via its binary protocol with SASL auth support',
url='https://github.com/jaysonsantos/python-b... | from setuptools import setup
setup(
name='python-binary-memcached',
version='0.24.6',
author='Jayson Reis',
author_email='santosdosreis@gmail.com',
description='A pure python module to access memcached via it\'s binary protocol with SASL auth support',
url='https://github.com/jaysonsantos/python... |
Add __future__ imports to a new module | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... |
Add links to header buttons | @extends('_layouts.master')
@section('body')
<!-- Sticky Header -->
<div id="header-placeholder"></div>
<header>
<div class="header-left">
<a href="http://www.artic.edu/">
<img src="images/logo.svg">
</a>
<span class="exhibit">
<span class="title">Gauguin</span>
<span class="pipe">|</span>
<spa... | @extends('_layouts.master')
@section('body')
<!-- Sticky Header -->
<div id="header-placeholder"></div>
<header>
<div class="header-left">
<a href="http://www.artic.edu/">
<img src="images/logo.svg">
</a>
<span class="exhibit">
<span class="title">Gauguin</span>
<span class="pipe">|</span>
<spa... |
Remove ability to recieve messages | from http_client import HttpClient
class Bot():
"""
@breif Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient()
def send_message(self, message, completion):
def completion(response, error):
if error is None:
... | from http_client import HttpClient
"""
@breif Facebook messenger bot
"""
class Bot():
def __init__(self, token):
self.api_token = token
self.client = HttpClient()
def send_message(self, message, completion):
def completion(response, error):
if error is None:
... |
Stop the bot at the end | package main
import (
"fmt"
"math/rand"
"os"
"time"
"github.com/erbridge/gotwit"
"github.com/erbridge/gotwit/twitter"
"github.com/erbridge/wikipaedian/wiki"
)
func main() {
var (
con twitter.ConsumerConfig
acc twitter.AccessConfig
)
f := "secrets.json"
if _, err := os.Stat(f); err == nil {
con, acc... | package main
import (
"fmt"
"math/rand"
"os"
"time"
"github.com/erbridge/gotwit"
"github.com/erbridge/gotwit/twitter"
"github.com/erbridge/wikipaedian/wiki"
)
func main() {
var (
con twitter.ConsumerConfig
acc twitter.AccessConfig
)
f := "secrets.json"
if _, err := os.Stat(f); err == nil {
con, acc... |
Make tests for class cluttering consistent
* Remove the extra level of `describe`
* use should to begin test names | 'use strict';
describe('block class names', function() {
it('should add language class name to block', function() {
var expected = 'some-class hljs xml',
actual = document.getElementById('without-hljs-class').className;
actual.should.equal(expected);
});
it('should not clutter block class (fi... | 'use strict';
describe('block class names', function() {
it('should add language class name to block', function() {
var expected = 'some-class hljs xml',
actual = document.getElementById('without-hljs-class').className;
actual.should.equal(expected);
});
describe('do not clutter block class n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.