text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Add byte rule as application example.
package com.novoda.downloadmanager.demo; import android.app.Application; import android.os.Handler; import android.os.Looper; import com.facebook.stetho.Stetho; import com.novoda.downloadmanager.ByteBasedStorageRequirementRule; import com.novoda.downloadmanager.DownloadManagerBuilder; import com.novoda.downloadmanage...
package com.novoda.downloadmanager.demo; import android.app.Application; import android.os.Handler; import android.os.Looper; import com.facebook.stetho.Stetho; import com.novoda.downloadmanager.DownloadManagerBuilder; import com.novoda.downloadmanager.LiteDownloadManagerCommands; import com.novoda.downloadmanager.Pe...
Fix for GH-4, isResourceValid should check for PONG not OK
package redis.clients.jedis; import java.io.IOException; import java.net.UnknownHostException; import redis.clients.util.FixedResourcePool; public class JedisPool extends FixedResourcePool<Jedis> { private String host; private int port; private int timeout; public JedisPool(String host) { this.host...
package redis.clients.jedis; import java.io.IOException; import java.net.UnknownHostException; import redis.clients.util.FixedResourcePool; public class JedisPool extends FixedResourcePool<Jedis> { private String host; private int port; private int timeout; public JedisPool(String host) { this.host...
Allow the cache to be turned off
<?php /** * Copyright (C) 2016 Stratadox * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, p...
<?php /** * Copyright (C) 2016 Stratadox * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, p...
Revert "check user exists by email" This reverts commit 677654e72d5c40db1f6b4217776bf93bfc76b5f4.
package io.live4.api3; import org.stjs.javascript.annotation.Namespace; @Namespace("live4api") public class Api3UserUrls { public static final String API_3_USER = "/api/3/users"; public static final String BYEMAIL = "/byemail"; public static final String OBJECT = "/object"; public static final String...
package io.live4.api3; import org.stjs.javascript.annotation.Namespace; @Namespace("live4api") public class Api3UserUrls { public static final String API_3_USER = "/api/3/users"; public static final String BYEMAIL = "/byemail"; public static final String OBJECT = "/object"; public static final String...
Add empty object as default options
import { NativeModules } from 'react-native'; const CookieManager = NativeModules.RNCookieManager; export default { get(url:String, name?: String): Promise<Object|String> { return CookieManager.getCookie(url).then((cookie: Object): Object => { if (name && cookie) { return cooki...
import { NativeModules } from 'react-native'; const CookieManager = NativeModules.RNCookieManager; export default { get(url:String, name?: String): Promise<Object|String> { return CookieManager.getCookie(url).then((cookie: Object): Object => { if (name && cookie) { return cooki...
Remove prefix "::ffff:" for ipv4 addresses (fixes #909)
const utils = require('../lib/utils') const insecurity = require('../lib/insecurity') const models = require('../models/index') const cache = require('../data/datacache') const challenges = cache.challenges module.exports = function saveLoginIp () { return (req, res, next) => { var loggedInUser = insecurity.auth...
const utils = require('../lib/utils') const insecurity = require('../lib/insecurity') const models = require('../models/index') const cache = require('../data/datacache') const challenges = cache.challenges module.exports = function saveLoginIp () { return (req, res, next) => { var loggedInUser = insecurity.auth...
Clear checksums in liquibase changelog before running scripts. This is necessary, since the changelog files were reindented with the editorconfig values.
package no.priv.bang.ukelonn.bundle.db.liquibase; import java.sql.SQLException; import javax.sql.PooledConnection; import liquibase.Liquibase; import liquibase.database.DatabaseConnection; import liquibase.database.jvm.JdbcConnection; import liquibase.exception.LiquibaseException; import liquibase.resource.ClassLoade...
package no.priv.bang.ukelonn.bundle.db.liquibase; import java.sql.SQLException; import javax.sql.PooledConnection; import liquibase.Liquibase; import liquibase.database.DatabaseConnection; import liquibase.database.jvm.JdbcConnection; import liquibase.exception.LiquibaseException; import liquibase.resource.ClassLoade...
Return serializable string from base64encode.
from __future__ import print_function import sys import hashlib import base64 def print_error(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def to_unicode(content): # TODO: considering using the 'six' library for this, for now just do something simple. if sys.version_info >= (3,0): ret...
from __future__ import print_function import sys import hashlib import base64 def print_error(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def to_unicode(content): # TODO: considering using the 'six' library for this, for now just do something simple. if sys.version_info >= (3,0): ret...
Fix lodash function import after lodash upgrade
import Mustache from 'mustache' let capitalize = require('lodash/capitalize') let template = `Dear {{name}}, Your request to download course materials for course {{{coursename}}} has been received and currently being processed. You will receive another email when your request has been processed. Unique Request ID: {...
import Mustache from 'mustache' let capitalize = require('lodash/string/capitalize') let template = `Dear {{name}}, Your request to download course materials for course {{{coursename}}} has been received and currently being processed. You will receive another email when your request has been processed. Unique Reques...
Allow choosing which address to listen on from command-line Closes #12
#!/usr/bin/python # coding: utf-8 # This file is part of Supysonic. # # Supysonic is a Python implementation of the Subsonic server API. # Copyright (C) 2013 Alban 'spl0k' Féron # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as pu...
#!/usr/bin/python # coding: utf-8 # This file is part of Supysonic. # # Supysonic is a Python implementation of the Subsonic server API. # Copyright (C) 2013 Alban 'spl0k' Féron # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as pu...
Add new configuration setting for log_directory
# General Settings timerestriction = False debug_mode = True log_directory = './logs' # Email Settings # emailtype = "Gmail" emailtype = "Console" # SMS Settings # outboundsmstype = "WebService" outboundsmstype = "Console" # Twilio Auth Keys account_sid = "twilio sid here" auth_token = "auth token here" # SMS Servi...
# General Settings timerestriction = False debug_mode = True # Email Settings # emailtype = "Gmail" emailtype = "Console" # SMS Settings # outboundsmstype = "WebService" outboundsmstype = "Console" # Twilio Auth Keys account_sid = "twilio sid here" auth_token = "auth token here" # SMS Services Auth basic_auth = 'ba...
Use ops only instead of ops + boolean.
// Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package audit import ( "gopkg.in/juju/charm.v6-unstable" "time" ) // Operation represents the type of an entry. type Operation string const ( // OpSetPerm represents the setting of ACLs on an entity. // Required fields:...
// Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package audit import ( "gopkg.in/juju/charm.v6-unstable" "time" ) // Operation represents the type of an entry. type Operation string const ( // OpSetPerm represents the setting of ACLs on an entity. // Required fields:...
Include body with GitHub issues.
module.exports = { name: "GitHub", async matches(url) { return url.hostname == "github.com"; }, async parse(url) { let path = url.pathname.split("/"); let bugNumber = path[path.length - 1]; let owner = path[1]; let repo = path[2]; let bugUrl = `https://api.github.com/repos/${owner}/${r...
module.exports = { name: "GitHub", async matches(url) { return url.hostname == "github.com"; }, async parse(url) { let path = url.pathname.split("/"); let bugNumber = path[path.length - 1]; let owner = path[1]; let repo = path[2]; let bugUrl = `https://api.github.com/repos/${owner}/${r...
Remove force slug update due to special-characters bug.
<?php /** * Custom login logo. * * @return void */ add_action('login_head', function() { $path = ADMIN_URL.'/images/admin-login-logo.png'; echo "<style> h1 a { background-image:url($path) !important; background-size: auto auto !important; } </style>"; }); /** * Custom login logo url. * * @return string */ a...
<?php /** * Custom login logo. * * @return void */ add_action('login_head', function() { $path = ADMIN_URL.'/images/admin-login-logo.png'; echo "<style> h1 a { background-image:url($path) !important; background-size: auto auto !important; } </style>"; }); /** * Custom login logo url. * * @return string */ a...
Fix stupid copy paste error
from setuptools import setup import csvlib def readme(): with open('README.rst') as f: return f.read() setup(name='csvlib', version=csvlib.__version__, description='A tiny library for handling CSV files.', long_description=readme(), classifiers=[ 'Programming Language :: ...
from setuptools import setup import csvlib def readme(): with open('README.rst') as f: return f.read() setup(name='csvlib', version=csvlib.__version__, description='A tiny library for handling CSV files.', long_description=readme(), classifiers=[ 'Programming Language :: ...
Correct location of the views
var bogart = require('bogart') , router = bogart.router() , path = require('path') , mysql = require('mysql') , util = require('./lib/util').Util , settings = require('./config/settings').Settings , fs = require('fs'); var dbSettings = require('./config/settings').Settings.db; var connect...
var bogart = require('bogart') , router = bogart.router() , path = require('path') , mysql = require('mysql') , util = require('./lib/util').Util , settings = require('./config/settings').Settings , fs = require('fs'); var dbSettings = require('./config/settings').Settings.db; var connect...
Check for TTY and TERM when setting up Color enum Amends 0d27649df30419a79ca063ee3e47073f2ba8330e
import enum import os import subprocess import sys from blessings import Terminal from .misc import isatty if not (isatty(sys.stdout) and os.getenv("TERM")): class Terminal: def __getattr__(self, name): return "" TERM = Terminal() class Color(enum.Enum): none = "" reset = TERM....
import enum import subprocess from blessings import Terminal TERM = Terminal() class Color(enum.Enum): none = "" reset = TERM.normal black = TERM.black red = TERM.red green = TERM.green yellow = TERM.yellow blue = TERM.blue magenta = TERM.magenta cyan = TERM.cyan white = TE...
Add location action updates for saving and resetting
import { generateUUID } from 'react-native-database'; import { selectNewLocationId } from '../../selectors/Entities/location'; export const LOCATION_ACTIONS = { CREATE: 'LOCATION/create', UPDATE: 'LOCATION/update', SAVE_NEW: 'LOCATION/saveNew', SAVE_EDITING: 'LOCATION/saveEditing', RESET: 'LOCATION/reset', }...
import { generateUUID } from 'react-native-database'; import { selectNewLocationId } from '../../selectors/Entities/location'; export const LOCATION_ACTIONS = { CREATE: 'LOCATION/create', UPDATE: 'LOCATION/update', SAVE_NEW: 'LOCATION/saveNew', }; const createDefaultLocation = () => ({ id: generateUUID(), d...
Set server port in a static prop
import interfaces.*; import java.net.ServerSocket; import java.net.Socket; import java.util.ArrayList; import java.util.List; /** * Chat Server for various clients */ public class MultiUserChatServer implements IChatServer { private List<IChatClient> clients = new ArrayList<>(); private ServerSocket ss; ...
import interfaces.*; import java.net.ServerSocket; import java.net.Socket; import java.util.ArrayList; import java.util.List; /** * Chat Server for various clients */ public class MultiUserChatServer implements IChatServer { private List<IChatClient> clients = new ArrayList<>(); private ServerSocket ss; ...
Change the direction of the scrolling
console.log("Initializing the runway handlers."); var runway = document.querySelector('.widget-runway-tray-wrapper'); var initialMousePosition = null; var initialScrollLeft = null; runway.addEventListener('touchstart', function(e){ console.log('touchstart'); // this should be enabled only in chrome // in chrom...
console.log("Initializing the runway handlers."); var runway = document.querySelector('.widget-runway-tray-wrapper'); var initialMousePosition = null; var initialScrollLeft = null; runway.addEventListener('touchstart', function(e){ console.log('touchstart'); // this should be enabled only in chrome // in chrom...
Update docs config for 0.12
# -*- coding: utf-8 -*- # # Phinx documentation build configuration file, created by # sphinx-quickstart on Thu Jun 14 17:39:42 2012. # # Import the base theme configuration from cakephpsphinx.config.all import * # The full version, including alpha/beta/rc tags. release = '0.12.x' # The search index version. search_...
# -*- coding: utf-8 -*- # # Phinx documentation build configuration file, created by # sphinx-quickstart on Thu Jun 14 17:39:42 2012. # # Import the base theme configuration from cakephpsphinx.config.all import * # The full version, including alpha/beta/rc tags. release = '0.12.x' # The search index version. search_...
FIX - Removed unused dependencies
/* global moment:false */ import { config } from './index.config'; import { routerConfig } from './index.route'; import { themeConfig } from './index.theme'; import { runBlock } from './index.run'; import { MainController } from './main/main.controller'; import { DetailsController } from './details/details.controller'...
/* global malarkey:false, moment:false */ import { config } from './index.config'; import { routerConfig } from './index.route'; import { themeConfig } from './index.theme'; import { runBlock } from './index.run'; import { MainController } from './main/main.controller'; import { DetailsController } from './details/det...
Backup and restore the entire require cache
"use strict"; var path = require("path") module.exports = function (toLoad, mocks) { // Copy the existing cache var originalCache = {} Object.keys(require.cache).forEach(function(name) { originalCache[name] = require.cache[name] }) // Inject all of our mocks Object.keys(mocks).forEach(function(name){ ...
"use strict"; var path = require("path") module.exports = function (toLoad, mocks) { // Inject all of our mocks Object.keys(mocks).forEach(function(name){ var path = require.resolve(name) require.cache[path] = {exports: mocks[name]} }) if (/^[.][.]?\//.test(toLoad)) { toLoad = path.resolve(path....
Remove Assert for perm of dir.
package api import ( "launchpad.net/gocheck" "time" "os" ) func (s *S) TestMountDirectoryFromTime(c *gocheck.C){ time := time.Date(2009,time.November,15,21,40,03,0, time.Local) var ret = mountDirectoryPathFromTime(time) c.Assert(ret, gocheck.Equals, "2009/11/15/21/40/") } func (s *S) TestCrea...
package api import ( "launchpad.net/gocheck" "time" "os" ) func (s *S) TestMountDirectoryFromTime(c *gocheck.C){ time := time.Date(2009,time.November,15,21,40,03,0, time.Local) var ret = mountDirectoryPathFromTime(time) c.Assert(ret, gocheck.Equals, "2009/11/15/21/40/") } func (s *S) TestCrea...
ADD : app_root global variable
var app = require('app'); var BrowserWindow = require('browser-window'); var ipc = require('ipc'); global.app_root = __dirname+'/app'; global.storage = require(app_root+'/lib/storage/storage'); global.i18n = require(app_root+'/lib/i18n'); var environment = storage.get('environment'); require('crash-reporter').start(); ...
var app = require('app'); var BrowserWindow = require('browser-window'); var ipc = require('ipc'); global.storage = require(__dirname+'/lib/storage/storage'); global.i18n = require(__dirname+'/lib/i18n'); var environment = storage.get('environment'); require('crash-reporter').start(); var mainWindow = null; var Menu ...
Use Utils.loadView to load main page.
requirejs.config({ shim: { 'facebook' : { export: 'FB' }, 'backbone': { deps: ["underscore", "jquery"], exports: "Backbone" }, 'underscore': { exports: "_" } }, "paths": { "jquery": "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min"...
requirejs.config({ shim: { 'facebook' : { export: 'FB' }, 'backbone': { deps: ["underscore", "jquery"], exports: "Backbone" }, 'underscore': { exports: "_" } }, "paths": { "jquery": "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min"...
API: Include both the numerical instance.pk & its API URL
""" Instance serializers (API representation) """ #pylint: disable=no-init from rest_framework import serializers from .models import OpenStackServer, OpenEdXInstance class OpenStackServerSerializer(serializers.ModelSerializer): pk_url = serializers.HyperlinkedIdentityField(view_name='api:openstackserver-detail...
""" Instance serializers (API representation) """ #pylint: disable=no-init from rest_framework import serializers from .models import OpenStackServer, OpenEdXInstance class OpenStackServerSerializer(serializers.ModelSerializer): pk = serializers.HyperlinkedIdentityField(view_name='api:openstackserver-detail') ...
Use PHP 5.4 short array syntax.
#!/usr/bin/env php <?php require 'vendor/autoload.php'; $phpcsCLI = new PHP_CodeSniffer_CLI(); $phpcsViolations = $phpcsCLI->process(['standard' => ['PSR1'], 'files' => ['src', 'tests', 'build.php']]); if ($phpcsViolations > 0) { exit(1); } $phpunitConfiguration = PHPUnit_Util_Configuration::getInstance(__DIR__ ....
#!/usr/bin/env php <?php require 'vendor/autoload.php'; $phpcsCLI = new PHP_CodeSniffer_CLI(); $phpcsViolations = $phpcsCLI->process(array('standard' => array('PSR1'), 'files' => array('src', 'tests', 'build.php'))); if ($phpcsViolations > 0) { exit(1); } $phpunitConfiguration = PHPUnit_Util_Configuration::getIns...
Check for authorization header before split
import expressJwt from 'express-jwt'; import db from '../models'; import config from '../config'; import { AuthenticationError } from '../components/errors'; export function isTokenAuthenticated(req, res, next) { const authString = req.get('Authorization'); if (!authString) { // No auth header provided...
import expressJwt from 'express-jwt'; import db from '../models'; import config from '../config'; import { AuthenticationError } from '../components/errors'; export function isTokenAuthenticated(req, res, next) { const [scheme, token] = req.get('Authorization').split(' '); if (scheme !== 'Token') { ret...
Fix shorthand translation of "seconds" "seconds" means "less than a minute". In Turkish, "sn" is the abbreviation of "saniye", which means "second". So we should use "dk" which is the abbreviation for "dakika" (minute).
(function (factory) { if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { factory(require('jquery')); } else { factory(jQuery); } }(function (jQuery) { // Turkish shortened jQuery.timeago.se...
(function (factory) { if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { factory(require('jquery')); } else { factory(jQuery); } }(function (jQuery) { // Turkish shortened jQuery.timeago.se...
Use Yarn over NPM if available
<?php /* * This file is part of Rocketeer * * (c) Maxime Fabre <ehtnam6@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ namespace Rocketeer\Binaries\PackageManagers; /** * Represents the "npm" binary. */ class Np...
<?php /* * This file is part of Rocketeer * * (c) Maxime Fabre <ehtnam6@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ namespace Rocketeer\Binaries\PackageManagers; /** * Represents the "npm" binary. */ class Np...
Add route function to retrieve group messages
import authControllers from '../controllers'; const usersController = authControllers.users; const loginController = authControllers.login; const groupsController = authControllers.group; const messagesController = authControllers.messages; module.exports = (app) => { app.get('/api', (req, res) => res.status(200).s...
import authControllers from '../controllers'; const usersController = authControllers.users; const loginController = authControllers.login; const groupsController = authControllers.group; const messagesController = authControllers.messages; module.exports = (app) => { app.get('/api', (req, res) => res.status(200).s...
Replace the whole expression rather than the whole node Co-Authored-By: David Buchan-Swanson <c3af9b132736d390414a453d097fd3de5af0f970@gmail.com>
/** * @fileoverview Enforce no single element style arrays * @author Michael Gall */ 'use strict'; module.exports = { meta: { docs: { description: 'Disallow single element style arrays. These cause unnecessary re-renders as the identity of the array always changes', category: 'Stylistic I...
/** * @fileoverview Enforce no single element style arrays * @author Michael Gall */ 'use strict'; module.exports = { meta: { docs: { description: 'Disallow single element style arrays. These cause unnecessary re-renders as the identity of the array always changes', category: 'Stylistic I...
Fix read of wrong dictionnary
# Copyright 2017 Eficent Business and IT Consulting Services, S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import models class ProcurementRule(models.Model): _inherit = 'procurement.rule' def _get_stock_move_values(self, product_id, product_qty, product_uom, ...
# Copyright 2017 Eficent Business and IT Consulting Services, S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import models class ProcurementRule(models.Model): _inherit = 'procurement.rule' def _get_stock_move_values(self, product_id, product_qty, product_uom, ...
refactor(exception-mapper): Remove redundant super calls in constructor
/** * Copyright (C) 2016 Red Hat, 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 law or...
/** * Copyright (C) 2016 Red Hat, 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 law or...
Change version from dev to 0.1.0
# -*- coding: utf-8 -*- import os from setuptools import setup, find_packages README_FILE = os.path.join(os.path.dirname(__file__), 'README.rst') setup( name='tomako', version='0.1.0', description='Tomako is the easiest way to use Mako as a template engine ' 'for Tornado', long_descr...
# -*- coding: utf-8 -*- import os from setuptools import setup, find_packages README_FILE = os.path.join(os.path.dirname(__file__), 'README.rst') setup( name='tomako', version='dev', description='Tomako is the easiest way to use Mako as a template engine ' 'for Tornado', long_descrip...
Fix requests to the GitHub API
var _ = require('underscore'); var async = require('async'); var request = require('request'); var linters = require('./linters'); var repoURL = 'https://api.github.com/repos/nicolasmccurdy/repos'; var githubRequest = request.defaults({ headers: { Accept: 'application/vnd.github.v3', 'User-Agent': 'ghlint' ...
var _ = require('underscore'); var async = require('async'); var request = require('request'); var linters = require('./linters'); var repoURL = 'https://api.github.com/repos/nicolasmccurdy/repos'; var githubRequest = request.defaults({ headers: { Accept: 'application/vnd.github.v3', 'User-Agent': 'ghlint' ...
Allow PUT request to /similarities/:id
from django.shortcuts import get_object_or_404 from rest_framework import permissions, viewsets from similarities.utils import get_similar from .models import Artist from similarities.models import UserSimilarity from .serializers import ArtistSerializer, SimilaritySerializer class ArtistViewSet(viewsets.ModelViewSe...
from django.shortcuts import get_object_or_404 from rest_framework import permissions, viewsets from similarities.utils import get_similar from .models import Artist from similarities.models import UserSimilarity from .serializers import ArtistSerializer, SimilaritySerializer class ArtistViewSet(viewsets.ModelViewSe...
Send entityName to Graphs API with dots replaced by dashes for FQDN compatibility
// TODO: This is not a real model or controller App.Graphs = Ember.Controller.extend({ graph: function(emberId, entityName, entityType) { entityName = entityName.replace(/\./g, '-'); return Ember.$.ajax({ url: ((!localStorage.apiDomain) ? '' : '//' + localStorage.apiDomain) + '/api/v1/graphs?entityType=...
// TODO: This is not a real model or controller App.Graphs = Ember.Controller.extend({ graph: function(emberId, entityName, entityType) { return Ember.$.ajax({ url: ((!localStorage.apiDomain) ? '' : '//' + localStorage.apiDomain) + '/api/v1/graphs?entityType=' + entityType + '&entityName=' + entityName, ...
Load bullet and enemy assets
(function() { 'use strict'; function Preloader() { this.asset = null; this.ready = false; } Preloader.prototype = { preload: function () { this.asset = this.add.sprite(this.game.width * 0.5 - 110, this.game.height * 0.5 - 10, 'preloader'); this.load.setPreloadSprite(this.asset); ...
(function() { 'use strict'; function Preloader() { this.asset = null; this.ready = false; } Preloader.prototype = { preload: function () { this.asset = this.add.sprite(this.game.width * 0.5 - 110, this.game.height * 0.5 - 10, 'preloader'); this.load.setPreloadSprite(this.asset); ...
Disable symlink test on Windows
var fstream = require('../fstream.js') var notOpen = false // No symlinks on Windows if (process.platform !== 'win32') { fstream .Writer({ path: 'path/to/symlink', linkpath: './file', isSymbolicLink: true, mode: '0755' // octal strings supported }) .on('close', function () { ...
var fstream = require('../fstream.js') var notOpen = false fstream .Writer({ path: 'path/to/symlink', linkpath: './file', isSymbolicLink: true, mode: '0755' // octal strings supported }) .on('close', function () { notOpen = true var fs = require('fs') var s = fs.lstatSync('path/to/sym...
Set license to AGPL-3 in manifest
# -*- coding: utf-8 -*- { 'name': 'Chilean VAT Ledger', 'license': 'AGPL-3', 'description': ''' Chilean VAT Ledger Management ================================= Creates Sale and Purchase VAT report menus in "accounting/period processing/VAT Ledger" ''', 'version': '0.1', 'author': u'Blanco Martín...
# -*- coding: utf-8 -*- { 'name': 'Chilean VAT Ledger', 'description': ''' Chilean VAT Ledger Management ================================= Creates Sale and Purchase VAT report menus in "accounting/period processing/VAT Ledger" ''', 'version': '0.1', 'author': u'Blanco Martín & Asociados', 'websi...
Return early if the check threw an error.
from i3pystatus.core.command import run_through_shell from i3pystatus.updates import Backend from re import split, sub class Dnf(Backend): """ Gets updates for RPM-based distributions with `dnf check-update`. The notification body consists of the status line followed by the package name and version f...
from i3pystatus.core.command import run_through_shell from i3pystatus.updates import Backend from re import split, sub class Dnf(Backend): """ Gets updates for RPM-based distributions with `dnf check-update`. The notification body consists of the status line followed by the package name and version f...
Disable type checking in Windows 😞
import { execFile } from 'child_process' import flow from 'flow-bin' import { logError, logWarning, log } from '../util/log' const errorCodes = { TYPECHECK_ERROR: 2 } export default (saguiOptions) => new Promise((resolve, reject) => { // Currently Facebook does not provide Windows builds. // https://github.com/...
import { execFile } from 'child_process' import flow from 'flow-bin' import { logError, log } from '../util/log' const errorCodes = { TYPECHECK_ERROR: 2 } export default (saguiOptions) => new Promise((resolve, reject) => { const commandArgs = ['check', '--color=always'] if (saguiOptions.javaScript && saguiOpti...
Fix improper case from 'KeyBindings' to keybindings causing build failures on linux.
/*=include modules/accessor.js */ /*=include modules/ajax.js */ /*=include modules/calculation_colums.js */ /*=include modules/clipboard.js */ /*=include modules/download.js */ /*=include modules/edit.js */ /*=include modules/filter.js */ /*=include modules/format.js */ /*=include modules/frozen_columns.js */ /*=includ...
/*=include modules/accessor.js */ /*=include modules/ajax.js */ /*=include modules/calculation_colums.js */ /*=include modules/clipboard.js */ /*=include modules/download.js */ /*=include modules/edit.js */ /*=include modules/filter.js */ /*=include modules/format.js */ /*=include modules/frozen_columns.js */ /*=includ...
Add center and increase suggested value font size
/** * window.c.ProjectSuggestedContributions component * A Project-show page helper to show suggested amounts of contributions * * Example of use: * view: () => { * ... * m.component(c.ProjectSuggestedContributions, {project: project}) * ... * } */ import m from 'mithril'; import _ from 'underscore'; im...
/** * window.c.ProjectSuggestedContributions component * A Project-show page helper to show suggested amounts of contributions * * Example of use: * view: () => { * ... * m.component(c.ProjectSuggestedContributions, {project: project}) * ... * } */ import m from 'mithril'; import _ from 'underscore'; im...
ref: Add lock on identify_revision when revision is missing
from zeus.config import redis from zeus.exceptions import UnknownRepositoryBackend from zeus.models import Repository, Revision from zeus.vcs.base import UnknownRevision def identify_revision(repository: Repository, treeish: str): """ Attempt to transform a a commit-like reference into a valid revision. "...
from zeus.exceptions import UnknownRepositoryBackend from zeus.models import Repository, Revision from zeus.vcs.base import UnknownRevision def identify_revision(repository: Repository, treeish: str): """ Attempt to transform a a commit-like reference into a valid revision. """ # try to find it from t...
Fix deserialization with annotated getters
package io.leangen.graphql.metadata.strategy.input; import com.google.gson.FieldNamingPolicy; import com.google.gson.FieldNamingStrategy; import io.leangen.graphql.util.ClassUtils; import java.lang.reflect.Field; import java.util.Optional; /** * Created by bojan.tomic on 5/25/16. */ public class GsonFieldNamingStr...
package io.leangen.graphql.metadata.strategy.input; import com.google.gson.FieldNamingPolicy; import com.google.gson.FieldNamingStrategy; import java.lang.reflect.Field; /** * Created by bojan.tomic on 5/25/16. */ public class GsonFieldNamingStrategy implements FieldNamingStrategy { private FieldNameGenerator...
Use self.request.user instead of second query
from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, RedirectView, UpdateView User = get_user_model...
from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, RedirectView, UpdateView User = get_user_model...
Include @sanity/core in bootstrapped packages
export default { // Dependencies for a default Sanity installation core: { '@sanity/base': '^0.0.23', '@sanity/components': '^0.0.27', '@sanity/core': '^0.0.1', '@sanity/default-layout': '^0.0.4', '@sanity/default-login': '^0.0.2', '@sanity/desk-tool': '^0.1.9', 'react': '^15.3.0', '...
export default { // Dependencies for a default Sanity installation core: { '@sanity/base': '^0.0.23', '@sanity/components': '^0.0.27', '@sanity/default-layout': '^0.0.4', '@sanity/default-login': '^0.0.2', '@sanity/desk-tool': '^0.1.9', 'react': '^15.3.0', 'react-dom': '^15.3.0' }, ...
Add convinience method for Postgres test instance.
package com.palantir.atlasdb.keyvalue.rdbms; import javax.sql.DataSource; import org.postgresql.jdbc2.optional.PoolingDataSource; import com.palantir.atlasdb.keyvalue.api.KeyValueService; import com.palantir.atlasdb.keyvalue.impl.AbstractAtlasDbKeyValueServiceTest; public class PostgresKeyValueServiceTest extends A...
package com.palantir.atlasdb.keyvalue.rdbms; import javax.sql.DataSource; import org.postgresql.jdbc2.optional.PoolingDataSource; import com.palantir.atlasdb.keyvalue.api.KeyValueService; import com.palantir.atlasdb.keyvalue.impl.AbstractAtlasDbKeyValueServiceTest; public class PostgresKeyValueServiceTest extends A...
Update number of fonts in Docker image
""" tests.test_fonts ~~~~~~~~~~~~~~~~~~~~~ Test fonts API. :copyright: (c) 2018 Yoan Tournade. :license: AGPL, see LICENSE for more details. """ import requests def test_api_fonts_list(latex_on_http_api_url): """ The API list available fonts. """ r = requests.get("{}/fonts".format...
""" tests.test_fonts ~~~~~~~~~~~~~~~~~~~~~ Test fonts API. :copyright: (c) 2018 Yoan Tournade. :license: AGPL, see LICENSE for more details. """ import requests def test_api_fonts_list(latex_on_http_api_url): """ The API list available fonts. """ r = requests.get("{}/fonts".format...
Add Rasmus as stubbed admin user
import { setClient } from '../actions'; function checkAuthorization(dispatch) { const storedUser = localStorage.getItem('user'); if (storedUser) { const user = JSON.parse(storedUser); // const created = Math.round(createdDate.getTime() / 1000); // const ttl = 1209600; // const expiry = created + t...
import { setClient } from '../actions'; function checkAuthorization(dispatch) { const storedUser = localStorage.getItem('user'); if (storedUser) { const user = JSON.parse(storedUser); // const created = Math.round(createdDate.getTime() / 1000); // const ttl = 1209600; // const expiry = created + t...
Add DB sync toggle via environment variable
import express from 'express' import mongoose from 'mongoose' import winston from 'winston' import courses from './api/courses' import buildings from './api/buildings' import db from './db' let test = process.argv.join().match('/ava/') let enableSync = process.env.COBALT_ENABLE_DB_SYNC || true // Database connection ...
import express from 'express' import mongoose from 'mongoose' import winston from 'winston' import courses from './api/courses' import buildings from './api/buildings' import db from './db' // Database connection setup let test = process.argv.join().match('/ava/') mongoose.connect(process.env.COBALT_MONGO_URI || 'mong...
Fix path in resources with absolute path
<?php namespace AssetsBundle\View\Strategy; class ViewHelperStrategy extends \AssetsBundle\View\Strategy\AbstractStrategy{ /** * Render asset file * @param string $sPath */ public function renderAsset($sPath,$iLastModified){ $sExtension = strtolower(pathinfo($sPath, PATHINFO_EXTENSION)); ...
<?php namespace AssetsBundle\View\Strategy; class ViewHelperStrategy extends \AssetsBundle\View\Strategy\AbstractStrategy{ /** * Render asset file * @param string $sPath */ public function renderAsset($sPath,$iLastModified){ $sExtension = strtolower(pathinfo($sPath, PATHINFO_EXTENSION)); ...
Insert newlines into composer before post mentions
import { extend } from 'flarum/extension-utils'; import ActionButton from 'flarum/components/action-button'; import PostComment from 'flarum/components/post-comment'; export default function() { extend(PostComment.prototype, 'actionItems', function(items) { var post = this.props.post; if (post.isHidden()) re...
import { extend } from 'flarum/extension-utils'; import ActionButton from 'flarum/components/action-button'; import PostComment from 'flarum/components/post-comment'; export default function() { extend(PostComment.prototype, 'actionItems', function(items) { var post = this.props.post; if (post.isHidden()) re...
Add reference to csrf tests in tests loader list
""" Package with all tests for dashboard_app """ import unittest from testscenarios.scenarios import generate_scenarios TEST_MODULES = [ 'models.attachment', 'models.bundle', 'models.bundle_stream', 'models.hw_device', 'models.named_attribute', 'models.sw_package', 'models.test', 'mod...
""" Package with all tests for dashboard_app """ import unittest from testscenarios.scenarios import generate_scenarios TEST_MODULES = [ 'models.attachment', 'models.bundle', 'models.bundle_stream', 'models.hw_device', 'models.named_attribute', 'models.sw_package', 'models.test', 'mod...
Check for potential null pointer exception git-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@2103 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3
import java.io.*; public class TwoStreams { int x; public void twoStreamsWrong() throws IOException { BufferedReader r = null; Writer w = null; try { r = new BufferedReader(new InputStreamReader(new FileInputStream("hello"))); String l = r.readLine(); w = new OutputStreamWriter(new FileOutputStream("...
import java.io.*; public class TwoStreams { public void twoStreamsWrong() throws IOException { BufferedReader r = null; Writer w = null; try { r = new BufferedReader(new InputStreamReader(new FileInputStream("hello"))); String l = r.readLine(); w = new OutputStreamWriter(new FileOutputStream("blah"));...
Fix definition of web client builder
package io.pivotal.portfolio.config; import org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerExchangeFilterFunction; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.oauth2.client.registration.ClientRe...
package io.pivotal.portfolio.config; import org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerExchangeFilterFunction; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.oauth2.client.registration.ClientRe...
[DASH-2278] Change "Installed Sockets" to "My Sockets"
import React from 'react'; import Reflux from 'reflux'; import Helmet from 'react-helmet'; import Actions from './CustomSocketsActions'; import Store from './CustomSocketsStore'; import { Container, InnerToolbar } from '../../common/'; import CustomSocketsList from './CustomSocketsList'; const CustomSockets = React....
import React from 'react'; import Reflux from 'reflux'; import Helmet from 'react-helmet'; import Actions from './CustomSocketsActions'; import Store from './CustomSocketsStore'; import { Container, InnerToolbar } from '../../common/'; import CustomSocketsList from './CustomSocketsList'; const CustomSockets = React....
Change widget attribute to string In Django 1.8, widget attribute data-date-picker=True will be rendered as 'data-date-picker'. This patch will just look for the presence of the attribute, ignoring the actual value. Change-Id: I0beabddfe13c060ef2222a09636738428135040a Closes-Bug: #1467935 (cherry picked from commit f...
horizon.metering = { init_create_usage_report_form: function() { horizon.datepickers.add('input[data-date-picker]'); horizon.metering.add_change_event_to_period_dropdown(); horizon.metering.show_or_hide_date_fields(); }, init_stats_page: function() { if (typeof horizon.d3_line_chart !== 'undefined...
horizon.metering = { init_create_usage_report_form: function() { horizon.datepickers.add('input[data-date-picker="True"]'); horizon.metering.add_change_event_to_period_dropdown(); horizon.metering.show_or_hide_date_fields(); }, init_stats_page: function() { if (typeof horizon.d3_line_chart !== 'un...
Disable Typus.setConfirmUnload(true). It now fires in places where it shouldn’t (search, filtering), making the tool annoying.
$(document).ready(function() { // $("#quicksearch").searchField(); // this didn't work as intended. But since I added the .resource class // on the body element, it worked in places where it shouldn't. I'm disabling it // to return to the earlier behaviour ... // $(".resource :input", document.myF...
$(document).ready(function() { // $("#quicksearch").searchField(); $(".resource :input", document.myForm).bind("change", function() { Typus.setConfirmUnload(true); }); // This method is used by Typus::Controller::Bulk $(".action-toggle").click(function() { var status = this.checke...
Fix issue with test discovery and broken CUDA drivers. This patch allows the test discovery mechanism to work even in the case of a broken/misconfigured CUDA driver. Fixes #2841
from __future__ import print_function, absolute_import, division # Re export from .stubs import (threadIdx, blockIdx, blockDim, gridDim, syncthreads, shared, local, const, grid, gridsize, atomic, threadfence_block, threadfence_system, threadfence) from .cudad...
from __future__ import print_function, absolute_import, division # Re export from .stubs import (threadIdx, blockIdx, blockDim, gridDim, syncthreads, shared, local, const, grid, gridsize, atomic, threadfence_block, threadfence_system, threadfence) from .cudad...
Revise Queue instance to q
from __future__ import absolute_import from __future__ import print_function from __future__ import division class Queue(object): """Queue class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def peek(self): return self.items[-1] def ...
from __future__ import absolute_import from __future__ import print_function from __future__ import division class Queue(object): """Queue class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def enqueue(self, item): self.items.insert(0, i...
Fix typo in trove classifiers
from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, crea...
from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, crea...
Add js to gulp watch
var gulp = require("gulp"); var sourcemaps = require("gulp-sourcemaps"); var sass = require("gulp-sass"); var concat = require("gulp-concat"); var uglify = require("gulp-uglify"); // SASS compilation and minification gulp.task("sass", function() { gulp.src("./sass/**/*.sass") .pipe(sourcemaps.init()) .p...
var gulp = require("gulp"); var sourcemaps = require("gulp-sourcemaps"); var sass = require("gulp-sass"); var concat = require("gulp-concat"); var uglify = require("gulp-uglify"); gulp.task("sass", function() { gulp.src("./sass/**/*.sass") .pipe(sourcemaps.init()) .pipe(sass({outputStyle: "compressed"}))...
Use AWS SDK and concurrency
package main import ( "bufio" "fmt" "os" "sync" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kinesis" ) // Note: download file with test data // curl https://s3.amazonaws.com/kinesis.test/users.txt -o /tmp/users.txt func main() { wg := &sync.Wait...
package main import ( "bufio" "fmt" "os" "github.com/harlow/kinesis-connectors" "github.com/joho/godotenv" "github.com/sendgridlabs/go-kinesis" ) func main() { godotenv.Load() // Initialize Kinesis client auth := kinesis.NewAuth() ksis := kinesis.New(&auth, kinesis.Region{}) // Create stream connector....
Set Article.author to a Person instance (if it exists for current user)
from django.contrib import admin from aldryn_apphooks_config.admin import BaseAppHookConfig from aldryn_people.models import Person from cms.admin.placeholderadmin import PlaceholderAdmin, FrontendEditableAdmin from parler.admin import TranslatableAdmin from .models import Article, MockCategory, MockTag, NewsBlogConf...
from django.contrib import admin from aldryn_apphooks_config.admin import BaseAppHookConfig from cms.admin.placeholderadmin import PlaceholderAdmin, FrontendEditableAdmin from parler.admin import TranslatableAdmin from .models import Article, MockCategory, MockTag, NewsBlogConfig class ArticleAdmin(TranslatableAdmi...
Add back filter for Hillary2016
# -*- coding: UTF-8 -*- import numpy from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import json import config #Much of this code comes from http://adilmoujahid.com/posts/2014/07/twitter-analytics/ class StdOutListener(StreamListener): def on_data(self, data_...
# -*- coding: UTF-8 -*- import numpy from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import json import config #Much of this code comes from http://adilmoujahid.com/posts/2014/07/twitter-analytics/ class StdOutListener(StreamListener): def on_data(self, data_...
Add tests for the {index} placeholder
var tape = require('tape'); tape.test('transformer - should be a function', function (assert) { assert.equals(typeof require('../lib/transformer'), 'function'); assert.end(); }); tape.test('transformer - should return a templating function', function (assert) { assert.equals(typeof require('../lib/transformer')(),...
var tape = require('tape'); tape.test('transformer - should be a function', function (assert) { assert.equals(typeof require('../lib/transformer'), 'function'); assert.end(); }); tape.test('transformer - should return a templating function', function (assert) { assert.equals(typeof require('../lib/transformer')(),...
Use the source version as a doc version
# -*- coding: utf-8 -*- import os import sys import sphinx_rtd_theme import pkg_resources sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src')) import sphinxcontrib; reload(sphinxcontrib) extensions = ['sphinxcontrib.ros'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' pr...
# -*- coding: utf-8 -*- import os import sys import sphinx_rtd_theme sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src')) import sphinxcontrib; reload(sphinxcontrib) extensions = ['sphinxcontrib.ros'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'sphinxcontr...
Add logger at unhandled rejection.
/** * Copyright 2013-2020 the original author or authors from the JHipster project. * * This file is part of the JHipster project, see https://www.jhipster.tech/ * for more information. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the L...
/** * Copyright 2013-2020 the original author or authors from the JHipster project. * * This file is part of the JHipster project, see https://www.jhipster.tech/ * for more information. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the L...
Enable other locales that fully translated on Transifex
var downloadLocales = require('webmaker-download-locales'); var glob = require('glob'); var fs = require('fs-extra'); // Which languages should we pull down? // Don't include en-US because that's committed into git already var supportedLanguages = ['id', 'en_CA', 'es_CL', 'fr', 'nl', 'es_MX', 'cs', 'sv', 'bn_BD', 'sw'...
var downloadLocales = require('webmaker-download-locales'); var glob = require('glob'); var fs = require('fs-extra'); // Which languages should we pull down? // Don't include en-US because that's committed into git already var supportedLanguages = ['id', 'en_CA', 'es_CL', 'fr', 'nl', 'es_MX', 'cs', 'sv', 'bn_BD', 'sw'...
Add to javadoc, make constructor package private.
package uk.ac.ebi.quickgo.rest.cache; import com.google.common.base.Preconditions; import java.time.DayOfWeek; import java.time.LocalTime; import java.util.Objects; import javax.validation.constraints.NotNull; /** * Data structure holds day of week and time. Used to declare events that have a daily occurrence at a s...
package uk.ac.ebi.quickgo.rest.cache; import com.google.common.base.Preconditions; import java.time.DayOfWeek; import java.time.LocalTime; import java.util.Objects; import javax.validation.constraints.NotNull; /** * Data structure holds day of week and time. Used to declare events that have a daily occurrence at a s...
Increase timeout to see if it fixes invalid packet sequence in Travis
var assert = require('assert'), Lapidus = require('../index.js'), spawnSync = require('child_process').spawnSync, fs = require('fs'); describe('MySQL', function () { var output; before(function(done) { output = spawnSync('node', ['index.js', '-c', './test/config/lapidus.json'], { timeout: ...
var assert = require('assert'), Lapidus = require('../index.js'), spawnSync = require('child_process').spawnSync, fs = require('fs'); describe('MySQL', function () { var output; before(function(done) { output = spawnSync('node', ['index.js', '-c', './test/config/lapidus.json'], {timeout: 1...
Throw exception if invalid login details are used
# # HamperAuthenticator is the class to handle the authentication part of the provisioning portal. # Instantiate with the email and password you want, it'll pass back the cookie jar if successful, # or an error message on failure # from helpers.driver import HamperDriver from helpers.error import HamperError from term...
# # HamperAuthenticator is the class to handle the authentication part of the provisioning portal. # Instantiate with the email and password you want, it'll pass back the cookie jar if successful, # or an error message on failure # from helpers.driver import HamperDriver class HamperAuthenticator(object): def __init...
Make sure file is closed properly.
import os from setuptools import setup # type: ignore VERSION = '4.5' with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f: description = f.read() setup( name='conllu', packages=["conllu"], python_requires=">=3.6", package_data={ "": ["py.typed"] }, version=VERSI...
import os from setuptools import setup # type: ignore VERSION = '4.5' setup( name='conllu', packages=["conllu"], python_requires=">=3.6", package_data={ "": ["py.typed"] }, version=VERSION, license='MIT License', description='CoNLL-U Parser parses a CoNLL-U formatted string i...
Make the default OK page in the flask example obvious to find
import flask import mmstats application = app = flask.Flask(__name__) app.config['DEBUG'] = True class Stats(mmstats.MmStats): ok = mmstats.CounterField(label="mmstats.example.ok") bad = mmstats.CounterField(label="mmstats.example.bad") working = mmstats.BoolField(label="mmstats.example.working") stat...
import flask import mmstats application = app = flask.Flask(__name__) app.config['DEBUG'] = True class Stats(mmstats.MmStats): ok = mmstats.CounterField(label="mmstats.example.ok") bad = mmstats.CounterField(label="mmstats.example.bad") working = mmstats.BoolField(label="mmstats.example.working") stat...
Set title when route changed
(function (Shreds) { 'use strict'; var name = 'feeds'; var container = $('.span-fixed-sidebar'); Shreds.components.push(name); Shreds[name] = { init: function () { }, render: function (context, url) { container.attr('data-template', context); Shreds.ajax.get(url).done(function (data) { ...
(function (Shreds) { 'use strict'; var name = 'feeds'; var container = $('.span-fixed-sidebar'); Shreds.components.push(name); Shreds[name] = { init: function () { }, render: function (context, url) { container.attr('data-template', context); Shreds.ajax.get(url).done(function (data) { ...
Fix portal import from react-dom
import React from 'react'; import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import { canUseDOM } from './utils'; class Portal extends React.Component { componentWillUnmount() { if (this.defaultNode) { document.body.removeChild(this.defaultNode); } this.defaultNode = null; } ...
import React from 'react'; import PropTypes from 'prop-types'; import { createPortal } from 'react-dom'; import { canUseDOM } from './utils'; class Portal extends React.Component { componentWillUnmount() { if (this.defaultNode) { document.body.removeChild(this.defaultNode); } this.defaultNode = nul...
Add caching to static files if not in dev mode
const express = require('express'); const clientApp = require('../clientapp'); const config = require('./lib/config'); const nunjucks = require('nunjucks'); const path = require('path'); const middleware = require('./middleware'); const DEV_MODE = config('DEV', false); var app = express(); require('express-monkey-pa...
const express = require('express'); const clientApp = require('../clientapp'); const config = require('./lib/config'); const nunjucks = require('nunjucks'); const path = require('path'); const middleware = require('./middleware'); var app = express(); require('express-monkey-patch')(app); var staticDir = path.join(_...
Make justTeleportedEntities a HashSet instead of ArrayList
package net.simpvp.Portals; import java.io.File; import java.util.UUID; import java.util.HashSet; import org.bukkit.entity.Entity; import org.bukkit.plugin.java.JavaPlugin; public class Portals extends JavaPlugin { public static JavaPlugin instance; public static HashSet<UUID> justTeleportedEntities = new HashSe...
package net.simpvp.Portals; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.UUID; import org.bukkit.entity.Entity; import org.bukkit.plugin.java.JavaPlugin; public class Portals extends JavaPlugin { public static JavaPlugin instance; public static List<UUID> justTeleporte...
Trim email address before submitting to API.
(function (window, document, $) { var app = window.devsite; app.pages.signup = function () { var $btn = $('.notify-btn'); $btn.on('click', function() { $btn.addClass('disabled'); $.post('/api/developer-plus/coming-soon', { email: $('input[name="email"]').val().trim() }, function(...
(function (window, document, $) { var app = window.devsite; app.pages.signup = function () { var $btn = $('.notify-btn'); $btn.on('click', function() { $btn.addClass('disabled'); $.post('/api/developer-plus/coming-soon', { email: $('input[name="email"]').val() }, function(data, s...
Add plugin to ignore moment.js language packs.
var webpack = require('webpack'); module.exports = { entry: "./src/app.js", output: { path: "./build", filename: "bundle.js", publicPath: 'http://localhost:8090/assets' }, module: { loaders: [ { test: /\.scss$/, loader: "style!css!sass" }, { test: /\.css$/, loader: "style!css" }, ...
module.exports = { entry: "./src/app.js", output: { path: "./build", filename: "bundle.js", publicPath: 'http://localhost:8090/assets' }, module: { loaders: [ { test: /\.scss$/, loader: "style!css!sass" }, { test: /\.css$/, loader: "style!css" }, { test: /\.(png|jpg)$/, loader:...
Add a prerelease version number.
""" Flask-Selfdoc ------------- Flask selfdoc automatically creates an online documentation for your flask app. """ from setuptools import setup def readme(): with open('README.md') as f: return f.read() setup( name='Flask-Selfdoc', version='1.0a1', url='http://github.com/jwg4/flask-selfdoc...
""" Flask-Selfdoc ------------- Flask selfdoc automatically creates an online documentation for your flask app. """ from setuptools import setup def readme(): with open('README.md') as f: return f.read() setup( name='Flask-Selfdoc', version='0.2', url='http://github.com/jwg4/flask-selfdoc',...
BLD: Remove test resources created during tests
describe( 'csscomb', function () { var expand = require( 'glob-expand' ); var path = require( 'path' ); var exec = require( '../lib/exec' ); var read = function ( file ) { return require( 'fs' ).readFileSync( file, { encoding: 'utf8' } ); }; //var write = require( 'write' ).sync; var fs = ...
describe( 'csscomb', function () { var expand = require( 'glob-expand' ); var path = require( 'path' ); var exec = require( '../lib/exec' ); var read = function ( file ) { return require( 'fs' ).readFileSync( file, { encoding: 'utf8' } ); }; //var write = require( 'write' ).sync; var fs = ...
Handle multiple connections and connection reset
var net = require("net"); var express = require("express"); var bodyParser = require("body-parser"); var config = require('./config'); var app = express(); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json()); // Create a simple server var server = net.createServer(function (conn) { co...
var net = require("net"); var express = require("express"); var bodyParser = require("body-parser"); var config = require('./config'); var app = express(); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json()); // Create a simple server var server = net.createServer(function (conn) { //...
Update the default send to slack message
<?php namespace Michaeljennings\Snapshot\Listeners; use League\Event\EventInterface; use Maknz\Slack\Client; use Michaeljennings\Snapshot\Exceptions\EndPointNotSetException; class SendToSlack extends Listener { /** * Check if slack is enabled, if so send the snapshot to the relevant * channel. * ...
<?php namespace Michaeljennings\Snapshot\Listeners; use League\Event\EventInterface; use Maknz\Slack\Client; use Michaeljennings\Snapshot\Exceptions\EndPointNotSetException; class SendToSlack extends Listener { /** * Check if slack is enabled, if so send the snapshot to the relevant * channel. * ...
Add more detailed print in first module
from jtapi import * import os import sys import re import numpy as np from scipy import misc mfilename = re.search('(.*).py', os.path.basename(__file__)).group(1) ######### # input # ######### print('jt - %s:' % mfilename) handles_stream = sys.stdin handles = gethandles(handles_stream) input_args = readinputargs(h...
from jtapi import * import os import sys import re import numpy as np from scipy import misc mfilename = re.search('(.*).py', os.path.basename(__file__)).group(1) ######### # input # ######### print('jt - %s:' % mfilename) handles_stream = sys.stdin handles = gethandles(handles_stream) input_args = readinputargs(h...
Add pybit and its dependencies to this package's dependency list.
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', 'pyramid_debugtoolbar', 'waitress', # PyBit and dependencies ...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', 'pyramid_debugtoolbar', 'waitress', ] setup(name='acmeio', ...
Fix: Use custom WeakMap check until es6-weak-map PR is accepted
'use strict'; var assert = require('assert'); var WM = require('es6-weak-map'); var defaultResolution = require('default-resolution'); var nativeRegex = /[native code]/; // workaround until https://github.com/medikoo/es6-weak-map/pull/4 is merged function hasWeakMap(){ return (global.WeakMap && nativeRegex.test(g...
'use strict'; var assert = require('assert'); var WM = require('es6-weak-map'); var hasWeakMap = require('es6-weak-map/is-implemented'); var defaultResolution = require('default-resolution'); var runtimes = new WM(); function isFunction(fn){ return (typeof fn === 'function'); } function isExtensible(fn){ if(ha...
Add missing global Rollup alias for apollo-link-http-common This fixes #521, making it so that the apollo-link-http bundle resolves apollo-link-http-common to global.apolloLink.utilities instead of global.apolloLinkHttpCommon (which does not exist).
import sourcemaps from 'rollup-plugin-sourcemaps'; export const globals = { // Apollo 'apollo-client': 'apollo.core', 'apollo-link': 'apolloLink.core', 'apollo-link-batch': 'apolloLink.batch', 'apollo-utilities': 'apollo.utilities', 'apollo-link-http-common': 'apolloLink.utilities', 'zen-observable-ts': ...
import sourcemaps from 'rollup-plugin-sourcemaps'; export const globals = { // Apollo 'apollo-client': 'apollo.core', 'apollo-link': 'apolloLink.core', 'apollo-link-batch': 'apolloLink.batch', 'apollo-utilities': 'apollo.utilities', 'zen-observable-ts': 'apolloLink.zenObservable', //GraphQL 'graphql/l...
Clean up backen search js
/** * All methods related to the search */ jsBackend.search = { init: function() { var $synonymBox = $('input.synonymBox'); // synonyms box if ($synonymBox.length > 0) { $synonymBox.multipleTextbox({ emptyMessage: jsBackend.locale.msg('NoSynonymsBox'), addLabel: utils.string.ucfir...
/** * All methods related to the search */ jsBackend.search = { // init, something like a constructor init: function() { $synonymBox = $('input.synonymBox'); // synonyms box if($synonymBox.length > 0) { $synonymBox.multipleTextbox( { ...
Fix throwing when no source maps on calling `forEach` of null We need here to show frames even if all came from node_modules
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* @flow */ import type { StackFrame } from './stack-frame'; import { parse } from './parser'; import { map } from './mapper'; import { ...
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* @flow */ import type { StackFrame } from './stack-frame'; import { parse } from './parser'; import { map } from './mapper'; import { ...
Add lastmod to existing profile picture metadata
"""Add column for profile picture type to User Revision ID: f37d509e221c Revises: c997dc927fbc Create Date: 2020-09-04 15:43:18.413156 """ from enum import Enum import sqlalchemy as sa from alembic import op from werkzeug.http import http_date from indico.core.db.sqlalchemy import PyIntEnum from indico.util.date_ti...
"""Add column for profile picture type to User Revision ID: f37d509e221c Revises: c997dc927fbc Create Date: 2020-09-04 15:43:18.413156 """ from enum import Enum import sqlalchemy as sa from alembic import op from indico.core.db.sqlalchemy import PyIntEnum # revision identifiers, used by Alembic. revision = 'f37d5...
Use index as unique key prop in category column's list items - using body as the key prop caused ideas with a duplicate body to not be rendered
import React from "react" function CategoryColumn(props) { const categoryToEmoticonUnicodeMap = { happy: "😊", sad: "😥", confused: "😕", } const emoticonUnicode = categoryToEmoticonUnicodeMap[props.category] const filteredIdeas = props.ideas.filter(idea => idea.category === props.category) ret...
import React from "react" function CategoryColumn(props) { const categoryToEmoticonUnicodeMap = { happy: "😊", sad: "😥", confused: "😕", } const emoticonUnicode = categoryToEmoticonUnicodeMap[props.category] const filteredIdeas = props.ideas.filter(idea => idea.category === props.category) ret...
Update void test to reflect the new void model structure The first version I coded up only allowed for a single dump in each dataset. The most current version expects an array of dumps so I needed to update the test.
"""test_void.py Test the parsing of VoID dump files. """ try: import RDF except ImportError: import sys sys.path.append('/usr/lib/python2.7/dist-packages/') import RDF from glharvest import util, void def test_returns_none_if_the_registry_file_is_not_found(): m = util.load_file_into_model("nonexi...
"""test_void.py Test the parsing of VoID dump files. """ try: import RDF except ImportError: import sys sys.path.append('/usr/lib/python2.7/dist-packages/') import RDF from glharvest import util, void def test_returns_none_if_the_registry_file_is_not_found(): m = util.load_file_into_model("nonexi...
Change redirection from change password page to login
/** * 403 Forbidden Network Error Interceptor * * This interceptor redirects to login page when * any 403 session expired error is returned in any of the * network requests */ var LOGIN_ROUTE = '/login'; var SESSION_EXPIRED = 'session_expired'; var subdomainMatch = /https?:\/\/([^.]+)/; module.exports = functi...
/** * 403 Forbidden Network Error Interceptor * * This interceptor redirects to login page when * any 403 session expired error is returned in any of the * network requests */ var PASSWORD_CHANGE_ROUTE = '/password_change/'; var SESSION_EXPIRED = 'session_expired'; var subdomainMatch = /https?:\/\/([^.]+)/; mo...
Set title for SQUASH admin interface
from django.conf.urls import include, url from django.contrib import admin from rest_framework.authtoken.views import obtain_auth_token from rest_framework.routers import DefaultRouter from . import views admin.site.site_header = 'SQUASH Admin' api_router = DefaultRouter() api_router.register(r'jobs', views.JobViewSet...
from django.conf.urls import include, url from django.contrib import admin from rest_framework.authtoken.views import obtain_auth_token from rest_framework.routers import DefaultRouter from . import views api_router = DefaultRouter() api_router.register(r'jobs', views.JobViewSet) api_router.register(r'metrics', views....
Fix reference to DO_STOCKS_LIST environment variable
const stockIndexRegex = /^([^/]+)\/([^/]+)$/; export const STOCK_INDICES = (process.env.STOCK_INDICES || '') .split(',') .map(code => code.match(stockIndexRegex)) .filter(code => code) .reduce((last, [, code, name]) => ({ ...last, [code]: name }), {}); export const DO_STOCKS_LIST =...
const stockIndexRegex = /^([^/]+)\/([^/]+)$/; export const STOCK_INDICES = (process.env.STOCK_INDICES || '') .split(',') .map(code => code.match(stockIndexRegex)) .filter(code => code) .reduce((last, [, code, name]) => ({ ...last, [code]: name }), {}); export const DO_STOCKS_LIST =...