text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Update the PyPI version to 7.0.1. | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.1',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
... |
Store game state in global var | var express = require('express');
var http = require('http');
var socketIO = require('socket.io');
var path = require('path');
var game = require('./game.js');
var app = express();
var server = http.Server(app);
var io = socketIO(server);
app.set('views', path.join(__dirname, 'templates'));
app.set('view engine', 'ja... | var express = require('express');
var http = require('http');
var socketIO = require('socket.io');
var path = require('path');
var game = require('./game.js');
var app = express();
var server = http.Server(app);
var io = socketIO(server);
app.set('views', path.join(__dirname, 'templates'));
app.set('view engine', 'ja... |
Add instruction about interpreter selection | <?php
/**
* Simple Breakpoints
*
* Tell the interpreter to pause execution and inspect variables.
*
* Ctrl+F8 (Windows/Linux)
* Command+F8 (Mac OS X)
*/
namespace Debugging1\JetBrains;
$name = 'Maarten';
// 0. PhpStorm has already preconfigured "PHP 7.1 with XDebug" interpreter with enabled XDebug. Please make... | <?php
/**
* Simple Breakpoints
*
* Tell the interpreter to pause execution and inspect variables.
*
* Ctrl+F8 (Windows/Linux)
* Command+F8 (Mac OS X)
*/
namespace Debugging1\JetBrains;
$name = 'Maarten';
// 1. Place a breakpoint on the following line of code.
$name = 'Mikhail';
for ($i = 0; $i < 5; $i++) {
... |
Allow component styles to be editable in React Dev Tools | import flattenStyle from './flattenStyle';
import StyleRegistry from './registry';
// allow component styles to be editable in React Dev Tools
if (process.env.NODE_ENV !== 'production') {
const { canUseDOM } = require('fbjs/lib/ExecutionEnvironment');
if (canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
w... | import flattenStyle from './flattenStyle';
import StyleRegistry from './registry';
const absoluteFillObject = {
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0
};
const absoluteFill = StyleRegistry.register(absoluteFillObject);
const StyleSheet = {
absoluteFill,
absoluteFillObject,
create(s... |
Refactor magic strings into a constant.
git-svn-id: de5ce936019686f47409c93bcc5e202a9739563b@1594249 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 may n... | /*
* 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 may n... |
Add vars & disable auto pausing | /*
* boot.js
* Sets up game and loads preloader assets
*/
/* Sets a global object to hold all the states of the game */
YINS = {
/* declare global variables, these will persist across different states */
score: 0,
/* Declare global colors used throughout the game
Usage example: YINS.color.purple */
c... | /*
* boot.js
* Sets up game and loads preloader assets
*/
/* Sets a global object to hold all the states of the game */
YINS = {
/* declare global variables, these will persist across different states */
score: 0,
/* Declare global colors used throughout the game
Usage example: YINS.color.purple */
c... |
Add method to get admin users. | module.exports = function(r) {
'use strict';
return {
allByProject: allByProject,
adminUsers: adminUsers,
};
function allByProject() {
return r.table('access').run().then(function(allAccess) {
let byProject = {};
allAccess.forEach(function(a) {
... | module.exports = function(r) {
'use strict';
return {
allByProject: allByProject
};
function allByProject() {
return r.table('access').run().then(function(allAccess) {
let byProject = {};
allAccess.forEach(function(a) {
if (!(a.project_id in byPr... |
Add error handling to station endpoint | """
Michael duPont - michael@mdupont.com
avwx_api.views - Routes and views for the Quart application
"""
# pylint: disable=W0702
# stdlib
from dataclasses import asdict
# library
import avwx
from quart import Response, jsonify
from quart_openapi.cors import crossdomain
# module
from avwx_api import app
# Static Web ... | """
Michael duPont - michael@mdupont.com
avwx_api.views - Routes and views for the Quart application
"""
# pylint: disable=W0702
# stdlib
from dataclasses import asdict
# library
import avwx
from quart import Response, jsonify
from quart_openapi.cors import crossdomain
# module
from avwx_api import app
# Static Web ... |
Update device revoke icon margin | // @flow
import React from 'react'
import type {Props} from './index.render'
import {Confirm, Box, Text, Icon} from '../../common-adapters'
import {globalStyles, globalColors} from '../../styles/style-guide'
import type {Props as IconProps} from '../../common-adapters/icon'
const Render = ({name, type, deviceID, curr... | // @flow
import React from 'react'
import type {Props} from './index.render'
import {Confirm, Box, Text, Icon} from '../../common-adapters'
import {globalStyles, globalColors} from '../../styles/style-guide'
import type {Props as IconProps} from '../../common-adapters/icon'
const Render = ({name, type, deviceID, curr... |
Fix support for SSL for proxied sites, or otherwise uncertain situations
My particular situation is deployed through ElasticBeanstalk, proxying
HTTPS to HTTP on the actual endpoints. This makes flask think that it is
only running with http, not https | from jinja2 import Markup
from flask import current_app, request
class _pagedown(object):
def include_pagedown(self):
return Markup('''
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudfla... | from jinja2 import Markup
from flask import current_app, request
class _pagedown(object):
def include_pagedown(self):
if request.is_secure:
protocol = 'https'
else:
protocol = 'http'
return Markup('''
<script type="text/javascript" src="{0}://cdnjs.cloudflare.com/aja... |
Fix typo in user script gen, s/versiom/version/ | #!/usr/bin/env node
// Note: This is written in a semi-generic way, but only supports 1 script.
const manifestPath = __dirname + '/manifest.json';
const outPath = __dirname + '/dont-track-me-google.user.js';
const fs = require('fs');
const manifest = JSON.parse(fs.readFileSync(manifestPath));
const content_script0 = ... | #!/usr/bin/env node
// Note: This is written in a semi-generic way, but only supports 1 script.
const manifestPath = __dirname + '/manifest.json';
const outPath = __dirname + '/dont-track-me-google.user.js';
const fs = require('fs');
const manifest = JSON.parse(fs.readFileSync(manifestPath));
const content_script0 = ... |
Fix of license header.
P.S. Last two commits (fa1eb4, de784f) were reviewed by M. Grebac, M. Vojtek
Signed-off-by: Marcel Valovy <ef00af7100c873d895802f1bb3b3980ada420991@oracle.com> | /**
* ****************************************************************************
* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. ... | package org.eclipse.persistence.testing.jaxb.beanvalidation.special;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
/**
* ****************************************************************************
* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights ... |
Add recent changes to compressed version | (function(e){e.Model.extend=e.Collection.extend=e.Router.extend=e.View.extend=function(e,t){var r=n(this,e,t);r.extend=this.extend;return r};var t=function(){},n=function(e,n,r){var i,s=e.prototype,o=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;if(n&&n.hasOwnProperty("constructor")){i=n.constructor}else{i=function(){e... | (function(a){a.Model.extend=a.Collection.extend=a.Router.extend=a.View.extend=function(a,b){var d=c(this,a,b);d.extend=this.extend;return d};var b=function(){},c=function(a,c,d){var e,f=a.prototype,g=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;if(c&&c.hasOwnProperty("constructor")){e=c.constructor}else{e=function(){a... |
Test list command after the installation | <?php
use PhpBrew\Testing\CommandTestCase;
class InstallCommandTest extends CommandTestCase
{
/**
* @outputBuffering enabled
*/
public function testInstallCommandLatestMinorVersion() {
$this->assertTrue($this->runCommand("phpbrew --quiet install 5.4")); // we will likely get 5.4.34 - 2014-11-... | <?php
use PhpBrew\Testing\CommandTestCase;
class InstallCommandTest extends CommandTestCase
{
/**
* @outputBuffering enabled
*/
public function testInstallCommandLatestMinorVersion() {
$this->assertTrue($this->runCommand("phpbrew --quiet install 5.4")); // we will likely get 5.4.34 - 2014-11-... |
Sort extracted messages by key | import fs from 'fs'
import { sync as globSync } from 'glob'
import { sync as mkdirpSync } from 'mkdirp'
const MESSAGES_PATTERN = './_translations/**/*.json'
const LANG_DIR = './_translations/lang/'
// Aggregates the default messages that were extracted from the example app's
// React components via the React ... | import fs from 'fs'
import { sync as globSync } from 'glob'
import { sync as mkdirpSync } from 'mkdirp'
const MESSAGES_PATTERN = './_translations/**/*.json'
const LANG_DIR = './_translations/lang/'
// Aggregates the default messages that were extracted from the example app's
// React components via the React ... |
Add pandas as requirement for the project | from setuptools import setup
REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox'
setup(
author='Serenata de Amor',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language... | from setuptools import setup
REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox'
setup(
author='Serenata de Amor',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language... |
Update up to changes to QueryHandler | // Handle search query states
// Listens for changes in query string, then ensures that provided values are coherent,
// and if all is fine emits valid query objects
// (which are usually consumed by list managers to update state of tables)
'use strict';
var ensureObject = require('es5-ext/object/valid-object')
... | // Handle search query states
// Listens for changes in query string, then ensures that provided values are coherent,
// and if all is fine emits valid query objects
// (which are usually consumed by list managers to update state of tables)
'use strict';
var ensureObject = require('es5-ext/object/valid-object')
... |
Remove hardcoded AddThis ID, made migrations and form changes to store it in database. | <?php namespace app\Helpers\Validators;
use Illuminate\Validation\Validator;
/**
* Class MainMetaValidator
*
* A class to handle validation of main meta
* updates and creation.
*
* @author Rob Attfield <emailme@robertattfield.com> <http://www.robertattfield.com>
* @package app\Helpers\Validators
*/
class Main... | <?php namespace app\Helpers\Validators;
use Illuminate\Validation\Validator;
/**
* Class MainMetaValidator
*
* A class to handle validation of main meta
* updates and creation.
*
* @author Rob Attfield <emailme@robertattfield.com> <http://www.robertattfield.com>
* @package app\Helpers\Validators
*/
class Main... |
Change server default option values | package main
import (
"flag"
"net"
"github.com/hnakamur/rdirsync"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
)
func main() {
var enableTLS bool
flag.BoolVar(&enableTLS, "enable-tls", false, "enable TLS")
var certFile string
flag.StringVar(&certFile, "cer... | package main
import (
"flag"
"net"
"github.com/hnakamur/rdirsync"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
)
func main() {
var enableTLS bool
flag.BoolVar(&enableTLS, "enable-tls", false, "enable TLS")
var certFile string
flag.StringVar(&certFile, "cer... |
Define our plan of action for the code | <?php
function insert($xml)
{
//Standard SQL connection stuff
$linkID = mysql_connect("localhost", "root", "") or die ("Could not connect to database!");
mysql_select_db("agora", $linkID) or die ("Could not find database");
//Dig the Map ID out of the XML
//Check to see if the map already exi... | <?php
function insert($map_id)
{
//Standard SQL connection stuff
$linkID = mysql_connect("localhost", "root", "") or die ("Could not connect to database!");
mysql_select_db("agora", $linkID) or die ("Could not find database");
$whereclause = mysql_real_escape_string("$mapID");
//Set up the basics... |
Add example for query datetime range | #!/usr/bin/env python
from config import MongoSource
from manager import PluginManager
from log import LogDocGenerator
import datetime
def main():
# 1. load all plugins
plugin_manager = PluginManager()
# 2. get one or more mongodb collection
ms = MongoSource()
collection = ms.get_collection("ne... | #!/usr/bin/env python
from config import MongoSource
from manager import PluginManager
from log import LogDocGenerator
def main():
# 1. load all plugins
plugin_manager = PluginManager()
# 2. get one or more mongodb collection
ms = MongoSource()
collection = ms.get_collection("net-test", "ename_... |
Update migration script for users whose usernames aren't in emails field
OSF-5462
Previously the script only migrated users who had an empty emails
field. This updates the script to also handle users whose username
isn't in the emails field, even when the emails field isn't empty | """Ensure that confirmed users' usernames are included in their emails field.
"""
import logging
import sys
from modularodm import Q
from website import models
from website.app import init_app
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
def main():
# Set up storage backend... | """Ensure that users with User.emails == [] have User.username inserted.
"""
import logging
import sys
from modularodm import Q
from nose.tools import *
from website import models
from website.app import init_app
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
def main():
# S... |
Fix spec failing over year with default options | var banner = require('./');
var chai = require('chai');
var expect = chai.expect;
describe('banner', function() {
var FILEPATH = 'test-target.js';
context('without options (using defaults)', function() {
var year = new Date().getFullYear();
var expectation = '/*!\n * add-banner <https://github.com/jonsc... | var banner = require('./');
var chai = require('chai');
var expect = chai.expect;
describe('banner', function() {
var FILEPATH = 'test-target.js';
context('without options (using defaults)', function() {
var expectation = '/*!\n * add-banner <https://github.com/jonschlinkert/add-banner>\n *\n * Copyright (c)... |
Add sample points API call | 'use strict';
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var wims = new XMLHttpRequest();
wims.open("GET", "http://env... | var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var wims = new XMLHttpRequest();
wims.open("GET", "http://environment.data.g... |
Fix NavListItem title property type declaration | /**
*
* NavItem
*
*/
import React from 'react';
import { Link } from 'react-router';
import { ListItem } from 'material-ui/List';
import * as Colors from 'material-ui/styles/colors';
function NavListItem(props) {
const borderRadiusSize = 2;
const linkStyle = {
textDecoration: 'none',
borderRadius: borderR... | /**
*
* NavItem
*
*/
import React from 'react';
import { Link } from 'react-router';
import { ListItem } from 'material-ui/List';
import * as Colors from 'material-ui/styles/colors';
function NavListItem(props) {
const borderRadiusSize = 2;
const linkStyle = {
textDecoration: 'none',
borderRadius: borderR... |
Remove PDF_AD from stats list | # Licensed under an MIT open source license - see LICENSE
'''
Returns a list of all available distance metrics
'''
statistics_list = ["Wavelet", "MVC", "PSpec", "Bispectrum", "DeltaVariance",
"Genus", "VCS", "VCA", "Tsallis", "PCA", "SCF", "Cramer",
"Skewness", "Kurtosis", "VCS_Den... | # Licensed under an MIT open source license - see LICENSE
'''
Returns a list of all available distance metrics
'''
statistics_list = ["Wavelet", "MVC", "PSpec", "Bispectrum", "DeltaVariance",
"Genus", "VCS", "VCA", "Tsallis", "PCA", "SCF", "Cramer",
"Skewness", "Kurtosis", "VCS_Den... |
Return lines from plot command | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. This command
a... | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. This command
a... |
Add "pyyaml" because it is used by ScrambleSuit. | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
import versioneer
versioneer.versionfile_source = 'obfsproxy/_version.py'
versioneer.versionfile_build = 'obfsproxy/_version.py'
versioneer.tag_prefix = 'obfsproxy-' # tags are like 1.2.0
versioneer.parentdir_prefix = 'obfsproxy-' # dirname... | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
import versioneer
versioneer.versionfile_source = 'obfsproxy/_version.py'
versioneer.versionfile_build = 'obfsproxy/_version.py'
versioneer.tag_prefix = 'obfsproxy-' # tags are like 1.2.0
versioneer.parentdir_prefix = 'obfsproxy-' # dirname... |
Use correct path to config | <?php
namespace CedricZiel\L5Shariff;
use Illuminate\Support\ServiceProvider;
/**
* Class ShariffServiceProvider
* Registers the Heise Shariff components to your application.
*
* @package CedricZiel\L5Shariff
*/
class ShariffServiceProvider extends ServiceProvider
{
/**
* Registers routes and templates... | <?php
namespace CedricZiel\L5Shariff;
use Illuminate\Support\ServiceProvider;
/**
* Class ShariffServiceProvider
* Registers the Heise Shariff components to your application.
*
* @package CedricZiel\L5Shariff
*/
class ShariffServiceProvider extends ServiceProvider
{
/**
* Registers routes and templates... |
Use __dict__ instead of to_dict() | from pywatson.answer.answer import Answer
from pywatson.question.question import Question
import requests
class Watson(object):
"""The Watson API adapter class"""
def __init__(self, url, username, password):
self.url = url
self.username = username
self.password = password
def ask... | from pywatson.answer.answer import Answer
from pywatson.question.question import Question
import requests
class Watson:
"""The Watson API adapter class"""
def __init__(self, url, username, password):
self.url = url
self.username = username
self.password = password
def ask_questio... |
Add live-reload to watch task | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
debug: {
files: {
'public/assets/js/app.debug.js': ['app/ui/static/js/app.js']
},
options: {
bundleOptions: {
debug: true
}
... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
debug: {
files: {
'public/assets/js/app.debug.js': ['app/ui/static/js/app.js']
},
options: {
bundleOptions: {
debug: true
}
... |
Fix memoized docker image pull | import execa from 'execa'
import promiseMemoize from 'p-memoize'
import debugLog from '../../../debugLog.js'
export default class DockerImage {
constructor(imageNameTag) {
this._imageNameTag = imageNameTag
}
static async _pullImage(imageNameTag) {
debugLog(`Downloading base Docker image... (${imageNameT... | import execa from 'execa'
import promiseMemoize from 'p-memoize'
import debugLog from '../../../debugLog.js'
export default class DockerImage {
constructor(imageNameTag) {
this._imageNameTag = imageNameTag
}
static async _pullImage(imageNameTag) {
debugLog(`Downloading base Docker image... (${imageNameT... |
Fix Device model, not needed to set last_seen on creation | import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
model = mod... | import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
model = mod... |
Add SES_REGION to local environment file
The region used by SES was hardcoded into the config file, when all other values were set as environment variables. Tweaked to keep the region consistent with other config options | <?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, ... | <?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, ... |
Install initscript link into /etc/init.d. Allows for system integration while the original file can still be modified | import os
from fabric.api import put, task, sudo
from fablib import authbind, requires_root
from fablib.twisted import service
@task
@requires_root
def install():
# TODO:
# - Setup zone files (incl. PYTHONPATH in script if needed)
# - Rename dns to t-names or whatever (locations, scripts,...)
# Boo... | import os
from fabric.api import put, task
from fablib import authbind, requires_root
from fablib.twisted import service
@task
@requires_root
def install():
# TODO:
# - Setup zone files (incl. PYTHONPATH in script if needed)
# - Rename dns to t-names or whatever (locations, scripts,...)
# Bootstrap... |
Fix migration for running PostgreSQL. | 'use strict';
const Schema = use('Schema');
class BlogPostSchema extends Schema {
up () {
this.create('blog_posts', (table) => {
table.increments();
table.integer('category_id').references('id').inTable('blog_categories');
table.integer('user_id').references('id').inTable('users');
table... | 'use strict';
const Schema = use('Schema');
class BlogPostSchema extends Schema {
up () {
this.create('blog_posts', (table) => {
table.increments();
table.integer('category_id').unsigned().references('id').inTable('blog_categories');
table.integer('user_id').unsigned().references('id').inTable... |
Edit inline nodes which goes one after another. | import Command from './Command'
class EditInlineNodeCommand extends Command {
constructor(...args) {
super(...args)
if (!this.config.nodeType) {
throw new Error('Every AnnotationCommand must have a nodeType')
}
}
getCommandState(params) {
let sel = params.selection
let newState = {
... | import Command from './Command'
class EditInlineNodeCommand extends Command {
constructor(...args) {
super(...args)
if (!this.config.nodeType) {
throw new Error('Every AnnotationCommand must have a nodeType')
}
}
getCommandState(params) {
let sel = params.selection
let newState = {
... |
Exclude more characters at the end of a link. | import re
urlExp = re.compile("(\w+)://[^ \t\"'<>]+[^ \t\"'<>,.)]")
def URLToTag(message):
"""
searches for an URL in message and sets an <a>-tag arround
it, then returns the new string
"""
lastEnd = 0
while True:
match = urlExp.search(message, lastEnd)
if not match:
break
mStart = match.start()
m... | import re
urlExp = re.compile("(\w+)://[^ \t\"'<>]+[^ \t\"'<>,.]")
def URLToTag(message):
"""
searches for an URL in message and sets an <a>-tag arround
it, then returns the new string
"""
lastEnd = 0
while True:
match = urlExp.search(message, lastEnd)
if not match:
break
mStart = match.start()
mE... |
Disable debug and trace log when run tests. | <?php
require_once __DIR__ . "/config.php";
require_once __DIR__ . "/toolkit/RandStr.php";
require_once __DIR__ . "/toolkit/TcpStat.php";
require_once __DIR__ . "/toolkit/functions.php";
ini_set("assert.active", 1);
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 1);
assert_options(ASSERT_BAIL, 0);... | <?php
require_once __DIR__ . "/config.php";
require_once __DIR__ . "/toolkit/RandStr.php";
require_once __DIR__ . "/toolkit/TcpStat.php";
require_once __DIR__ . "/toolkit/functions.php";
ini_set("assert.active", 1);
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 1);
assert_options(ASSERT_BAIL, 0);... |
Add timestamp to wikipedia queries | /**
* Created by codaphillips on 4/18/15.
*/
(function() {
angular.module('wikiMiner.services.query_api', ['ngResource'])
.factory('query_api', ['$resource', function($resource){
return $resource('http://104.236.226.8/w/api.php', {
action:'query',
prop:'revision... | /**
* Created by codaphillips on 4/18/15.
*/
(function() {
angular.module('wikiMiner.services.query_api', ['ngResource'])
.factory('query_api', ['$resource', function($resource){
return $resource('http://104.236.226.8/w/api.php', {
action:'query',
prop:'revision... |
Add documentation and tidy up a bit
git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-1@349151 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: 27e9d82281f1ffccef29acba25b279d8ebca551c | /*
* Copyright 2001-2005 The Apache Software Foundation.
*
* 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 appli... | /*
* Copyright 2001-2005 The Apache Software Foundation.
*
* 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 appli... |
Update ``maps`` to use the ``json_response`` function. | from django.template.response import TemplateResponse
from us_ignite.common.response import json_response
from us_ignite.maps.models import Location
def location_list(request):
"""Shows a list of locations in a map."""
object_list = Location.published.select_related('category').all()
context = {
... | import json
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse
from django.template.response import TemplateResponse
from us_ignite.maps.models import Location
def location_list(request):
"""Shows a list of locations in a map."""
object_list = Location.published.... |
Remove assumption that spaces are always valid separators | var _ = require('lodash');
var tokenSeparator = '■';
exports.tokenSeparator = tokenSeparator;
exports.removeStopwords = function(text, options) {
var defaults = {
'stopwords': require('./stopwords_en.js').words,
'inputSeparator': /[\\., ]+/,
'outputSeparator': ' '
}
options = _.defaults(options || {... | var _ = require('lodash');
exports.removeStopwords = function(text, options) {
var defaults = {
'stopwords': require('./stopwords_en.js').words,
'inputSeparator': /[\\., ]+/,
'outputSeparator': ' '
}
options = _.defaults(options || {}, defaults);
var tokens = text.split(options.inputSeparator);
t... |
Fix build event listener method name | <?php
/**
*
* @author h.woltersdorf
*/
namespace Fortuneglobe\IceHawk;
use Fortuneglobe\IceHawk\Exceptions\EventListenerMethodNotCallable;
use Fortuneglobe\IceHawk\Interfaces\ListensToIceHawkEvents;
use Fortuneglobe\IceHawk\Interfaces\ServesIceHawkEventData;
/**
* Class IceHawkEventListener
*
* @package Fortun... | <?php
/**
*
* @author h.woltersdorf
*/
namespace Fortuneglobe\IceHawk;
use Fortuneglobe\IceHawk\Exceptions\EventListenerMethodNotCallable;
use Fortuneglobe\IceHawk\Interfaces\ListensToIceHawkEvents;
use Fortuneglobe\IceHawk\Interfaces\ServesIceHawkEventData;
/**
* Class IceHawkEventListener
*
* @package Fortun... |
Update test suite generator to import tests in source_test. | #! /usr/bin/env python
#
# test_suite.py
#
# Copyright (c) 2015-2016 Junpei Kawamoto
#
# This software is released under the MIT License.
#
# http://opensource.org/licenses/mit-license.php
#
""" Test suite.
"""
from __future__ import absolute_import
import sys
import unittest
from . import downloader_test
from . impor... | #! /usr/bin/env python
#
# test_suite.py
#
# Copyright (c) 2015-2016 Junpei Kawamoto
#
# This software is released under the MIT License.
#
# http://opensource.org/licenses/mit-license.php
#
""" Test suite.
"""
from __future__ import absolute_import
import sys
import unittest
from . import downloader_test
def suite()... |
Fix NPE when using keyboard | package openperipheral.addons.glasses;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import openperipheral.addons.OpenPeripheralAddons;
import openperiph... | package openperipheral.addons.glasses;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import openperipheral.addons.OpenPeripheralAddons;
import openperiph... |
Add extra field to detail output | from flask.ext.restful import fields
from meta import BasicResource
from config.pins import PinManager
MANAGER = PinManager()
class Pin(BasicResource):
def __init__(self):
super(Pin, self).__init__()
self.fields = {
"num": fields.Integer,
"mode": fields.String,
... | from flask.ext.restful import fields
from meta import BasicResource
from config.pins import PinManager
MANAGER = PinManager()
class Pin(BasicResource):
def __init__(self):
super(Pin, self).__init__()
self.fields = {
"num": fields.Integer,
"mode": fields.String,
... |
Use the deferred register now for potions | package info.u_team.u_team_test.init;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.potion.RadiationPotion;
import net.minecraft.potion.Potion;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.fml.common.Mod.EventBusSubsc... | package info.u_team.u_team_test.init;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.potion.RadiationPotion;
import net.minecraft.potion.Potion;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mo... |
Fix bug when deciding if file is supported. | package net.sourceforge.javydreamercsw.validation.manager.web.file;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
/**
*
* @author Javier A. Ortiz Bultron <javier.ortiz.78@gmail.com>
*/
public abstract class AbstractFileDisplay implements IFileDisplay {
@Override
... | package net.sourceforge.javydreamercsw.validation.manager.web.file;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
/**
*
* @author Javier A. Ortiz Bultron <javier.ortiz.78@gmail.com>
*/
public abstract class AbstractFileDisplay implements IFileDisplay {
@Override
... |
Add getSlotCapacity method in fluid slot | package info.u_team.u_team_core.container;
import info.u_team.u_team_core.api.fluid.IFluidHandlerModifiable;
import net.minecraftforge.fluids.FluidStack;
public class FluidSlot {
private final IFluidHandlerModifiable fluidHandler;
private final int index;
private final int x;
private final int y;
public Flui... | package info.u_team.u_team_core.container;
import info.u_team.u_team_core.api.fluid.IFluidHandlerModifiable;
import net.minecraftforge.fluids.FluidStack;
public class FluidSlot {
private final IFluidHandlerModifiable fluidHandler;
private final int index;
private final int x;
private final int y;
public Flui... |
Fix initialization errors if MapbenderDataSourceBundle is not registered in kernel | <?php
namespace Mapbender\DigitizerBundle;
use Mapbender\CoreBundle\Component\MapbenderBundle;
use Mapbender\DataSourceBundle\MapbenderDataSourceBundle;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
... | <?php
namespace Mapbender\DigitizerBundle;
use Mapbender\CoreBundle\Component\MapbenderBundle;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
/**
* Digitizer Bundle.
*
* @author Andriy Oblivantsev... |
Use decimal value instead of octal one | package com.nilhcem.droidcontn.data.app.model;
import android.os.Build;
import android.os.Parcel;
import com.nilhcem.droidcontn.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import org.threeten.bp.Loc... | package com.nilhcem.droidcontn.data.app.model;
import android.os.Build;
import android.os.Parcel;
import com.nilhcem.droidcontn.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import org.threeten.bp.Loc... |
Mark internal/technical tasks with an _ | /* === PLUGINS === */
const gulp = require('gulp'),
rimraf = require('gulp-rimraf'),
webpack = require('webpack-stream'),
path = require('path'),
sequence = require('run-sequence');
/* === CONFIG === */
const src = 'src/**/*',
cfg = require('./webpack.config.js');
/* === TASKS === */
gulp.task('cl... | /* === PLUGINS === */
const gulp = require('gulp'),
rimraf = require('gulp-rimraf'),
webpack = require('webpack-stream'),
path = require('path'),
sequence = require('run-sequence');
/* === CONFIG === */
const src = 'src/**/*',
cfg = require('./webpack.config.js');
/* === TASKS === */
gulp.task('cl... |
MP3: Move files/tracklist count check to function | #!/usr/bin/python3
import ID3
import os
import sys
def read_tracklist():
tracklist = []
for line in sys.stdin:
tracklist.append(line)
return tracklist
def match_length(files, tracklist):
if len(files) != len(tracklist):
raise RuntimeError(
str(len(tracklist)) +
... | #!/usr/bin/python3
import ID3
import os
import sys
def read_tracklist():
tracklist = []
for line in sys.stdin:
tracklist.append(line)
return tracklist
tracklist = read_tracklist()
mp3_extension = ".mp3"
files_all = os.listdir('.')
files = []
for f in files_all:
# Prune directories
if n... |
Switch to using export statements | export configureUrlQuery from './configureUrlQuery';
export * as Serialize, { encode, decode } from './serialize';
export {
replaceInUrlQuery,
replaceUrlQuery,
pushInUrlQuery,
pushUrlQuery,
} from './updateUrlQuery';
export UrlQueryParamTypes from './UrlQueryParamTypes';
export UrlUpdateTypes from './UrlUpdate... | import configureUrlQuery from './configureUrlQuery';
import * as Serialize from './serialize';
import {
replaceInUrlQuery,
replaceUrlQuery,
pushInUrlQuery,
pushUrlQuery,
} from './updateUrlQuery';
import UrlQueryParamTypes from './UrlQueryParamTypes';
import UrlUpdateTypes from './UrlUpdateTypes';
/** React *... |
Use logging variable instead of hard coded string to set logging level. | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... |
Test to see if commit works. | from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
views.Yea... | from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
views.Ye... |
Make epochDays more legible by visualizing what it's divided by | import Day from './day';
const Calendar = ({ events }) => {
let id = 0;
let lastEpochDays = 0;
let daysEvents = [];
let allDays = [];
const MS_IN_DAY = 1000*60*60*24;
for (let event of events) {
event.start_time = new Date(event.start_time);
let epochDays = Math.floor(event.start_time.getTime()... | import Day from './day';
const Calendar = ({ events }) => {
let id = 0;
let lastEpochDays = 0;
let daysEvents = [];
let allDays = [];
for (let event of events) {
event.start_time = new Date(event.start_time);
let epochDays = Math.floor(event.start_time.getTime() / 8.64e7);
if (lastEpochDays =... |
Use quotes for scope properties | goog.provide('app_scaleline_directive');
goog.require('app');
goog.require('ngeo_control_directive');
goog.require('ol.control.ScaleLine');
(function() {
var module = angular.module('app');
module.directive('appScaleline', [
/**
* @return {angular.Directive} The Directive Object Definition.
*/
... | goog.provide('app_scaleline_directive');
goog.require('app');
goog.require('ngeo_control_directive');
goog.require('ol.control.ScaleLine');
(function() {
var module = angular.module('app');
module.directive('appScaleline', [
/**
* @return {angular.Directive} The Directive Object Definition.
*/
... |
Fix issue with spaces in paths | <?php
define('CLEANHOME', '/opt/clean');
if (!isset($_REQUEST['lib'])) :
echo '<p>Add ?lib and ?mod.</p>';
elseif (!isset($_REQUEST['mod'])) :
echo '<p>Select a module on the left.</p>';
else :
$lib = preg_replace('/[^\\w\\/\\-]/', '', $_REQUEST['lib']);
$mod = preg_replace('/[^\\w\\/\\. ]/', '', $_REQUEST['mod']);... | <?php
define('CLEANHOME', '/opt/clean');
if (!isset($_REQUEST['lib'])) :
echo '<p>Add ?lib and ?mod.</p>';
elseif (!isset($_REQUEST['mod'])) :
echo '<p>Select a module on the left.</p>';
else :
$lib = preg_replace('/[^\\w\\/\\-]/', '', $_REQUEST['lib']);
$mod = preg_replace('/[^\\w\\/\\.]/', '', $_REQUEST['mod']);
... |
Refactor League scheduler to use LeagueService | package com.elorating.scheduler;
import com.elorating.model.League;
import com.elorating.repository.LeagueRepository;
import com.elorating.repository.MatchRepository;
import com.elorating.repository.PlayerRepository;
import com.elorating.service.GenericService;
import com.elorating.service.LeagueService;
import org.sp... | package com.elorating.scheduler;
import com.elorating.model.League;
import com.elorating.repository.LeagueRepository;
import com.elorating.repository.MatchRepository;
import com.elorating.repository.PlayerRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.a... |
Fix path to meteor app for PHM deploy | var secret = require('./mup-secrets.json');
module.exports = {
servers: {
one: {
host: '167.71.2.39',
username: 'deploy',
password: secret.password,
}
},
app: {
name: 'publichappinessmovement',
path: '../../.',
docker: {
image: 'abernix/meteord:node-8.4.0-base'
},
... | var secret = require('./mup-secrets.json');
module.exports = {
servers: {
one: {
host: '167.71.2.39',
username: 'deploy',
password: secret.password,
}
},
app: {
name: 'publichappinessmovement',
path: './',
docker: {
image: 'abernix/meteord:node-8.4.0-base'
},
s... |
Move short line names to object | const {getNativeInteger} = require("./helpers");
const ABBREVIATED_ROUTE_NAMES = {
Brn: "Brown",
G: "Green",
Org: "Orange",
P: "Purple",
Y: "Yellow",
};
class Route {
constructor(attributes) {
this.attributes = attributes;
}
route() {
return ABBREVIATED_ROUTE_NAMES[this.attributes.rt] || this... | const {getNativeInteger} = require("./helpers");
class Route {
constructor(attributes) {
this.attributes = attributes;
}
route() {
var route;
switch ((route = this.routeId())) {
case "Brn":
return "Brown";
case "G":
return "Green";
case "Org":
return "Orange... |
Test the short version of "integer": "int" | <?php
/*
* Copyright 2016 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* 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 re... | <?php
/*
* Copyright 2016 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* 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 re... |
Add missing events and locations to error handling | module.exports = function(app) {
app.use(function(err, _req, res, _next) { // eslint-disable-line no-unused-vars
/**
* Error messages may be split into a head and a body. The head part
* contains the descriptor for the error. The body part contains extra
* information for the API user.
*/
... | module.exports = function(app) {
app.use(function(err, _req, res, _next) { // eslint-disable-line no-unused-vars
/**
* Error messages may be split into a head and a body. The head part
* contains the descriptor for the error. The body part contains extra
* information for the API user.
*/
... |
test: Use plan instead of manual count | var fs = require('../');
var rimraf = require('rimraf');
var mkdirp = require('mkdirp');
var test = require('tap').test;
var p = require('path').resolve(__dirname, 'files');
process.chdir(__dirname)
// Make sure to reserve the stderr fd
process.stderr.write('');
var num = 4097;
var paths = new Array(num);
test('mak... | var fs = require('../');
var rimraf = require('rimraf');
var mkdirp = require('mkdirp');
var test = require('tap').test;
var p = require('path').resolve(__dirname, 'files');
process.chdir(__dirname)
// Make sure to reserve the stderr fd
process.stderr.write('');
var num = 4097;
var paths = new Array(num);
test('mak... |
Fix finalize for safari, firefox. | function makePostRequest(url, data) {
var jForm = $('<form></form>');
jForm.attr('action', url);
jForm.attr('method', 'post');
for (name in data) {
var jInput = $("<input/>");
jInput.attr({'name' : name, 'value': data[name], 'type': 'hidden'});
jForm.append(jInput);
}
var... | function makePostRequest(url, data) {
console.log(url);
console.log(data);
var jForm = $('<form></form>');
jForm.attr('action', url);
jForm.attr('method', 'post');
for (name in data) {
var jInput = $("<input>");
jInput.attr('name', name);
jInput.attr('value', data[name]);... |
Increase to public visibility (better for use) | package net.aeten.core.spi.factory;
import java.util.concurrent.atomic.AtomicInteger;
import net.aeten.core.spi.SpiFactory;
public class ThreadFactory implements
SpiFactory <java.util.concurrent.ThreadFactory, String> {
private static final AtomicInteger threadCount = new AtomicInteger (0);
@Override
public ja... | package net.aeten.core.spi.factory;
import java.util.concurrent.atomic.AtomicInteger;
import net.aeten.core.spi.SpiFactory;
class ThreadFactory implements
SpiFactory <java.util.concurrent.ThreadFactory, String> {
private static final AtomicInteger threadCount = new AtomicInteger (0);
@Override
public java.util... |
Fix a rather embarrassing bug where HubMagic's pinging functionality would shut down after five minutes. | /**
* Copyright © 2014 tuxed <write@imaginarycode.com>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
package com.imaginarycode.minecraft.hub... | /**
* Copyright © 2014 tuxed <write@imaginarycode.com>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
package com.imaginarycode.minecraft.hub... |
Add user-agent field to html_fetcher | import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import requests
def fetch_html_document(url, user_agent='python_requests.cli-ws'):
"""Fetch html from url and return html
:param str url: an address to a resource on the Internet
:opt param str user_agen... | import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import requests
def fetch_html_document(url):
"""Fetch html from url and return html
:param str url: an address to a resource on the Internet
:return no except hit: status code and html of page (if exist... |
Remove timestamps from role_user table | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateRoleUserTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('role_user', function(Blueprint $table)
{
$table->increments(... | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateRoleUserTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('role_user', function(Blueprint $table)
{
$table->increments(... |
Fix matomo generation to only happen in production | /* global MATOMO_SITE_ID, MATOMO_TRACKER_URL, MATOMO_ENABLE_LINK_TRACKING */
export default ({ router }) => {
// Google analytics integration
if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined' && MATOMO_SITE_ID && MATOMO_TRACKER_URL) {
var _paq = _paq || [];
/* tracker methods like ... | /* global MATOMO_SITE_ID, MATOMO_TRACKER_URL, MATOMO_ENABLE_LINK_TRACKING */
export default ({ router }) => {
// Google analytics integration
if (MATOMO_SITE_ID && MATOMO_TRACKER_URL) {
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.p... |
Use the correct match function | 'use strict';
var httpclient = require('../../http-client');
function messageListener(db, from, channel, message) {
var match = /(https?:\/\/[^ ]+)/.exec(message)
if (match) {
var res = httpclient(db, match[1]);
var match = /<title>(.+)<\/title>/.exec(res);
if (match) {
var decoded = match[1... | 'use strict';
var httpclient = require('../../http-client');
function messageListener(db, from, channel, message) {
var match = /(https?:\/\/[^ ]+)/.match(message)
if (match) {
var res = httpclient(db, match[1]);
var match = /<title>(.+)<\/title>/.exec(res);
if (match) {
var decoded = match[... |
784: Change the column name to follow the standard naming convention. | const config = require('../../../knexfile').web
const knex = require('knex')(config)
module.exports = function (id, type) {
var table = "team_caseload_overview"
var whereObject = {}
if (id !== undefined) {
whereObject.id = id
}
return knex(table)
.where(whereObject)
.select('name',
'g... | const config = require('../../../knexfile').web
const knex = require('knex')(config)
module.exports = function (id, type) {
var table = "team_caseload_overview"
var whereObject = {}
if (id !== undefined) {
whereObject.id = id
}
return knex(table)
.where(whereObject)
.select('name',
'g... |
Make sure exists filter values are sent to backend | 'use strict';
var SearchService = function($http, $q) {
this.search = function(query) {
var deferred = $q.defer();
var from = query.from ? '&from=' + query.from : "";
var size = query.size ? '&size=' + query.size : "";
var facetlist = "&facet=resource.provenance&facet=resource.types";
// facet values in... | 'use strict';
var SearchService = function($http, $q) {
this.search = function(query) {
var deferred = $q.defer();
var from = query.from ? '&from=' + query.from : "";
var size = query.size ? '&size=' + query.size : "";
var facetlist = "&facet=resource.provenance&facet=resource.types";
// facet values in... |
Extend simple field from `SubscribableField` | /*
* Copyright 2019, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR... | /*
* Copyright 2019, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR... |
Add env line to script | #! /usr/bin/env node
var fs = require('fs');
var formidable = require('formidable');
var git = require('./lib/git')(__dirname);
var http = require('http');
var hyperglue = require('hyperglue');
var _ = require('lodash');
var html = fs.readFileSync(__dirname + '/index.html');
var port = process.env.PORT || 8080;
funct... | var fs = require('fs');
var formidable = require('formidable');
var git = require('./lib/git')(__dirname);
var http = require('http');
var hyperglue = require('hyperglue');
var _ = require('lodash');
var html = fs.readFileSync(__dirname + '/index.html');
var port = process.env.PORT || 8080;
function handlePost (req, r... |
Refactor entry point to do setup | 'use strict';
// Helper to avoid a lot of directory traversing
global.__base = __dirname + '/';
require('./libs/setup').then(() => {
// Load settings
const settings = require('./libs/settings');
// Run CLI and get arguments
const cli = require('./libs/cli'),
options = cli.start().input();
// Load... | 'use strict';
// Load settings
const settings = require('./libs/settings');
// Run CLI and get arguments
const cli = require('./libs/cli'),
options = cli.input();
// Load required files
const task = require('./libs/task'),
queue = require('./libs/queue'),
logger = require('./libs/log');
// Load ta... |
Apply consistent code style as used in other tests. | <?php
namespace Tests\Feature;
use App\Actions\ValetSecure;
use App\Shell\Shell;
use Exception;
use Illuminate\Support\Facades\Config;
use Tests\Feature\Fakes\FakeProcess;
use Tests\TestCase;
class ValetSecureTest extends TestCase
{
private $shell;
public function setUp(): void
{
parent::setUp()... | <?php
namespace Tests\Feature;
use App\Actions\ValetSecure;
use App\Shell\Shell;
use Exception;
use Illuminate\Support\Facades\Config;
use Tests\Feature\Fakes\FakeProcess;
use Tests\TestCase;
class ValetSecureTest extends TestCase
{
/** @test */
function it_runs_valet_link()
{
$shell = $this->moc... |
Use path for fix webpack build | const path = require('path')
const webpack = require('webpack')
module.exports = {
context: __dirname,
debug: true,
cache: false,
process: true,
stats: {
colors: true
},
entry: {
'scrollto-with-animation': path.join(__dirname, 'src')
},
output: {
path: path.join(__dirname, 'dist'),
fi... | const path = require('path')
const webpack = require('webpack')
module.exports = {
debug: true,
cache: false,
process: true,
stats: {
colors: true
},
entry: {
'scrollto-with-animation': 'src'
},
output: {
path: 'dist',
filename: '[name].min.js'
},
plugins: [
new webpack.SourceMa... |
Remove build option from generated docker file | #!/usr/bin/env node
var fs = require('fs');
var version = JSON.parse(fs.readFileSync("./package.json")).version;
var tag = "truecar/gluestick:" + version;
var dockerfile = [
"# DO NOT MODIFY",
"# This file is automatically generated. You can copy this file and add a",
... | #!/usr/bin/env node
var fs = require('fs');
var version = JSON.parse(fs.readFileSync("./package.json")).version;
var tag = "truecar/gluestick:" + version;
var dockerfile = [
"# DO NOT MODIFY",
"# This file is automatically generated. You can copy this file and add a",
... |
Fix variable for input string | from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, filter, map, zip)
import re
__author__ = 'sukrit'
"""
Package that includes custom filters required for totem config processing
"""
USE_FILTERS = ('replace_regex', )
d... | from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, filter, map, zip)
import re
__author__ = 'sukrit'
"""
Package that includes custom filters required for totem config processing
"""
USE_FILTERS = ('replace_regex', )
d... |
Add _GNU_SOURCE definition to ext_module | '''
(c) 2014 Farsight Security Inc.
(c) 2010 Victor Ng
Released under the MIT license. See license.txt.
'''
from setuptools import setup
from setuptools.extension import Extension
from Cython.Distutils import build_ext
from os.path import join
import os
ext_modules=[
Extension("mmaparray",
ex... | '''
(c) 2014 Farsight Security Inc.
(c) 2010 Victor Ng
Released under the MIT license. See license.txt.
'''
from setuptools import setup
from setuptools.extension import Extension
from Cython.Distutils import build_ext
from os.path import join
import os
ext_modules=[
Extension("mmaparray",
ex... |
Add id to API reponse for Reaction. | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Reaction
from rest_framework.fields import HyperlinkedIdentityField
class ReactionAuthorSerializer(serializers.ModelSerializ... | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Reaction
from rest_framework.fields import HyperlinkedIdentityField
class ReactionAuthorSerializer(serializers.ModelSerializ... |
Add explanatory comment for odd use of `delay()` | # coding: utf-8
import kombu.exceptions
from django.apps import AppConfig
from django.core.checks import register, Tags
from kpi.utils.two_database_configuration_checker import \
TwoDatabaseConfigurationChecker
class KpiConfig(AppConfig):
name = 'kpi'
def ready(self, *args, **kwargs):
# Once it'... | # coding: utf-8
import kombu.exceptions
from django.apps import AppConfig
from django.core.checks import register, Tags
from kpi.utils.two_database_configuration_checker import \
TwoDatabaseConfigurationChecker
class KpiConfig(AppConfig):
name = 'kpi'
def ready(self, *args, **kwargs):
# Once it'... |
Simplify menu debugging logic a bit. | package com.squareup.picasso.sample;
import android.app.Activity;
import android.os.Bundle;
import android.os.StrictMode;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ListView;
import com.squareup.picasso.Picasso;
public class SampleActivity extends Activity {
private SampleAdapter ... | package com.squareup.picasso.sample;
import android.app.Activity;
import android.os.Bundle;
import android.os.StrictMode;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ListView;
import com.squareup.picasso.Picasso;
public class SampleActivity extends Activity {
private SampleAdapter ... |
Fix reference to context in require.context | import history from '!json!../assets/data/history.json'
import metadata from '!json!../assets/data/metadata.json'
// Loading latest season in the main bundle itself
import latestSeasonData from '!json!../assets/data/season-latest.json'
const seasonDataCtx = require.context(
'file-loader!../assets/data/',
false,
... | import history from '!json!../assets/data/history.json'
import metadata from '!json!../assets/data/metadata.json'
// Loading latest season in the main bundle itself
import latestSeasonData from '!json!../assets/data/season-latest.json'
const seasonDataCtx = require.context(
'file-loader!../assets/data/',
false,
... |
Abort locale switcher set up if the local switcher is not present
If attachments references are not allowed the select is not rendered and trying to add an event listener to it was causing an error. This was causing the GovSpeak preview to break as well. | window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (Modules) {
function LocaleSwitcher (module) {
this.module = module
this.rightToLeftLocales = module.dataset.rtlLocales.split(' ')
}
LocaleSwitcher.prototype.init = function () {
this.setupLocaleSwitching(... | window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (Modules) {
function LocaleSwitcher (module) {
this.module = module
this.rightToLeftLocales = module.dataset.rtlLocales.split(' ')
}
LocaleSwitcher.prototype.init = function () {
this.setupLocaleSwitching(... |
Revert "Changed Model Variable m to protected. Used corresponding getters. changes made because dataset needed for calculating amount of triples."
This reverts commit f474d987593f1088e3571b18339682a8ff8c7d79. | package de.unibonn.iai.eis.diachron.qualitymetrics.utilities;
import java.util.ArrayList;
import java.util.List;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.sparql.core.Quad;
public class TestLo... | package de.unibonn.iai.eis.diachron.qualitymetrics.utilities;
import java.util.ArrayList;
import java.util.List;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.sparql.core.Quad;
public class TestLo... |
Add return type : string | <?php
namespace Coosos\TagBundle\Twig;
use Symfony\Component\Form\FormView;
class TagExtension extends \Twig_Extension
{
/**
* {@inheritdoc}
*/
public function getFunctions()
{
return [
new \Twig_SimpleFunction("form_coosos_tag", [$this, 'tagRendering'], [
'... | <?php
namespace Coosos\TagBundle\Twig;
use Symfony\Component\Form\FormView;
class TagExtension extends \Twig_Extension
{
/**
* {@inheritdoc}
*/
public function getFunctions()
{
return [
new \Twig_SimpleFunction("form_coosos_tag", [$this, 'tagRendering'], [
'... |
Fix weird glitchy thing again. | $(document).ready(function(){
$('button#boot').click(function() {
var l = Ladda.create( document.querySelector( '#boot' ) );
l.start();
$.get('/performActions.php?theAction=boot', function(data) {
l.stop();
$("#actionResults").show(0).delay(8000).hide(0);
$("#bootResult").show(0).delay(7... | $(document).ready(function(){
$('button#boot').click(function() {
var l = Ladda.create( document.querySelector( '#boot' ) );
l.start();
$.get('/performActions.php?theAction=boot', function(data) {
l.stop();
$("#actionResults").show(0).delay(5000).hide(0);
$("#bootResult").show(0).delay(4... |
Simplify adding the template markup to the document | Wee.fn.make('todo', {
init: function() {
$('ref:nav').after($.first('ref:template').text);
Wee.app.make('items', {
view: 'ref:todo',
model: {
todo: [
{
label: 'Download and run Wee',
done: true
},
{
label: 'Explore the welcome module'
},
{
label: 'Configu... | Wee.fn.make('todo', {
init: function() {
$($('ref:template').text()).insertAfter('ref:nav');
Wee.app.make('items', {
view: 'ref:todo',
model: {
todo: [
{
label: 'Download and run Wee',
done: true
},
{
label: 'Explore the welcome module'
},
{
label: 'Confi... |
Return value for client.stream.* calls
These endpoints didn’t return anything, making them unusable with the
promises version of the API. | /**
* Created by austin on 9/24/14.
*/
var streams = function (client) {
this.client = client;
};
var _qsAllowedProps = [
'resolution'
, 'series_type'
];
//===== streams endpoint =====
streams.prototype.activity = function(args,done) {
var endpoint = 'activities';
return this._typeHe... | /**
* Created by austin on 9/24/14.
*/
var streams = function (client) {
this.client = client;
};
var _qsAllowedProps = [
'resolution'
, 'series_type'
];
//===== streams endpoint =====
streams.prototype.activity = function(args,done) {
var endpoint = 'activities';
this._typeHelper(en... |
Fix indefinite event loop on connection error | var _IsLoggedIn = undefined;
function checkIfLoggedInAndTriggerEvent(notifyLoggedOutEveryTime){
request({module:"user", type: "IsLoggedIn"}, function(res){
if(_IsLoggedIn === undefined){
$(document).trigger("InitialUserStatus", res.loggedIn);
}
if(res.loggedIn != _IsLoggedIn){
_IsLoggedIn = res.loggedIn... | var _IsLoggedIn = undefined;
function checkIfLoggedInAndTriggerEvent(notifyLoggedOutEveryTime){
request({module:"user", type: "IsLoggedIn"}, function(res){
if(_IsLoggedIn === undefined){
$(document).trigger("InitialUserStatus", res.loggedIn);
}
if(res.loggedIn != _IsLoggedIn){
_IsLoggedIn = res.loggedI... |
Add separate steps for production and development | /*
* USAGE:
*
* Make sure you use the right way to invoke webpack, because the config
* file relies on it to determine if development or production settings
* must be used.
*
* Development: webpack -d
*
* Production: NODE_ENV=production webpack -p
*
*/
var path = require('path')
var webpack = require('webpa... | var path = require('path')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebPackPlugin = require('html-webpack-plugin')
const production = process.env.NODE_ENV === 'production'
module.exports = {
entry: ['./src/app.js'],
output: {
path: path.resolve(__dirname, 'build'),
filename: 'app_bun... |
Add Orwell as a lib | (function(){
'use strict';
angular.module('application', [
'ui.router',
'ngAnimate',
//foundation
'foundation',
'foundation.dynamicRouting',
'foundation.dynamicRouting.animations',
// Libraries
'ngOrwell',
// Fusion Seed App
'fusionSeedApp.components',
'fusionSeedApp.... | (function(){
'use strict';
angular.module('application', [
'ui.router',
'ngAnimate',
//foundation
'foundation',
'foundation.dynamicRouting',
'foundation.dynamicRouting.animations',
// Fusion Seed App
'fusionSeedApp.components',
'fusionSeedApp.services',
//'ObservableServic... |
Add check for nan values | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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 ... | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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 ... |
Return a valid JSON object for a valid XML presskit | // Convert presskit() data.xml file into the new JSON format
'use strict'
var fs = require('fs')
var xml2js = require('xml2js')
// Configure parser
// -- Avoid arrays for single elements
var xmlParser = new xml2js.Parser({explicitArray: false})
// -------------------------------------------------------------
// Modul... | // Convert presskit() data.xml file into the new JSON format
'use strict'
var fs = require('fs')
var xmlParser = require('xml2js').parseString
// -------------------------------------------------------------
// Module.
// -------------------------------------------------------------
var Converter = function () {}
// ... |
Increment minor version once more | import subprocess
import sys
from setuptools import Command, setup
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call([sys.executable, '-m', 'unittest', 'parserutils.tests.tes... | import subprocess
import sys
from setuptools import Command, setup
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call([sys.executable, '-m', 'unittest', 'parserutils.tests.tes... |
Fix Icon props doc page. | import { storiesOf } from '@storybook/react';
import { withInfo } from '@storybook/addon-info';
import Icon from '@ichef/gypcrete/src/Icon';
import getPropTables from 'utils/getPropTables';
import BasicIconsSet from './BasicIcons';
import PaymentIconsSet from './PaymentIcons';
import CRMIconsSet from './CRMIcons';
im... | import { storiesOf } from '@storybook/react';
import { withInfo } from '@storybook/addon-info';
import Icon from '@ichef/gypcrete/src/Icon';
import getPropTables from 'utils/getPropTables';
import BasicIconsSet from './BasicIcons';
import PaymentIconsSet from './PaymentIcons';
import CRMIconsSet from './CRMIcons';
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.