text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Change GetTransMemoryHandler to return multiple strings per TextFlow
Also had to split TranslationMemoryGlossaryItem into SearchResultItem,
TransMemoryResultItem and GlossaryResultItem and related UI classes.
(Sorting of TM results still needs to account for multiple strings.)
TransMemoryQuery.toString() shortens no... | package org.zanata.util;
import java.util.ArrayList;
import java.util.List;
/**
* ShortStrings are meant for use in logging. They don't incur the cost of
* shortening until toString() is called. This means they hold on to the entire
* string, so don't bother keeping them around in memory for long.
*
* @author S... | package org.zanata.util;
/**
* ShortStrings are meant for use in logging. They don't incur the cost of
* shortening until toString() is called. This means they hold on to the entire
* string, so don't bother keeping them around in memory for long.
*
* @author Sean Flanigan <a
* href="mailto:sflaniga@red... |
FIX Exceptions broken if no notifiers specified | <?php
class HailApiException extends Exception {
/**
* A class list of notifiers to use. Must implement HailNotifier
* @see HailNotifier
* @var array
*/
private static $notifiers;
protected $hailMessage = '';
public function __construct($message = "", $code = 0, Throwable $previous = NULL) ... | <?php
class HailApiException extends Exception {
/**
* A class list of notifiers to use. Must implement HailNotifier
* @see HailNotifier
* @var array
*/
private static $notifiers;
protected $hailMessage = '';
public function __construct($message = "", $code = 0, Throwable $previous = NULL) ... |
Add manual experiment that replaces a RGB image with grayscale | import pytest
import imghdr
from io import BytesIO
from PIL import Image
import zlib
from pikepdf import Pdf, Object
def test_jpeg(resources, outdir):
pdf = Pdf.open(resources / 'congress.pdf')
# If you are looking at this as example code, Im0 is not necessarily the
# name of any image.
pdfimage = pd... | import pytest
import imghdr
from io import BytesIO
from PIL import Image
from pikepdf import _qpdf as qpdf
def test_jpeg(resources, outdir):
pdf = qpdf.Pdf.open(resources / 'congress.pdf')
# If you are looking at this as example code, Im0 is not necessarily the
# name of any image.
pdfimage = pdf.pag... |
Add auto increment field to user's table | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
const TABLE = 'users';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schem... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
const TABLE = 'users';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schem... |
Use `!Array.isArray` since it makes more sense. | 'use strict';
const os = require('os');
const debug = require('debug')('asset-resolver');
const resolver = require('./lib/resolver');
function any(promises) {
return Promise.all(
promises.map(promise =>
promise.then(
val => {
throw val;
},
reason => reason
)
)
... | 'use strict';
const os = require('os');
const debug = require('debug')('asset-resolver');
const resolver = require('./lib/resolver');
function any(promises) {
return Promise.all(
promises.map(promise =>
promise.then(
val => {
throw val;
},
reason => reason
)
)
... |
Remove `--jedify-lang` command line option | var through = require('through')
, falafel = require('falafel')
, unparse = require('escodegen').generate
, util = require('util')
, minimist = require('minimist')
var defaultLang = process.env['JEDIFY_LANG'] || 'en'
var re = /\.js$/
module.exports = function (file, options) {
if (!re.test(file)) return th... | var through = require('through')
, falafel = require('falafel')
, unparse = require('escodegen').generate
, util = require('util')
, minimist = require('minimist')
var argv = minimist(process.argv.slice(2))
var defaultLang = argv['jedify-lang'] || process.env['JEDIFY_LANG'] || 'en'
var re = /\.js$/
module.e... |
Call CraftRecipe Register Func on preInit | package jp.crafterkina.pipes.common;
import jp.crafterkina.pipes.common.recipe.vanilla.CraftManager;
import lombok.Getter;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.InstanceFactory;
import net.minecraftforge.fml.common.Side... | package jp.crafterkina.pipes.common;
import lombok.Getter;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.InstanceFactory;
import net.minecraftforge.fml.common.SidedProxy;
import static jp.crafterkina.pipes.common.PipesCore.MOD_ID;
@Mod(modid = MOD_ID)
public enum PipesCore {
... |
Move title below db connection to get questionnaire name | <?php
class QuestionnairesController extends Controller {
function view($token) {
$this->Questionnaire = new Database();
$this->Questionnaire->query('SELECT * FROM questionnaires WHERE token = :token');
$this->Questionnaire->bind(':token', $token);
$this->Questionnaire->execute();... | <?php
class QuestionnairesController extends Controller {
function view($token) {
$this->set('title','Questionnaire '.$token);
$this->Questionnaire = new Database();
$this->Questionnaire->query('SELECT * FROM questionnaires WHERE token = :token');
$this->Questionnaire->bind(':toke... |
Add empty state container class as utility | package info.u_team.u_team_core.util;
import static net.minecraft.client.renderer.model.ModelBakery.STATE_CONTAINER_OVERRIDES;
import java.util.*;
import com.google.common.collect.*;
import net.minecraft.block.*;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ResourceLocation;
import net.minec... | package info.u_team.u_team_core.util;
import static net.minecraft.client.renderer.model.ModelBakery.STATE_CONTAINER_OVERRIDES;
import java.util.*;
import com.google.common.collect.ImmutableMap;
import net.minecraft.block.*;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ResourceLocation;
impor... |
Modify the author email address | #!/usr/bin/env python
from distutils.core import setup
packages = [
'upho',
'upho.phonon',
'upho.harmonic',
'upho.analysis',
'upho.structure',
'upho.irreps',
'upho.qpoints',
'group',
]
scripts = [
'scripts/upho_weights',
'scripts/upho_sf',
'scripts/upho_qpoints',
'script... | #!/usr/bin/env python
from distutils.core import setup
packages = [
'upho',
'upho.phonon',
'upho.harmonic',
'upho.analysis',
'upho.structure',
'upho.irreps',
'upho.qpoints',
'group',
]
scripts = [
'scripts/upho_weights',
'scripts/upho_sf',
'scripts/upho_qpoints',
'script... |
Change maximum nested list level to 1 | import { Map } from 'immutable';
import { DefaultDraftBlockRenderMap } from 'draft-js';
import { BLOCK_TYPE } from '../api/constants';
// Maximum level of nesting for unordered and ordered lists.
export const MAX_LIST_NESTING = 1;
// Frequency at which the save callback is triggered.
export const STATE_SAVE_INTERVAL ... | import { Map } from 'immutable';
import { DefaultDraftBlockRenderMap } from 'draft-js';
import { BLOCK_TYPE } from '../api/constants';
// Maximum level of nesting for unordered and ordered lists.
export const MAX_LIST_NESTING = 3;
// Frequency at which the save callback is triggered.
export const STATE_SAVE_INTERVAL ... |
Add promise returning on sending | var util = require('util');
var extend = require('extend');
var Promise = require('bluebird');
var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');
var BaseMailer = require('./BaseMailer');
util.inherits(SMTPMailer, BaseMailer);
/**
* Create new mailer instance for sendin... | var util = require('util');
var extend = require('extend');
var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');
var BaseMailer = require('./BaseMailer');
util.inherits(SMTPMailer, BaseMailer);
/**
* Create new mailer instance for sending via SMTP servers
* @constructor
... |
Add Unit test for Tag Transformer | <?php
namespace RCatlin\Blog\Tests\Serializer\Transformer\Entity;
use RCatlin\Blog\Entity;
use RCatlin\Blog\Serializer\Transformer\Entity\TagTransformer;
use RCatlin\Blog\Tests\HasFaker;
class TagTransformerTest extends \PHPUnit_Framework_TestCase
{
use HasFaker;
public function testTransform()
{
... | <?php
namespace RCatlin\Blog\Tests\Serializer\Transformer\Entity;
use RCatlin\Blog\Entity;
use RCatlin\Blog\Serializer\Transformer\Entity\TagTransformer;
use RCatlin\Blog\Tests\HasFaker;
class TagTransformerTest extends \PHPUnit_Framework_TestCase
{
use HasFaker;
public function testTransform()
{
... |
Fix matching in the filter
I got it backwards :/ | /**
* This filtering plugin will allow matching of module names in either
* form of 'Foo::Bar', or 'Foo-Bar'.
*
* Based on dataTables.filter.phoneNumber.js
*
* @summary Make Perl module names searchable
* @name Perl module
* @author Zak B. Elep
*
* @example
* $(document).ready(function() {
* $('#examp... | /**
* This filtering plugin will allow matching of module names in either
* form of 'Foo::Bar', or 'Foo-Bar'.
*
* Based on dataTables.filter.phoneNumber.js
*
* @summary Make Perl module names searchable
* @name Perl module
* @author Zak B. Elep
*
* @example
* $(document).ready(function() {
* $('#examp... |
[api] Add options.stdin, clean up options logic. |
var prefork = require('../build/Release/prefork').prefork,
fs = require('fs');
module.exports = function (options) {
options = options || {};
var infd = -1, outfd = -1, errfd = -1,
customFds;
if (options.stdin && typeof options.stdin === 'string') {
infd = fs.openSync(options.stdin, 'r');
}
i... |
var prefork = require('../build/Release/prefork').prefork,
fs = require('fs');
module.exports = function (options) {
options = options || {};
var outfd, errfd;
if (Array.isArray(options.customFds) && options.customFds.length < 3) {
options.customFds.unshift(-1);
}
if (options.stdout && typeof opti... |
Fix result status chiclet links for new-style filter querystrings. | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011 uTest Inc.
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011 uTest Inc.
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... |
Test is loaded CSS is applied | # -*- coding: utf-8 -*-
import unittest
from .base import FunctionalTestCase
from .pages import game
class StylesheetTests(FunctionalTestCase):
def test_color_css_loaded(self):
self.story('Create a game')
self.browser.get(self.live_server_url)
page = game.Homepage(self.browser)
page... | # -*- coding: utf-8 -*-
import unittest
from .base import FunctionalTestCase
from .pages import game
class StylesheetTests(FunctionalTestCase):
def test_color_css_loaded(self):
self.story('Create a game')
self.browser.get(self.live_server_url)
page = game.Homepage(self.browser)
page... |
Use new landingPage attribute locations | import Ember from 'ember';
export default Ember.Component.extend({
downloadLatency: Ember.computed(function() {
var rawLatency = this.get('model').get("landingPage").downloadLatency;
return Math.round(rawLatency)
}),
bodyHasDoi: Ember.computed(function() {
if (this.get('model').get("landingPage").b... | import Ember from 'ember';
export default Ember.Component.extend({
downloadLatency: Ember.computed(function() {
var rawLatency = this.get('model').get("landingPage").result['downloadLatency'];
return Math.round(rawLatency)
}),
bodyHasDoi: Ember.computed(function() {
if (this.get('model').get("landi... |
Bump tensorflow from 2.5.1 to 2.5.2
Bumps [tensorflow](https://github.com/tensorflow/tensorflow) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/tensorflow/tensorflow/releases)
- [Changelog](https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md)
- [Commits](https://github.com/tensorflow/tensorflow/... | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="EQTransformer",
author="S. Mostafa Mousavi",
version="0.1.61",
author_email="smousavi05@gmail.com",
description="A python package for making and using attentive deep-learnin... | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="EQTransformer",
author="S. Mostafa Mousavi",
version="0.1.61",
author_email="smousavi05@gmail.com",
description="A python package for making and using attentive deep-learnin... |
Remove GuiBoard for spec where it doesn't belong | var JSChess = require('../js-chess.js');
var _ = require('lodash');
describe('Classic Chess', function() {
it('everything', function() {
var army1 = new JSChess.Army({ forwardDirection: 'down' });
var army2 = new JSChess.Army({ forwardDirection: 'up' });
var board = new JSChess.Board({
army1: army... | var JSChess = require('../js-chess.js');
var GuiBoard = require('../lib/gui_board.js');
var _ = require('lodash');
describe('Classic Chess', function() {
it('everything', function() {
var army1 = new JSChess.Army({ forwardDirection: 'down' });
var army2 = new JSChess.Army({ forwardDirection: 'up' });
va... |
Move deprecation under use statements | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Twig\Form;
use Symfony\Component\Form\FormRenderer;
use ... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Twig\Form;
@trigger_error(sprintf('The %s class is depre... |
QS-935: Rename compare route to use definitive one as 'compare' | import { fetchAnswers, fetchQuestion, fetchComparedAnswers, postAnswer, postSkipQuestion } from '../utils/APIUtils';
export function getAnswers(url = `answers`){
return fetchAnswers(url);
}
export function getComparedAnswers(otherUserId, filters, url = `answers/compare/${otherUserId}?locale=es${filters.map(filter... | import { fetchAnswers, fetchQuestion, fetchComparedAnswers, postAnswer, postSkipQuestion } from '../utils/APIUtils';
export function getAnswers(url = `answers`){
return fetchAnswers(url);
}
export function getComparedAnswers(otherUserId, filters, url = `answers/compare-new/${otherUserId}?locale=es${filters.map(fi... |
Include sender in message if echo is specified. Needs io object. | var read = require('fs').readFileSync;
var client = require('khoros-client');
module.exports = function (io, server) {
// Serve client js.
if (server) {
var clientSource = read(require.resolve('khoros-client/khoros.js'), 'utf-8');
server.on('request', function(req, res) {
if (req.url == "/khoros/khoros.js"... | var read = require('fs').readFileSync;
var client = require('khoros-client');
module.exports = function (server) {
// Serve client js.
if (server) {
var clientSource = read(require.resolve('khoros-client/khoros.js'), 'utf-8');
server.on('request', function(req, res) {
if (req.url == "/khoros/khoros.js") {
... |
Make slug unique and fix the max_length. | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField(unique=True, max... | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField()
def _... |
Use process.exit once final callback is called | #!/usr/bin/env node
var cdbExport = require('cartodb-export');
var fs = require('fs');
var program = require('commander');
var cartodb2leaflet = require('../index');
program
.version('0.0.1')
.usage('[options] url')
.option('-d, --dir [directory]', 'Specify the output directory [.]', '.')
.parse(proc... | #!/usr/bin/env node
var cdbExport = require('cartodb-export');
var fs = require('fs');
var program = require('commander');
var cartodb2leaflet = require('../index');
program
.version('0.0.1')
.usage('[options] url')
.option('-d, --dir [directory]', 'Specify the output directory [.]', '.')
.parse(proc... |
Support negative numbers in qtcreator debugging | from dumper import *
def qdump__FixedPoint(d, value):
d.putNumChild(3)
raw = [ value["v"]["s"][i].integer() for i in range( value["v"]["numWords"].integer() ) ]
ss = value["v"]["storageSize"].integer()
exp = [raw[i] * 2**(i * ss) for i in range(len(raw)) ]
if raw[-1] >= 2**(ss-1):
exp += [ ... | from dumper import *
def qdump__FixedPoint(d, value):
d.putNumChild(3)
raw = [ value["v"]["s"][i].integer() for i in range( value["v"]["numWords"].integer() ) ]
ss = value["v"]["storageSize"].integer()
exp = [raw[i] * 2**(i * ss) for i in range(len(raw)) ]
d.putValue(sum(exp) * 2**-value["fractiona... |
Swap to using submission prediction writer function | #!/usr/bin/env python
import neukrill_net.utils as utils
import neukrill_net.image_processing as image_processing
import csv
import pickle
from sklearn.externals import joblib
import numpy as np
import glob
import os
def main():
settings = utils.Settings('settings.json')
image_fname_dict = settings.image_fn... | #!/usr/bin/env python
import neukrill_net.utils as utils
import neukrill_net.image_processing as image_processing
import csv
import pickle
from sklearn.externals import joblib
import numpy as np
import glob
import os
def main():
settings = utils.Settings('settings.json')
image_fname_dict = settings.image_fn... |
Revert "Remove name from organisation" | """empty message
Revision ID: 0093_data_gov_uk
Revises: 0092_add_inbound_provider
Create Date: 2017-06-05 16:15:17.744908
"""
# revision identifiers, used by Alembic.
revision = '0093_data_gov_uk'
down_revision = '0092_add_inbound_provider'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects imp... | """empty message
Revision ID: 0093_data_gov_uk
Revises: 0092_add_inbound_provider
Create Date: 2017-06-05 16:15:17.744908
"""
# revision identifiers, used by Alembic.
revision = '0093_data_gov_uk'
down_revision = '0092_add_inbound_provider'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects imp... |
Fix unchecked function call in thread datawriter | <?php
class SV_WordCountSearch_XenForo_DataWriter_Discussion_Thread extends XFCP_SV_WordCountSearch_XenForo_DataWriter_Discussion_Thread
{
protected function _getFields()
{
$fields = parent::_getFields();
$fields['xf_thread']['word_count'] = array(
'type' => self::TYPE_UNKN... | <?php
class SV_WordCountSearch_XenForo_DataWriter_Discussion_Thread extends XFCP_SV_WordCountSearch_XenForo_DataWriter_Discussion_Thread
{
protected function _getFields()
{
$fields = parent::_getFields();
$fields['xf_thread']['word_count'] = array(
'type' => self::TYPE_UNKN... |
Add missing serial version ID (default).
git-svn-id: fb13a56e2874bbe7f090676f40e1dce4dcf67111@1572570 13f79535-47bb-0310-9956-ffa450edef68 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
Revert "[MOD] Comment unused class"
This reverts commit b952175697c59a959ab694f04ef6e40924c6b2e4. | <?php
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
// Enable APC for autoloading to improve performance.
// You should change the ApcClassLoader first argument to a unique prefix
// in order to prevent ca... | <?php
//use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
// Enable APC for autoloading to improve performance.
// You should change the ApcClassLoader first argument to a unique prefix
// in order to prevent ... |
Clean up modal when it goes away | /* Scat functionality */
"use strict";
class ScatUtils {
htmlToElement (html) {
let template= document.createElement('template');
template.innerHTML= html.trim();
return template.content.firstChild;
}
// Pop up a dialog
dialog (from, name, data= {}) {
let url= name;
if (from.disabled) r... | /* Scat functionality */
"use strict";
class ScatUtils {
htmlToElement (html) {
let template= document.createElement('template');
template.innerHTML= html.trim();
return template.content.firstChild;
}
// Pop up a dialog
dialog (from, name, data= {}) {
let url= name;
if (from.disabled) r... |
Improve regex to detect commands by allowing multiple sections separated with a dash. | <?php
namespace WP_CLI;
/**
* Class AutoloadSplitter.
*
* This class is used to provide the splitting logic to the
* `wp-cli/autoload-splitter` Composer plugin.
*
* @package WP_CLI
*/
class AutoloadSplitter {
/**
* Check whether the current class should be split out into a separate
* autoloader.
*
* ... | <?php
namespace WP_CLI;
/**
* Class AutoloadSplitter.
*
* This class is used to provide the splitting logic to the
* `wp-cli/autoload-splitter` Composer plugin.
*
* @package WP_CLI
*/
class AutoloadSplitter {
/**
* Check whether the current class should be split out into a separate
* autoloader.
*
* ... |
Resolve method error as a standard GraphQL error | class DDPNetworkInterface {
constructor({
connection,
noRetry = true,
method = '/graphql' } = {}
) {
this.connection = connection;
this.noRetry = noRetry;
this.method = method;
}
query(request) {
return new Promise((resolve, reject) => {
... | class DDPNetworkInterface {
constructor({
connection,
noRetry = true,
method = '/graphql' } = {}
) {
this.connection = connection;
this.noRetry = noRetry;
this.method = method;
}
query(request) {
return new Promise((resolve, reject) => {
... |
Add nullable to assist imports | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class FkPageGroups extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('page_groups', function (Blueprint $table) {
$tabl... | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class FkPageGroups extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('page_groups', function (Blueprint $table) {
$tabl... |
BE: Add Jinja filter to convert URL params to dict | # -*- coding: utf-8 -*-
"Jinja custom filters"
import re
from urlparse import urlparse, parse_qs
from cla_public.apps.base import base
from babel.dates import format_datetime
@base.app_template_filter()
def datetime(dt, format='medium', locale='en_GB'):
if format == 'full':
format = "EEEE, d MMMM y 'at' ... | # -*- coding: utf-8 -*-
"Jinja custom filters"
import re
from cla_public.apps.base import base
from babel.dates import format_datetime
@base.app_template_filter()
def datetime(dt, format='medium', locale='en_GB'):
if format == 'full':
format = "EEEE, d MMMM y 'at' HH:mm"
elif format == 'medium':
... |
Add check for wifi details | var wifiManager = require('../../lib/WifiManager');
var hb = require('handlebars');
var fs = require('fs');
const path = require('path');
var subApp = function(){
this.staticFolder = "assets";
this.setup = function(router, express){
router.get('/', function(req, res) {
fs.readFile(path.join(__dirname, ... | var wifiManager = require('../../lib/WifiManager');
var hb = require('handlebars');
var fs = require('fs');
const path = require('path');
var subApp = function(){
this.staticFolder = "assets";
this.setup = function(router, express){
router.get('/', function(req, res) {
fs.readFile(path.join(__dirname, ... |
Clean out old validation stuff from Signup | var async = require( 'async' );
var Data = require( './data' );
var Output = require( './output' );
var utils = require( '../utils' );
exports.userSignup = function ( req, res ) {
async.waterfall( [
function ( callback ) {
req.checkBody( 'email', "Must be an email address" ).isEmail();
... | var async = require( 'async' );
var Validation = require( './validation' );
var Data = require( './data' );
var Output = require( './output' );
var utils = require( '../utils' );
var validationError = require( '../utils/error_messages' ).validationError;
exports.userSignup = function ( req, res ) {
async.waterfa... |
Use \x00 instead of \u0000 for null character | #!/usr/bin/env node
'use strict';
function exec (command) {
return require('child_process').execSync(command).toString();
}
function luckyCommit (desiredString) {
if (!/^[0-9a-f]{1,40}$/.test(desiredString)) {
throw new TypeError('Invalid input provided. (If an input is provided, it must be a hex string.)');
... | #!/usr/bin/env node
'use strict';
function exec (command) {
return require('child_process').execSync(command).toString();
}
function luckyCommit (desiredString) {
if (!/^[0-9a-f]{1,40}$/.test(desiredString)) {
throw new TypeError('Invalid input provided. (If an input is provided, it must be a hex string.)');
... |
Add description to selectiongrid items | from wagtail.core import blocks
from wagtail.core.blocks import RichTextBlock
from wagtail.core.fields import StreamField
from wagtail.admin.edit_handlers import TabbedInterface, StreamFieldPanel, ObjectList
from falmer.content.blocks import HeroImageBlock, FalmerImageChooserBlock
from falmer.content.models.core impor... | from wagtail.core import blocks
from wagtail.core.fields import StreamField
from wagtail.admin.edit_handlers import TabbedInterface, StreamFieldPanel, ObjectList
from falmer.content.blocks import HeroImageBlock, FalmerImageChooserBlock
from falmer.content.models.core import Page
class GridItem(blocks.StructBlock):
... |
Use test helpers in FieldsHaveDescriptions tests | import { FieldsHaveDescriptions } from '../../src/rules/fields_have_descriptions';
import { expectFailsRule } from '../assertions';
describe('FieldsHaveDescriptions rule', () => {
it('catches fields that have no description', () => {
expectFailsRule(
FieldsHaveDescriptions,
`
type QueryRoot {
... | import assert from 'assert';
import { parse } from 'graphql';
import { validate } from 'graphql/validation';
import { buildASTSchema } from 'graphql/utilities/buildASTSchema';
import { FieldsHaveDescriptions } from '../../src/rules/fields_have_descriptions';
describe('FieldsHaveDescriptions rule', () => {
it('catch... |
Fix 'kilo' arg was missing' | (function( angular ) {
'use strict';
angular.module('angular-humanize', []).
filter('humanizeFilesize', function () {
return function ( input, kilo, decimals, decPoint, thousandsSep ) {
if ( isNaN(parseInt(input)) ) { return input; }
return humanize.filesize(parseInt(input, kilo || undefi... | (function( angular ) {
'use strict';
angular.module('angular-humanize', []).
filter('humanizeFilesize', function () {
return function ( input, decimals, decPoint, thousandsSep ) {
if ( isNaN(parseInt(input)) ) { return input; }
return humanize.filesize(parseInt(input, decimals || 2, decPo... |
Add to header values to force a value | <?php
$subject = $this->email->getHeaderValue('Subject', '<Empty Subject>');
$this->title($subject);
?>
<h1 class="heading">
<a href="<?= $this->escape()->attr($this->route('list')); ?>">Outgoing emails - listing</a> >
<span class="sub"><?= $this->escape()->html($subject);?></span>
</h1>
<div class="email-he... | <?php
$subject = $this->email->getHeaderValue('Subject', '<Empty Subject>');
$this->title($subject);
?>
<h1 class="heading">
<a href="<?= $this->escape()->attr($this->route('list')); ?>">Outgoing emails - listing</a> >
<span class="sub"><?= $this->escape()->html($subject);?></span>
</h1>
<div class="email-he... |
Fix a bug which causes that JPEG lossless images cannot be decompressed in Safari | "use strict";
(function (cornerstoneWADOImageLoader) {
function decodeJPEGLossless(imageFrame, pixelData) {
// check to make sure codec is loaded
if(typeof jpeg === 'undefined' ||
typeof jpeg.lossless === 'undefined' ||
typeof jpeg.lossless.Decoder === 'undefined') {
throw 'No JPEG Lossless... | "use strict";
(function (cornerstoneWADOImageLoader) {
function decodeJPEGLossless(imageFrame, pixelData) {
// check to make sure codec is loaded
if(typeof jpeg === 'undefined' ||
typeof jpeg.lossless === 'undefined' ||
typeof jpeg.lossless.Decoder === 'undefined') {
throw 'No JPEG Lossless... |
Stop GA from sending extra requests | (function(){
var html = document.getElementsByTagName('html')[0];
var analytics_id = html.getAttribute('data-analytics-id');
var analytics_domain = html.getAttribute('data-analytics-domain');
var ngApp = html.getAttribute('ng-app');
if (analytics_id && analytics_domain) {
(function(i,s,o,g,r,a,m){i['Goog... | (function(){
var html = document.getElementsByTagName('html')[0];
var analytics_id = html.getAttribute('data-analytics-id');
var analytics_domain = html.getAttribute('data-analytics-domain');
var ngApp = html.getAttribute('ng-app');
if (analytics_id && analytics_domain) {
(function(i,s,o,g,r,a,m){i['Goog... |
Set DISABLE_EXTRACT_CSS in correct place | const genDefaultConfig = require('@storybook/vue/dist/server/config/defaults/webpack.config.js')
const merge = require('webpack-merge')
module.exports = (baseConfig, env) => {
/* when building with storybook we do not want to extract css as we normally do in production */
process.env.DISABLE_EXTRACT_CSS = true
... | const genDefaultConfig = require('@storybook/vue/dist/server/config/defaults/webpack.config.js')
const merge = require('webpack-merge')
module.exports = (baseConfig, env) => {
const storybookConfig = genDefaultConfig(baseConfig, env)
const quasarConfig = require('../build/webpack.dev.conf.js')
/* when building ... |
Change default name of User class to 'Nameless User' | /* jshint node:true */
var _ = require('underscore');
var uuid = require('node-uuid');
module.exports = (function() {
function User(socketArg) {
this.id = uuid.v4();
this._socket = socketArg;
this.name = 'Nameless User';
}
User.prototype = {
message: function(name, arg) {
this._socket.e... | /* jshint node:true */
var _ = require('underscore');
var uuid = require('node-uuid');
module.exports = (function() {
function User(socketArg) {
this.id = uuid.v4();
this._socket = socketArg;
this.name = 'Nameless Room';
}
User.prototype = {
message: function(name, arg) {
this._socket.e... |
Allow overriding properties on the command line. | package org.sourceforge.uptodater;
import java.util.*;
public class ConfigData {
private static final String DEFAULT_CONFIGURATION_NAME = "uptodater";
protected Map<String,String> configuration = new HashMap<String,String>();
public ConfigData() {
addOverrideConfiguration(DEFAULT_CONFIGURATION_... | package org.sourceforge.uptodater;
import java.util.*;
public class ConfigData {
private static final String DEFAULT_CONFIGURATION_NAME = "uptodater";
protected Map<String,String> configuration = new HashMap<String,String>();
public ConfigData() {
addOverrideConfiguration(DEFAULT_CONFIGURATION_... |
Add columns to polls table | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePollsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('polls', function ... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePollsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('polls', function ... |
Store timeoutId in local variable | /*
* Author: CM
*/
(function($) {
$.event.special.clickConfirmed = {
bindType: "click",
delegateType: "click",
settings: {
message: 'Please Confirm'
},
handle: function(event) {
var $this = $(this);
var deactivateTimeout = null;
var activateButton = function() {
$this.addClass('confirmCl... | /*
* Author: CM
*/
(function($) {
$.event.special.clickConfirmed = {
bindType: "click",
delegateType: "click",
settings: {
message: 'Please Confirm'
},
handle: function(event) {
var $this = $(this);
var activateButton = function() {
$this.addClass('confirmClick');
$this.attr('title', $.... |
Set application/json content when JSONObject is used body | package io.myweb.api;
import org.json.JSONObject;
import java.io.InputStream;
public class HttpResponse {
private String mimeType;
private Object body;
private int statusCode;
private long contentLength;
private HttpResponse() {}
public static HttpResponse create() {
return new HttpResponse();
}
pub... | package io.myweb.api;
import org.json.JSONObject;
import java.io.InputStream;
public class HttpResponse {
private String mimeType;
private Object body;
private int statusCode;
private long contentLength;
private HttpResponse() {}
public static HttpResponse create() {
return new HttpResponse();
}
pub... |
Update the delete the .env file before installing message | <?php namespace Anomaly\StreamsDistribution\Http\Controller;
use Anomaly\Streams\Platform\Application\Application;
use Anomaly\Streams\Platform\Http\Controller\PublicController;
use Anomaly\StreamsDistribution\Form\InstallerFormBuilder;
/**
* Class InstallerController
*
* @link http://anomaly.is/streams-p... | <?php namespace Anomaly\StreamsDistribution\Http\Controller;
use Anomaly\Streams\Platform\Application\Application;
use Anomaly\Streams\Platform\Http\Controller\PublicController;
use Anomaly\StreamsDistribution\Form\InstallerFormBuilder;
/**
* Class InstallerController
*
* @link http://anomaly.is/streams-p... |
Resolve issue with e.target.tagName throwing errors in the editor | module.exports = {
id: 'tabBar',
template: require('./index.html'),
data: {},
attached: function () {
var el = this.$el;
var inputs = document.querySelectorAll('input, te');
function onFocus(e) {
if (!e.target.tagName) return;
var tagName = e.target.tagNam... | module.exports = {
id: 'tabBar',
template: require('./index.html'),
data: {},
attached: function () {
var el = this.$el;
var inputs = document.querySelectorAll('input, te');
function onFocus(e) {
var tagName = e.target.tagName.toLowerCase();
if (['input', ... |
Fix "Array to string conversion" bug related to errorParams | <?php
$this->data['header'] = $this->t('{userid:error:header}');
$this->data['head'] = <<<EOF
<meta name="robots" content="noindex, nofollow" />
<meta name="googlebot" content="noarchive, nofollow" />
EOF;
$this->includeAtTemplateBase('includes/header.php');
$translationParams = [
'%IDPNAME%' => $this->data['para... | <?php
$this->data['header'] = $this->t('{userid:error:header}');
$this->data['head'] = <<<EOF
<meta name="robots" content="noindex, nofollow" />
<meta name="googlebot" content="noarchive, nofollow" />
EOF;
$this->includeAtTemplateBase('includes/header.php');
?>
<h2><?php echo $this->t('{userid:error:title}'); ?></h2>... |
Create assets dir in src | // paths map
var path = {
src: 'src',
dest: 'build'
};
// set configs for plugins
global['config'] = {
src: path.src,
dest: path.dest,
tests: {
src: 'tests/**/*'
},
zip: {
name: 'build.zip',
src: path.dest + '/**/*',
dest: './'
},
esformatter: {
src: path.src + '/assets/js/**/... | // paths map
var path = {
src: 'src',
dest: 'build'
};
// set configs for plugins
global['config'] = {
src: path.src,
dest: path.dest,
tests: {
src: path.src + '/js/tests/**/*'
},
zip: {
name: 'build.zip',
src: path.dest + '/**/*',
dest: './'
},
esformatter: {
src: path.src + ... |
Allow throwable in stub renderer
By only accepting Exception the Stub Exception renderer cannot handle
syntax errors, type errors or undefined method errors. | <?php
declare(strict_types=1);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files mu... | <?php
declare(strict_types=1);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files mu... |
Use format to properly format file for process_logdata_parser.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in the specified di... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in the specified di... |
Add Python 3.2 trove classifier | from setuptools import setup
setup(name='covenant',
version='0.1.0',
description='Code contracts for Python 3',
author='Kamil Kisiel',
author_email='kamil@kamilkisiel.net',
url='http://pypi.python.org/pypi/covenant',
license="BSD License",
packages=["covenant"],
keywords... | from setuptools import setup
setup(name='covenant',
version='0.1.0',
description='Code contracts for Python 3',
author='Kamil Kisiel',
author_email='kamil@kamilkisiel.net',
url='http://pypi.python.org/pypi/covenant',
license="BSD License",
packages=["covenant"],
keywords... |
Validate request body get and set fields | package co.paystack.android.api.request;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.HashMap;
/**
* Created by i on 24/08/2016.
*/
public class ValidateRequestBody extends BaseRequestBody implements Serializable {
public static final String FIELD_TRANS = "t... | package co.paystack.android.api.request;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.HashMap;
/**
* Created by i on 24/08/2016.
*/
public class ValidateRequestBody extends BaseRequestBody implements Serializable {
public static final String FIELD_TRANS = "t... |
Rename variables to avoid conflict. | 'use strict';
const menu = require('../common/menu');
const banner = require('../common/banner');
const donate = require('../common/donate');
const microgrants = require('../common/microgrants');
const passport = require('passport');
/* A controller for the admin page. */
function controller(app) {
app.get('/admin'... | 'use strict';
const menu = require('../common/menu');
const banner = require('../common/banner');
const donate = require('../common/donate');
const microgrants = require('../common/microgrants');
const passport = require('passport');
/* A controller for the admin page. */
function controller(app) {
app.get('/admin'... |
Set text color to blue | import React, { Component } from 'react'
import { theme } from '../../tools'
class NotFind extends Component {
render() {
const styles = {
notFind: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
color: theme.blue,
fontSize: '2em',
},
he... | import React, { Component } from 'react'
class NotFind extends Component {
render() {
const styles = {
notFind: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
color: '#ffffff',
fontSize: '2em',
position: 'absolute',
top: '25%',
... |
Set the vk key hex routine correctly | # Import nacl libs
import libnacl
import libnacl.encode
# Import python libs
import datetime
import binascii
class BaseKey(object):
'''
Include methods for key management convenience
'''
def hex_sk(self):
if hasattr(self, 'sk'):
return libnacl.encode.hex_encode(self.sk)
el... | # Import nacl libs
import libnacl
import libnacl.encode
# Import python libs
import datetime
import binascii
class BaseKey(object):
'''
Include methods for key management convenience
'''
def hex_sk(self):
if hasattr(self, 'sk'):
return libnacl.encode.hex_encode(self.sk)
el... |
Make cli spec runner work regardless of cur. dir | /* jshint node:true, strict:false */
var
path = require('path'),
requirejs = require('requirejs'),
jasmine = (function () {
var Jasmine = require('jasmine');
return new Jasmine({ projectBaseDir: path.resolve() });
}()),
$ = (function () {
var
doc = require('jsdom').jsdom(),
window ... | /* jshint node:true, strict:false */
var
requirejs = require('requirejs'),
jasmine = (function () {
var Jasmine = require('jasmine');
return new Jasmine({ projectBaseDir: require('path').resolve() });
}()),
$ = (function () {
var
doc = require('jsdom').jsdom(),
window = doc.parentWind... |
Fix bug with SQLAlchemy, change TEXT to STRING | from app import db
class Sprinkler(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(25))
status = db.Column(db.String(25))
flow = db.Column(db.Integer)
moisture = db.Column(db.Integer)
def __init__(self, name, status, flow, moisture):
self.name = name
... | from app import db
class Sprinkler(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.Text(25))
status = db.Column(db.Text(25))
flow = db.Column(db.Integer)
moisture = db.Column(db.Integer)
def __init__(self, name, status, flow, moisture):
self.name = name
... |
Use tracks 1-3 instead of 0-2, to make room for reserved track | from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(1)
s.track2 = s.engine.track(2)
s.track3 = s.engine.track(3)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | s.track1 | s
w... | from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(0)
s.track2 = s.engine.track(1)
s.track3 = s.engine.track(2)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | s.track1 | s
w... |
Move the construction of user credentials into parseUrl(), and only construct username and password if they're undefined (which is currently the case with phantomjs. | import Ember from "ember";
// We create an anchor since that is, afaik, the easiest way to parse a url in javascript
function parseUrl(url) {
let a = document.createElement('a');
a.href = url;
a.hostWithoutPort = a.host.substring(0, a.host.lastIndexOf(':')); // Remove port
// Workaround for HTMLAnchorElement ... | import Ember from "ember";
// We create an anchor since that is, afaik, the easiest way to parse a url in javascript
function parseUrl(url) {
let a = document.createElement('a');
a.href = url;
return a;
}
export default Ember.Controller.extend({
actions: {
setDrainFromDatabase(database) {
let connec... |
Fix whoopsie in single quotes vs double quotes example | <?php
require_once __DIR__.'/../vendor/autoload.php';
abstract class AbstractTest implements \mre\PHPench\TestInterface
{
protected $test;
function setUp($arrSize)
{
}
}
class TestSingleQuotes extends AbstractTest
{
public function execute() {
$test = 'hello' . 'this' . 'is' . 'a' . 'test'... | <?php
require_once __DIR__.'/../vendor/autoload.php';
abstract class AbstractTest implements \mre\PHPench\TestInterface
{
protected $test;
function setUp($arrSize)
{
}
}
class TestSingleQuotes extends AbstractTest
{
public function execute() {
$test = 'hello' . 'this' . 'is' . 'a' . 'test'... |
Change package name to use hyphen | #! /usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from csdms.dakota import __version__, plugin_script
setup(name='csdms-dakota',
version=__version__,
author='Mark Piper',
author_email='mark.piper@colorado.edu',
license='MIT',... | #! /usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from csdms.dakota import __version__, plugin_script
package_name = 'csdms.dakota'
setup(name=package_name,
version=__version__,
author='Mark Piper',
author_email='mark.piper@colora... |
Resolve namespace-level identifiers in the enclosing namespace. | <?php
namespace Phortress;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Class_;
/**
* Namespace Continuation Environments: these are continuation of namespaces
* for the purposes of variable declarations. When defining namespace-visible
* identifiers, e.g constants or functions, this sets it on the actual
* n... | <?php
namespace Phortress;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Class_;
/**
* Namespace Continuation Environments: these are continuation of namespaces
* for the purposes of variable declarations. When defining namespace-visible
* identifiers, e.g constants or functions, this sets it on the actual
* n... |
Initialize $_SERVER['SERVER_NAME'] with null when PHP_SAPI is cli | <?php
Event::add_before('system.ready', current(Event::get('system.ready')), 'multisite_fetch_appname');
function multisite_fetch_appname()
{
(PHP_SAPI == 'cli') AND $_SERVER['SERVER_NAME'] = Null;
// Fetch application name
preg_match('/^(.*)\.[^.]++\.[^.]++$/', $_SERVER['SERVER_NAME'], $appname);
$a... | <?php
Event::add_before('system.ready', current(Event::get('system.ready')), 'multisite_fetch_appname');
function multisite_fetch_appname()
{
// Fetch application name
preg_match('/^(.*)\.[^.]++\.[^.]++$/', $_SERVER['SERVER_NAME'], $appname);
$appname = isset($appname[1]) ? $appname[1] : Kohana::config('a... |
Fix asset `checksAfterTimeOut`, use valid global instance of `wTools` |
require( 'wTesting' );
// const _ = require( 'wTools' );
const _ = _globals_.testing.wTools;
_.include( 'wConsequence' );
//
function routine1( test )
{
test.description = 'description1';
console.log( 'v0' );
test.identical( 1, 1 );
test.description = 'description2';
_.time.out( 2000 );
_.time.out( 1000,... |
require( 'wTesting' );
const _ = require( 'wTools' );
_.include( 'wConsequence' );
//
function routine1( test )
{
test.description = 'description1';
console.log( 'v0' );
test.identical( 1, 1 );
test.description = 'description2';
_.time.out( 2000 );
_.time.out( 1000, () =>
{
console.log( 'v1' );
... |
Revert "updated MongoDB connection url"
This reverts commit ff376619996ac5a04489440932dbbe2b2b0ffa43. | var mongoose = require('mongoose');
var mongoUrl;
if (process.env.NODE_ENV === 'production') {
mongoUrl = process.env.OPENSHIFT_MONGODB_DB_URL + 'elixir';
mongoUrl = 'mongodb://' + process.env.MONGODB_USER + ':' + process.env.MONGODB_PASSWORD + '@' + process.env.MONGODB_IP + ':' + process.env.MONGODB_PORT + '/... | var mongoose = require('mongoose');
var mongoUrl;
if (process.env.NODE_ENV === 'production') {
mongoUrl = process.env.OPENSHIFT_MONGODB_DB_URL + 'elixir';
mongoUrl = 'mongodb://' + process.env.MONGODB_USER + ':' + process.env.MONGODB_PASSWORD + '@' + process.env.MONGODB_IP + ':' + process.env.MONGODB_PORT + '/... |
Fix bad namespace in @covers | <?php declare(strict_types=1);
namespace unit\Formatters;
use Mihaeu\PhpDependencies\DependencyHelper;
use Mihaeu\PhpDependencies\Formatters\DotFormatter;
/**
* @covers Mihaeu\PhpDependencies\Formatters\DotFormatter
*/
class DotFormatterTest extends \PHPUnit_Framework_TestCase
{
public function testFormatsSimp... | <?php declare(strict_types=1);
namespace unit\Formatters;
use Mihaeu\PhpDependencies\DependencyHelper;
use Mihaeu\PhpDependencies\Formatters\DotFormatter;
/**
* @covers unit\Formatters\DotFormatter
*/
class DotFormatterTest extends \PHPUnit_Framework_TestCase
{
public function testFormatsSimpleDependencies()
... |
Fix styles of new message notification | (function($){
var $bar;
window.xeNotifyMessage = function(text, count){
$bar = $('div.message.info');
if(!$bar.length) {
$bar = jQuery('<div class="message info"></div>').hide().css({
'position' : 'absolute',
'opacity' : 0.7,
'z-index' : 10000,
}).appendTo(document.body);
}
text = text.re... | (function($){
var $bar;
window.xeNotifyMessage = function(text, count){
$bar = $('div.message.info');
if(!$bar.length) {
$bar = $('<div class="message info" />')
.hide()
.css({
'position' : 'absolute',
'z-index' : '100',
})
.prependTo(document.body);
}
text = text.replace('%d... |
Use function to get defaultValue for slack channel IDs on Canvas model
Using a non-primitive is deprecated, since the values are shared. | import DS from 'ember-data';
import Ember from 'ember';
const { attr, belongsTo, hasMany } = DS;
const { computed, get } = Ember;
export default DS.Model.extend({
blocks: attr(),
isTemplate: attr(),
nativeVersion: attr(),
slackChannelIds: attr({ defaultValue: _ => [] }),
type: attr(),
version: attr(),
... | import DS from 'ember-data';
import Ember from 'ember';
const { attr, belongsTo, hasMany } = DS;
const { computed, get } = Ember;
export default DS.Model.extend({
blocks: attr(),
isTemplate: attr(),
nativeVersion: attr(),
slackChannelIds: attr({ defaultValue: [] }),
type: attr(),
version: attr(),
team:... |
Fix album art retrieved from Spotify
Remove double quotes around image URL retrieved from Spotify
by slicing one character more from left and one character
more from right.
Also, remove redundant code and null errors to console when
element is not found.
Signed-off-by: Tomas Slusny <71c4488fd0941e24cd13e3ad13ef1eb0a5... | var config = {
supports: {
playpause: true,
next: true,
previous: true
},
useLazyObserving: true,
playStateClass: 'playing',
nextSelector: '#next',
previousSelector: '#previous'
}
if (document.querySelector('#app-player')) { // Old Player
config.artworkImageSelector = '#cover-art .sp-image-im... | if (!!document.querySelector('#app-player')) { // Old Player
controller = new BasicController({
supports: {
playpause: true,
next: true,
previous: true
},
useLazyObserving: true,
frameSelector: '#app-player',
playStateSelector: '#play-pause',
playStateClass: 'playing',
playPaus... |
Fix issue while installation via pip
Signed-off-by: Lehner Florian <34c6fceca75e456f25e7e99531e2425c6c1de443@der-flo.net> | # Copyright 2016 Florian Lehner. All rights reserved.
#
# The contents of this file are 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 r... | # Copyright 2016 Florian Lehner. All rights reserved.
#
# The contents of this file are 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 r... |
Disable the default 'help' subcommand | package main
import (
"fmt"
"github.com/codegangsta/cli"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "docker-inject"
app.Usage = "Copy files/directories from hosts to running Docker containers"
app.Version = "0.0.0"
app.HideHelp = true
app.Flags = []cli.Flag{
cli.HelpFlag,
}
app.Action = func(c *... | package main
import (
"fmt"
"github.com/codegangsta/cli"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "docker-inject"
app.Usage = "Copy files/directories from hosts to running Docker containers"
app.Version = "0.0.0"
app.Action = func(c *cli.Context) {
inj, err := newInjector(os.Stderr, c.Args())
i... |
Change desc to clearly advertise that this is a library to work with
Google Cloud Endpoints | #!/usr/bin/env python
import setuptools
import os
setuptools.setup(
name='endpoints-proto-datastore',
version='0.9.0',
description='Google Cloud Endpoints Proto Datastore Library',
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
url='https://github.com/GoogleClo... | #!/usr/bin/env python
import setuptools
import os
setuptools.setup(
name='endpoints-proto-datastore',
version='0.9.0',
description='Endpoints Proto Datastore API',
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
url='https://github.com/GoogleCloudPlatform/endpoi... |
Remove commented code [ci skip]. | """From http://stackoverflow.com/a/12260597/400691"""
import sys
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'dbarray',
'HOST': 'localhost'
}
},
INSTALLED_APPS... | """From http://stackoverflow.com/a/12260597/400691"""
import sys
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'dbarray',
'HOST': 'localhost'
}
},
INSTALLED_APPS... |
Fix broken toggle - broken adjacent selector | import React from 'react';
import PropTypes from 'prop-types';
import { c } from 'ttag';
import Icon from '../icon/Icon';
const label = (key) => {
const I18N = {
on: c('Toggle button').t`On`,
off: c('Toggle button').t`Off`
};
return (
<span className="pm-toggle-label-text">
... | import React from 'react';
import PropTypes from 'prop-types';
import { c } from 'ttag';
import Checkbox from '../input/Checkbox';
import Icon from '../icon/Icon';
const label = (key) => {
const I18N = {
on: c('Toggle button').t`On`,
off: c('Toggle button').t`Off`
};
return (
<spa... |
Document the handling of nil. | package alice
import "net/http"
// A constructor for a piece of middleware.
// Most middleware use this constructor out of the box,
// so in most cases you can just pass somepackage.New
type Constructor func(http.Handler) http.Handler
type Chain struct {
constructors []Constructor
}
// Creates a new chain, memoriz... | package alice
import "net/http"
// A constructor for a piece of middleware.
// Most middleware use this constructor out of the box,
// so in most cases you can just pass somepackage.New
type Constructor func(http.Handler) http.Handler
type Chain struct {
constructors []Constructor
}
// Creates a new chain, memoriz... |
Split attrs, cattrs versions for py36, py37 | # -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages # noqa: H301
NAME = "looker_sdk"
VERSION = "0.1.3b20"
REQUIRES = [
"requests >= 2.22",
# Python 3.6
"attrs >= 18.2.0;python_version<'3.7'",
"cattrs < 1.1.0;python_version<'3.7'",
"python-dateutil;python_v... | # -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages # noqa: H301
NAME = "looker_sdk"
VERSION = "0.1.3b20"
REQUIRES = [
"requests >= 2.22",
"attrs >= 20.1.0",
"cattrs >= 1.0.0",
"python-dateutil;python_version<'3.7'",
"typing-extensions;python_version<'3.8'... |
Add Python 3 as Programming Language
Show support for Python 3 by adding classifier on setup.py | from setuptools import setup, find_packages
requirements = ['pycryptodome>=3.7.0']
setup(
name="ziggeo",
version="2.15",
description="Ziggeo SDK for python",
long_description="Ziggeo API (https://ziggeo.com) allows you to integrate video recording and playback with only two lines of code in your sit... | from setuptools import setup, find_packages
requirements = ['pycryptodome>=3.7.0']
setup(
name="ziggeo",
version="2.15",
description="Ziggeo SDK for python",
long_description="Ziggeo API (https://ziggeo.com) allows you to integrate video recording and playback with only two lines of code in your sit... |
Use ES6 export syntax in App | import React from 'react';
import {Decorator as Cerebral} from 'cerebral-view-react';
import NewTodoForm from '../NewTodo';
import TodosList from '../List';
import TodosFooter from '../Footer';
import visibleTodos from '../../modules/List/computed/visibleTodos.js';
@Cerebral({
todos: ['app', 'list', 'todos'],
isLo... | import React from 'react';
import {Decorator as Cerebral} from 'cerebral-view-react';
import NewTodoForm from '../NewTodo';
import TodosList from '../List';
import TodosFooter from '../Footer';
import visibleTodos from '../../modules/List/computed/visibleTodos.js';
@Cerebral({
todos: ['app', 'list', 'todos'],
isLo... |
Add tests for no \t and ' in index.html
Closes #82 | var assert = require("assert");
var fs = require("fs");
var html5Lint = require("html5-lint");
var _html = "";
describe("index.html", function() {
before(function() {
_html = fs.readFileSync("index.html", "utf8");
});
it("should have valid HTML", function(done) {
html5Lint(_html, function(... | var assert = require("assert");
var fs = require("fs");
var html5Lint = require("html5-lint");
describe("Splash Page", function() {
it("should have valid HTML", function(done) {
fs.readFile("index.html", "utf8", function(err, html) {
assert.ok(!err);
html5Lint(html, function(err, re... |
Change label for saving bookmark button | <?php
/**
* Copyright (c) 2011 Marvin Thomas Rabe <mrabe@marvinrabe.de>
* Copyright (c) 2011 Arthur Schiwon <blizzz@arthur-schiwon.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
?>
<input type="hidden" id="bookmarkFilterTag" value="<?ph... | <?php
/**
* Copyright (c) 2011 Marvin Thomas Rabe <mrabe@marvinrabe.de>
* Copyright (c) 2011 Arthur Schiwon <blizzz@arthur-schiwon.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
?>
<input type="hidden" id="bookmarkFilterTag" value="<?ph... |
Add player name from props | import React, {Component} from 'react';
import {Table} from 'react-bootstrap';
import {connect} from 'react-redux';
import _ from 'lodash';
class UsersTable extends Component {
render() {
return (
<div className="tbl-scroll">
<Table responsive striped>
<tbody>
<tr>
... | import React, {Component} from 'react';
import {Table} from 'react-bootstrap';
import {connect} from 'react-redux';
import _ from 'lodash';
class UsersTable extends Component {
render() {
return (
<div className="tbl-scroll">
<Table responsive striped>
<tbody>
<tr>
... |
Fix test on python 3.3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.test import TestCase
from tags.models import Tag
from .models import Food
class TestFoodModel(TestCase):
def test_create_food(self):
food = Food.objects.create(
name="nacho",
tags="tort... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.test import TestCase
from tags.models import Tag
from .models import Food
class TestFoodModel(TestCase):
def test_create_food(self):
food = Food.objects.create(
name="nacho",
tags="tort... |
Disable unreliable local client test | describe("local client", function() {
var fs = require("fs-extra");
var setup = require("../controllers/setup");
global.test.blog();
// Sets up a temporary tmp folder and cleans it up after
global.test.tmp();
// This causes an error
xit("handles new file when setting up", function(done) {
fs.output... | describe("local client", function() {
var fs = require("fs-extra");
var setup = require("../controllers/setup");
global.test.blog();
// Sets up a temporary tmp folder and cleans it up after
global.test.tmp();
it("handles new file when setting up", function(done) {
fs.outputFileSync(this.tmp + "/" + "... |
Update dsub version to 0.4.2
PiperOrigin-RevId: 337172014 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# 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 a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# 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 a... |
Make UsersResource reusable for LDAP | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from .users ... | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from .users ... |
TST: Test sqlite and mongoquery variations. | import os
import tempfile
import shutil
import tzlocal
import pytest
import portable_mds.mongoquery.mds
import portable_mds.sqlite.mds
variations = [portable_mds.mongoquery.mds,
portable_mds.sqlite.mds]
@pytest.fixture(params=variations, scope='function')
def mds_all(request):
'''Provide a function ... | import os
import tempfile
import shutil
import tzlocal
import pytest
from ..mongoquery.mds import MDS
@pytest.fixture(params=[1], scope='function')
def mds_all(request):
'''Provide a function level scoped FileStore instance talking to
temporary database on localhost:27017 with both v0 and v1.
'''
ver... |
Clean up code for JsHint | /*global console, require, module*/
(function () {
"use strict";
// Establish the root object, `window` in the browser, or `global` on the server.
var root, Instructor, setup, isNode;
root = this;
// Create a reference to this
Instructor = function (fString) {
var self = this;
... | (function () {
// Establish the root object, `window` in the browser, or `global` on the server.
var root = this;
// Create a reference to this
var Instructor = function (fString) {
var self = this;
self._fRef = new root.Firebase(fString);
self._create = ... |
Add 'public' field to ActionAdmin list display | from django.contrib import admin
from actstream import models
# Use django-generic-admin widgets if available
try:
from genericadmin.admin import GenericAdminModelAdmin as ModelAdmin
except ImportError:
ModelAdmin = admin.ModelAdmin
class ActionAdmin(ModelAdmin):
date_hierarchy = 'timestamp'
list_dis... | from django.contrib import admin
from actstream import models
# Use django-generic-admin widgets if available
try:
from genericadmin.admin import GenericAdminModelAdmin as ModelAdmin
except ImportError:
ModelAdmin = admin.ModelAdmin
class ActionAdmin(ModelAdmin):
date_hierarchy = 'timestamp'
list_dis... |
Change to headless chrome in CI | // Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-... | // Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-... |
Support testscenarios by default in BaseTestCase
This allows one to use the scenario framework easily
from any test class.
Change-Id: Ie736138fe2d1e1d38f225547dde54df3f4b21032 | # -*- coding: utf-8 -*-
#
# Copyright 2013 - Noorul Islam K M
#
# 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 applic... | # -*- coding: utf-8 -*-
#
# Copyright 2013 - Noorul Islam K M
#
# 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 applic... |
Create project API responses the projects list | 'use strict';
// External Modules -----------------------------------------------------
const express = require('express');
// My own Modules ------------------------------------------------------
const Project = require('../database/projects/project.model');
// Definitions -------------------------------------------... | 'use strict';
// External Modules -----------------------------------------------------
const express = require('express');
// My own Modules ------------------------------------------------------
const Project = require('../database/projects/project.model');
// Definitions -------------------------------------------... |
Add @RestController to default server config | /**
* Copyright 2015 The OpenZipkin Authors
*
* 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 agree... | /**
* Copyright 2015 The OpenZipkin Authors
*
* 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 agree... |
Add an error call back param
This allows you to set an onError callback function in case the map doesn't load correctly. | export const GoogleApi = function(opts) {
opts = opts || {};
if (!opts.hasOwnProperty('apiKey')) {
throw new Error('You must pass an apiKey to use GoogleApi');
}
const apiKey = opts.apiKey;
const libraries = opts.libraries || ['places'];
const client = opts.client;
const URL = opts.url || 'https://m... | export const GoogleApi = function(opts) {
opts = opts || {};
if (!opts.hasOwnProperty('apiKey')) {
throw new Error('You must pass an apiKey to use GoogleApi');
}
const apiKey = opts.apiKey;
const libraries = opts.libraries || ['places'];
const client = opts.client;
const URL = opts.url || 'https://m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.