text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Fix the spellchecker nastyness in the rteditor
CKEDITOR.editorConfig = function( config ) { config.toolbar = 'Full'; config.toolbar_Full = [ ['Styles', '-', 'Bold','Italic', 'Underline','Strike', '-', 'NumberedList','BulletedList', '-', 'Link', 'Unlink', 'Image', '-', 'Undo', 'Redo', '-', 'Find', 'Replace', 'SelectAll'] ]; config....
CKEDITOR.editorConfig = function( config ) { config.toolbar = 'Full'; config.toolbar_Full = [ ['Styles', '-', 'Bold','Italic', 'Underline','Strike', '-', 'NumberedList','BulletedList', '-', 'Link', 'Unlink', 'Image', '-', 'Undo', 'Redo', '-', 'Find', 'Replace', 'SelectAll'] ]; config....
Add disableHostCheck for dev server
import webpack from 'webpack'; import baseConfig from './base.babel'; const host = 'localhost'; const port = 3000; const baseDevConfig = { ...baseConfig, mode: 'development', devtool: 'inline-source-map', devServer: { host, port, disableHostCheck: true }, output: { ...baseConfig.output, publicPath: ...
import webpack from 'webpack'; import baseConfig from './base.babel'; const host = 'localhost'; const port = 3000; const baseDevConfig = { ...baseConfig, mode: 'development', devtool: 'inline-source-map', devServer: { host, port }, output: { ...baseConfig.output, publicPath: `http://localhost:${port...
Use getPublishedPost when displaying a post
<?php namespace SymfonyDay\Bundle\BlogBundle\Controller; use Symfony\Component\HttpFoundation\Response; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; class DefaultController extends ...
<?php namespace SymfonyDay\Bundle\BlogBundle\Controller; use Symfony\Component\HttpFoundation\Response; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; class DefaultController extends ...
Fix change because you swapped url auth mechanisms
import React from "react"; import { JSON_AUTHORIZATION_HEADERS, JSON_POST_AUTHORIZATION_HEADERS } from "../constants/requests"; import { LOGOUT_URL } from "../constants/urls"; export const getFetch = url => { return fetch(url, { method: "GET", headers: JSON_AUTHORIZATION_HEADERS }); }; export const ge...
import React from "react"; import { JSON_AUTHORIZATION_HEADERS, JSON_POST_AUTHORIZATION_HEADERS } from "../constants/requests"; import { LOGOUT_URL } from "../constants/urls"; export const getFetch = url => { return fetch(url, { method: "GET", headers: JSON_AUTHORIZATION_HEADERS }); }; export const ge...
Add input file presence check
package main import ( "flag" "fmt" "os" ) var output string func init() { flag.Usage = func() { fmt.Printf("Usage: %s [-out=out.path] in.path\n\n", os.Args[0]) flag.PrintDefaults() } flag.StringVar(&output, "out", "out.go", "Specify a path to the output file") flag.Parse() } func main() { checkRequire...
package main import ( "flag" "fmt" "os" ) var output string func init() { flag.Usage = func() { fmt.Printf("Usage: %s [-out=out.path] in.path\n\n", os.Args[0]) flag.PrintDefaults() } flag.StringVar(&output, "out", "out.go", "Specify a path to the output file") flag.Parse() } func main() { checkRequire...
emojiRow: Create `handlePress` function to to call onPress with param. So that, instead of creating new arrow function for each emojiRow, there can be a single function which can be called with corresponding emoji name to autocomplete.
/* @flow */ import React, { PureComponent } from 'react'; import { StyleSheet, View } from 'react-native'; import { RawLabel, Touchable } from '../common'; import Emoji from '../emoji/Emoji'; const styles = StyleSheet.create({ emojiRow: { flexDirection: 'row', padding: 8, alignItems: 'center', }, te...
/* @flow */ import React, { PureComponent } from 'react'; import { StyleSheet, View } from 'react-native'; import { RawLabel, Touchable } from '../common'; import Emoji from '../emoji/Emoji'; const styles = StyleSheet.create({ emojiRow: { flexDirection: 'row', padding: 8, alignItems: 'center', }, te...
Prepend http to urls in user history
import os.path import json import urlparse ACCEPTED_FILETYPES = [ 'json', # 'csv' ] class HistoryParser(): def __init__(self, path): if not os.path.isfile(path): raise Exception("File not found.") if path.split(".")[-1] not in ACCEPTED_FILETYPES: raise Excep...
import os.path import json import urlparse ACCEPTED_FILETYPES = [ 'json', # 'csv' ] class HistoryParser(): def __init__(self, path): if not os.path.isfile(path): raise Exception("File not found.") if path.split(".")[-1] not in ACCEPTED_FILETYPES: raise Excep...
Use “lightGray” for web view background color
package mozilla.org.webmaker.view; import android.app.Activity; import android.content.Context; import android.view.ViewGroup; import mozilla.org.webmaker.R; import org.json.JSONObject; import org.xwalk.core.XWalkView; import mozilla.org.webmaker.client.WebClient; import mozilla.org.webmaker.javascript.WebAppInterfa...
package mozilla.org.webmaker.view; import android.app.Activity; import android.content.Context; import android.view.ViewGroup; import org.json.JSONObject; import org.xwalk.core.XWalkView; import mozilla.org.webmaker.client.WebClient; import mozilla.org.webmaker.javascript.WebAppInterface; public class WebmakerWebVi...
Change the call from BooleanStr::toStr to BooleanStr::toString
<?php namespace Bruno\AdobeConnectClient\Traits; use \Bruno\AdobeConnectClient\Helper\CamelCase as CC; use \Bruno\AdobeConnectClient\Helper\BooleanStr as B; /** * Converts the public properties into an array to use in the WS call * * Works only for the not empty properties. False and null are considered empty val...
<?php namespace Bruno\AdobeConnectClient\Traits; use \Bruno\AdobeConnectClient\Helper\CamelCase as CC; use \Bruno\AdobeConnectClient\Helper\BooleanStr as B; /** * Converts the public properties into an array to use in the WS call * * Works only for the not empty properties. False and null are considered empty val...
Support args in different orders
var exec = require('child_process').exec; var path = require('path'); var extend = require('xtend'); var command = require('language-command'); /** * Execute a file in a particular programming language. * * @param {String} language * @param {String} file * @param {Array} args * @param {Object} op...
var exec = require('child_process').exec; var path = require('path'); var extend = require('xtend'); var command = require('language-command'); /** * Execute a file in a particular programming language. * * @param {String} language * @param {String} file * @param {String} args * @param {Object} op...
Handle Android RN 0.47 breaking change
package com.reactlibrary.linkedinsdk; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.Arrays; import jav...
package com.reactlibrary.linkedinsdk; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.Arrays; import jav...
Test - checking visibitlity of Change Avatar link
describe('tests', function() { var username = "USERNAME"; var linksnum = 0; var links = element.all(by.repeater('link in annotatedlinks')); browser.get('https://webmaker.org/user/' + username); it('Should have a title', function() { expect(browser.getTitle()).toEqual(username + ' | Webmaker'); }); ...
describe('tests', function() { var username = "USERNAME"; var linksnum = 0; var links = element.all(by.repeater('link in annotatedlinks')); browser.get('https://webmaker.org/user/' + username); it('Should have a title', function() { expect(browser.getTitle()).toEqual(username + ' | Webmaker'); }); ...
Send PM to querying user (i think? bad docs.)
import pre import supybot.log as log import supybot.conf as conf import supybot.utils as utils import supybot.world as world import supybot.ircdb as ircdb from supybot.commands import * import supybot.irclib as irclib import supybot.ircmsgs as ircmsgs import supybot.plugins as plugins import supybot.ircutils as ircuti...
import pre import supybot.log as log import supybot.conf as conf import supybot.utils as utils import supybot.world as world import supybot.ircdb as ircdb from supybot.commands import * import supybot.irclib as irclib import supybot.ircmsgs as ircmsgs import supybot.plugins as plugins import supybot.ircutils as ircuti...
Add role removal and logic cleanup
import discord import shlex rolesTriggerString = '!role' # String to listen for as trigger async def parse_roles_command(message, client): server_roles = message.server.roles # Grab a list of all roles as Role objects server_roles_str = [x.name for x in server_roles] # String-ify it into their names msg =...
import discord import shlex rolesTriggerString = '!role' # String to listen for as trigger async def parse_roles_command(message, client): server_roles = message.server.roles # Grab a list of all roles as Role objects server_roles_str = [x.name for x in server_roles] # String-ify it into their names msg =...
Use lombok to create contructors
/* * Copyright 2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
/* * Copyright 2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
Correct background image manipulation doc
<?php namespace League\Glide\Manipulators; use Intervention\Image\Image; use League\Glide\Manipulators\Helpers\Color; /** * @property string $bg */ class Background extends BaseManipulator { /** * Perform background image manipulation. * @param Image $image The source image. * @return Image The...
<?php namespace League\Glide\Manipulators; use Intervention\Image\Image; use League\Glide\Manipulators\Helpers\Color; /** * @property string $bg */ class Background extends BaseManipulator { /** * Perform blur image manipulation. * @param Image $image The source image. * @return Image The manip...
Change notifier interval: 20 -> 10
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
Change DataCenters from struct to slice
package clcgo import ( "encoding/json" "errors" "fmt" ) type DataCenters []DataCenter type DataCenter struct { ID string Name string } const DataCentersURL = APIRoot + "/datacenters/%s" func (d DataCenters) URL(a string) (string, error) { return fmt.Sprintf(DataCentersURL, a), nil } func (d *DataCenters) ...
package clcgo import ( "encoding/json" "errors" "fmt" ) type DataCenters struct { DataCenters []DataCenter } type DataCenter struct { ID string Name string } const DataCentersURL = APIRoot + "/datacenters/%s" func (d DataCenters) URL(a string) (string, error) { return fmt.Sprintf(DataCentersURL, a), nil }...
Fix 'popupOptions' typo in 'github'
Github = {}; // Request Github credentials for the user // @param options {optional} // @param credentialRequestCompleteCallback {Function} Callback function to call on // completion. Takes one argument, credentialToken on success, or Error on // error. Github.requestCredential = function (options, credentialReque...
Github = {}; // Request Github credentials for the user // @param options {optional} // @param credentialRequestCompleteCallback {Function} Callback function to call on // completion. Takes one argument, credentialToken on success, or Error on // error. Github.requestCredential = function (options, credentialReque...
Use https for docs URL
import sys import textwrap try: import gi gi.require_version("Gst", "1.0") from gi.repository import GLib, GObject, Gst except ImportError: print( textwrap.dedent( """ ERROR: A GObject based library was not found. Mopidy requires GStreamer to work. GStreamer is a C...
import sys import textwrap try: import gi gi.require_version("Gst", "1.0") from gi.repository import GLib, GObject, Gst except ImportError: print( textwrap.dedent( """ ERROR: A GObject based library was not found. Mopidy requires GStreamer to work. GStreamer is a C...
Add a few asserts to the test git-svn-id: c55cfc7c8893d43c3333f2d886128b43c8520716@380472 13f79535-47bb-0310-9956-ffa450edef68
package org.xbean.jmx; import junit.framework.TestCase; import org.xbean.spring.context.ClassPathXmlApplicationContext; import java.util.List; /** * $Rev$ */ public class JMXTest extends TestCase { public void testSimple() throws Exception { ClassPathXmlApplicationContext context = new Clas...
package org.xbean.jmx; import junit.framework.TestCase; import org.xbean.spring.context.ClassPathXmlApplicationContext; /** * $Rev$ */ public class JMXTest extends TestCase { public void testSimple() throws Exception { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext...
Change Discogs URL from http to https
<?php namespace HWI\Bundle\OAuthBundle\OAuth\ResourceOwner; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class DiscogsResourceOwner extends GenericOAuth1ResourceOwner { /** * {@inheritDoc} */ protected $paths = array( 'identifier' => 'id', 'nickname' => ...
<?php namespace HWI\Bundle\OAuthBundle\OAuth\ResourceOwner; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class DiscogsResourceOwner extends GenericOAuth1ResourceOwner { /** * {@inheritDoc} */ protected $paths = array( 'identifier' => 'id', 'nickname' => ...
Include plan name in trial to active stripe event notification
<?php namespace SimplyTestable\ApiBundle\Tests\Command\Stripe\Event\ProcessCommand\EventType\CustomerSubscriptionUpdated\StatusChange\TrialingToActive; use SimplyTestable\ApiBundle\Tests\Command\Stripe\Event\ProcessCommand\EventType\CustomerSubscriptionUpdated\StatusChange\ActionStatusTest; abstract class TrialingTo...
<?php namespace SimplyTestable\ApiBundle\Tests\Command\Stripe\Event\ProcessCommand\EventType\CustomerSubscriptionUpdated\StatusChange\TrialingToActive; use SimplyTestable\ApiBundle\Tests\Command\Stripe\Event\ProcessCommand\EventType\CustomerSubscriptionUpdated\StatusChange\ActionStatusTest; abstract class TrialingTo...
Revert to relative path for sources.
import os import platform import setuptools # # --- Detect if extensions should be disabled ------------------------------ wrapt_env = os.environ.get('WRAPT_INSTALL_EXTENSIONS') if wrapt_env is None: wrapt_env = os.environ.get('WRAPT_EXTENSIONS') if wrapt_env is not None: disable_extensions = wrapt_env.lower...
import os import platform import setuptools # # --- Detect if extensions should be disabled ------------------------------ wrapt_env = os.environ.get('WRAPT_INSTALL_EXTENSIONS') if wrapt_env is None: wrapt_env = os.environ.get('WRAPT_EXTENSIONS') if wrapt_env is not None: disable_extensions = wrapt_env.lower...
Remove superfluous 'is True' from the assert.
""" .. module:: config_parser :platform: linux :synopsis: Module to test the bunch YAML configuration parser. .. moduleauthor:: Paul Fanelli <paul.fanelli@gmail.com> .. modulecreated:: 6/26/15 """ from bunch import Bunch import pytest from planet_alignment.config.bunch_parser import BunchParser from planet_ali...
""" .. module:: config_parser :platform: linux :synopsis: Module to test the bunch YAML configuration parser. .. moduleauthor:: Paul Fanelli <paul.fanelli@gmail.com> .. modulecreated:: 6/26/15 """ from bunch import Bunch import pytest from planet_alignment.config.bunch_parser import BunchParser from planet_ali...
Mark login as Index route
import React from 'react'; import { Route } from 'react-router'; import { IndexRoute } from 'react-router'; import Login from './features/login'; import CategoryTileListContainer from './features/categories/components/CategoryTileListContainer'; import ChallengeScreenContainer from './features/challenges/components/Cha...
import React from 'react'; import { Route } from 'react-router'; import Login from './features/login'; import CategoryTileListContainer from './features/categories/components/CategoryTileListContainer'; import ChallengeScreenContainer from './features/challenges/components/ChallengeScreenContainer'; import TodoScreen f...
Use config to build paths
/** * Copyright (c) 2013-2015 Memba Sarl. All rights reserved. * Sources at https://github.com/Memba */ /* jshint node: true, expr: true */ /* globals describe: false, before: false, it: false */ 'use strict'; var request = require('supertest'), util = require('util'), //We cannot define app like this be...
/** * Copyright (c) 2013-2015 Memba Sarl. All rights reserved. * Sources at https://github.com/Memba */ /* jshint node: true, expr: true */ /* globals describe: false, before: false, it: false */ 'use strict'; var request = require('supertest'), //We cannot define app like this because the server is already ...
Implement __str__ for proper printing in admin
from django.db import models class QuestionGroup(models.Model): heading = models.TextField() text = models.TextField(blank=True) date_added = models.DateTimeField(auto_now=True) date_modified = models.DateTimeField(auto_now_add=True) def __str__(self): return str(self.id) + ". " + self.he...
from django.db import models class QuestionGroup(models.Model): heading = models.TextField() text = models.TextField(blank=True) date_added = models.DateTimeField(auto_now=True) date_modified = models.DateTimeField(auto_now_add=True) class Question(models.Model): text = models.TextField() qu...
Reduce number of concurrent consumers for owner -> node route
/* * Copyright 2012 Research Studios Austria Forschungsges.m.b.H. Licensed under * the Apache License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License * at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable *...
/* * Copyright 2012 Research Studios Austria Forschungsges.m.b.H. 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 *...
Update md test for render fix
from mfr.ext.md import Handler, render from mock import MagicMock def test_render_html(): fakefile = MagicMock(spec=file) fakefile.read.return_value = '# foo' assert render.render_html(fakefile).content == '<h1>foo</h1>' fakefile.read.return_value = '_italic_' assert render.render_html(fakefile).co...
from mfr.ext.md import Handler, render from mock import MagicMock def test_render_html(): fakefile = MagicMock(spec=file) fakefile.read.return_value = '# foo' assert render.render_html(fakefile) == '<h1>foo</h1>' fakefile.read.return_value = '_italic_' assert render.render_html(fakefile) == '<p><em...
Improve error handling without API key
import { getSetting } from 'meteor/vulcan:core'; import googleMaps from '@google/maps' const googleMapsApiKey = getSetting('googleMaps.serverApiKey', null) let googleMapsClient = null if (googleMapsApiKey) { googleMapsClient = googleMaps.createClient({ key: googleMapsApiKey, Promise: Promise }); } else { ...
import { getSetting } from 'meteor/vulcan:core'; import googleMaps from '@google/maps' const googleMapsApiKey = getSetting('googleMaps.serverApiKey', null) let googleMapsClient = null if (googleMapsApiKey) { googleMapsClient = googleMaps.createClient({ key: googleMapsApiKey, Promise: Promise }); } else { ...
Remove non-standard attribute in test user.
""" A static dictionary with SAML testusers that can be used as response. """ USERS = { "testuser1": { "sn": ["Testsson 1"], "givenName": ["Test 1"], "eduPersonAffiliation": ["student"], "eduPersonScopedAffiliation": ["student@example.com"], "eduPersonPrincipalName": ["test@e...
""" A static dictionary with SAML testusers that can be used as response. """ USERS = { "testuser1": { "sn": ["Testsson 1"], "givenName": ["Test 1"], "eduPersonAffiliation": ["student"], "eduPersonScopedAffiliation": ["student@example.com"], "eduPersonPrincipalName": ["test@e...
Fix nofity crash if done callback is not set
'use strict'; var http = require('http'), color = require('cli-color'), defaults = require('../defaults.json'); module.exports = function(hostname, port, done) { var data = 'reload' var options = { hostname: hostname || '127.0.0.1', port: port || defaults.notifyPort, path: '/', meth...
'use strict'; var http = require('http'), color = require('cli-color'), defaults = require('../defaults.json'); module.exports = function(hostname, port, done) { var data = 'reload' var options = { hostname: hostname || '127.0.0.1', port: port || defaults.notifyPort, path: '/', meth...
lxd/lifecycle/storage/pool: Remove projectName arg from StoragePoolAction.Event Storage pools don't have projects. Signed-off-by: Thomas Parrott <6b778ce645fb0e3dde76d79eccad490955b1ae74@canonical.com>
package lifecycle import ( "github.com/lxc/lxd/shared/api" "github.com/lxc/lxd/shared/version" ) // StoragePoolAction represents a lifecycle event action for storage pools. type StoragePoolAction string // All supported lifecycle events for storage pools. const ( StoragePoolCreated = StoragePoolAction(api.EventLi...
package lifecycle import ( "github.com/lxc/lxd/shared/api" "github.com/lxc/lxd/shared/version" ) // StoragePoolAction represents a lifecycle event action for storage pools. type StoragePoolAction string // All supported lifecycle events for storage pools. const ( StoragePoolCreated = StoragePoolAction(api.EventLi...
Fix prettier config to remove unecessary diff
const webpack = require('webpack') const path = require('path') const fs = require('fs') const output = path.join(__dirname, 'output', 'webpack') const loader = path.join(__dirname, '..', '..') const baseConfig = { entry: path.join(__dirname, 'fixtures/fib.ml'), module: { rules: [ { test: /\.(re...
const webpack = require('webpack') const path = require('path') const fs = require('fs') const output = path.join(__dirname, 'output', 'webpack') const loader = path.join(__dirname, '..', '..') const baseConfig = { entry: path.join(__dirname, 'fixtures/fib.ml'), module: { rules: [ { test: /\.(re...
Change default python string name str to mystr as str is a reserved name
#!/usr/bin/env python -u import cPickle import sys import urllib import base64 # # Output the maximum number of instances of this 'callable' to spawn # The absolute maximum is set in the configuration file via 'warpscript.call.maxcapacity' # print 10 # # Loop, reading stdin, doing our stuff and outputing to stdout...
#!/usr/bin/env python -u import cPickle import sys import urllib import base64 # # Output the maximum number of instances of this 'callable' to spawn # The absolute maximum is set in the configuration file via 'warpscript.call.maxcapacity' # print 10 # # Loop, reading stdin, doing our stuff and outputing to stdout...
Fix error with lodash map
var _ = require('lodash'); var Matcher = require('../matcher'); var factory = require('../factory'); var compile = require('../compile'); var s = require('../strummer'); module.exports = factory({ initialize: function(opts) { var matchers = { keys: null, values: null }; if (opts instanceof Matche...
var _ = require('lodash'); var Matcher = require('../matcher'); var factory = require('../factory'); var compile = require('../compile'); var s = require('../strummer'); module.exports = factory({ initialize: function(opts) { var matchers = { keys: null, values: null }; if (opts instanceof Matche...
Add fixme comment for user timings on Firefox.
(function() { /** * Browsertime (http://www.browsertime.com) * Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog * and other contributors * Released under the Apache 2.0 License */ // someway the get entries by type isn't working in IE using Selenium, // will spend time fixing this later, now just r...
(function() { /** * Browsertime (http://www.browsertime.com) * Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog * and other contributors * Released under the Apache 2.0 License */ // someway the get entries by type isn't working in IE using Selenium, // will spend time fixing this later, now just r...
Set the number in sessions and correclty compare the values
// Dependencies var CaptchaPng = require("captchapng"); // Sessions var sessions = {}; // Captcha configuration var serverConfig = { width: 100, height: 30 }; // Get configuration M.emit("captcha.getConfig", function (c) { serverConfig = c; }); // Verify captcha M.on("captcha.verify", function (link, an...
// Dependencies var CaptchaPng = require("captchapng"); // Sessions var sessions = {}; // Captcha configuration var serverConfig = { width: 100, height: 30 }; // Get configuration M.emit("captcha.getConfig", function (c) { serverConfig = c; }); // Verify captcha M.on("captcha.verify", function (link, an...
Fix errant space in learn more items
/* * * ToolPage * */ import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import { createStructuredSelector } from 'reselect'; import Markdown from 'react-remarkable'; import ContentBlock from 'components/ContentBlock'; import LatinThemeProvider from 'components/LatinThemeProvider'; imp...
/* * * ToolPage * */ import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import { createStructuredSelector } from 'reselect'; import Markdown from 'react-remarkable'; import ContentBlock from 'components/ContentBlock'; import LatinThemeProvider from 'components/LatinThemeProvider'; imp...
Change the create need title
; import angular from 'angular'; function genComponentConf() { let template = ` <nav class="create-need-title" ng-cloak ng-show="{{true}}"> <div class="cntb__inner"> <a class="cntb__inner__left clickable" ng-click="self.back()"> <img src="generated/icon-spr...
; import angular from 'angular'; function genComponentConf() { let template = ` <nav class="create-need-title" ng-cloak ng-show="{{true}}"> <div class="cntb__inner"> <a class="cntb__inner__left clickable" ng-click="self.back()"> <img src="generated/icon-spr...
Return the stream for each task
var gulp = require('gulp'); var jshint = require('gulp-jshint'); var jasmine = require('gulp-jasmine'); var uglify = require('gulp-uglify'); var rename = require('gulp-rename'); gulp.task('lint', function () { return gulp.src('./*.js') .pipe(jshint('jshintrc.json')) .pipe(jshint.reporter('jshint-st...
var gulp = require('gulp'); var jshint = require('gulp-jshint'); var jasmine = require('gulp-jasmine'); var uglify = require('gulp-uglify'); var rename = require('gulp-rename'); gulp.task('lint', function () { gulp.src('./*.js') .pipe(jshint('jshintrc.json')) .pipe(jshint.reporter('jshint-stylish')...
Use full path as cache key
from functools import wraps from django.conf import settings from django.core.cache import cache from django.template.response import ContentNotRenderedError from django.utils.decorators import available_attrs def cache_view(view_func): @wraps(view_func, assigned=available_attrs(view_func)) def _wrapped_view...
from functools import wraps from django.conf import settings from django.core.cache import cache from django.template.response import ContentNotRenderedError from django.utils.decorators import available_attrs def cache_view(view_func): @wraps(view_func, assigned=available_attrs(view_func)) def _wrapped_view...
Fix greenlet and essential objects startup order
try: from gevent import monkey except ImportError: pass else: monkey.patch_all() from tendrl.commons import CommonNS from tendrl.node_agent.objects.definition import Definition from tendrl.node_agent.objects.config import Config from tendrl.node_agent.objects.node_context import NodeContext from tendrl.no...
try: from gevent import monkey except ImportError: pass else: monkey.patch_all() from tendrl.commons import CommonNS from tendrl.node_agent.objects.definition import Definition from tendrl.node_agent.objects.config import Config from tendrl.node_agent.objects.node_context import NodeContext from tendrl.no...
Implement hbs partial auto detecting and registering
const fs = require(`fs`); const glob = require(`glob`); const Handlebars = require(`handlebars`); const htmlclean = require(`htmlclean`); const mkdir = require(`mkdirp`); const path = require(`path`); const viewsDirectory = path.join(process.cwd(), `resources`, `views`); const views = glob.sync(path.join(viewsDirector...
const fs = require(`fs`); const Handlebars = require(`handlebars`); const htmlclean = require(`htmlclean`); const mkdir = require(`mkdirp`); const path = require(`path`); const layoutHbs = path.join(process.cwd(), `resources`, `views`, `layouts`, `main.hbs`); Handlebars.registerPartial(`layouts/main`, fs.readFileSync(...
Add owner level to logger
const pino = require('pino') const serializers = require('./serializers.js') function createLogger (shardID) { return pino({ base: { shardID: String(shardID) }, customLevels: { owner: 35 }, prettyPrint: { translateTime: 'yyyy-mm-dd HH:MM:ss', messageFormat: `[{shardID}] \x...
const pino = require('pino') const serializers = require('./serializers.js') function createLogger (shardID) { return pino({ base: { shardID: String(shardID) }, prettyPrint: { translateTime: 'yyyy-mm-dd HH:MM:ss', messageFormat: `[{shardID}] \x1b[0m{msg}`, ignore: 'hostname,shardI...
Allow papers/maxout to be tested without MNIST data
import os import numpy as np import pylearn2 from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.termination_criteria import EpochCounter from pylearn2.utils.serial import load_train_file def test_mnist(): """ Test the mnist.yaml file from the dropout paper on random input ...
import os import numpy as np import pylearn2 from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.termination_criteria import EpochCounter from pylearn2.utils.serial import load_train_file def test_mnist(): """ Test the mnist.yaml file from the dropout paper on random input ...
Delete children when deleting dms folder
package com.axelor.dms.db.repo; import java.util.List; import java.util.Map; import org.joda.time.LocalDateTime; import com.axelor.db.JpaRepository; import com.axelor.dms.db.DMSFile; public class DMSFileRepository extends JpaRepository<DMSFile> { public DMSFileRepository() { super(DMSFile.class); } @Override...
package com.axelor.dms.db.repo; import java.util.Map; import org.joda.time.LocalDateTime; import com.axelor.db.JpaRepository; import com.axelor.dms.db.DMSFile; public class DMSFileRepository extends JpaRepository<DMSFile> { public DMSFileRepository() { super(DMSFile.class); } @Override public Map<String, Ob...
Correct method signature for BaseModel create
"""Interface for Models.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import tensorflow as tf from keras import models from tf_trainer.common import text_preprocessor from tf_trainer.common import types from typing import Callable class ...
"""Interface for Models.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import tensorflow as tf from keras import models from tf_trainer.common import text_preprocessor from tf_trainer.common import types from typing import Callable class ...
Upgrade migrate library to avoid using sqlite lib.
package migrator import ( _ "github.com/mattes/migrate/driver/postgres" "github.com/mattes/migrate/migrate" "github.com/resourced/resourced-master/config" ) func New(generalConfig config.GeneralConfig) *Migrator { m := &Migrator{} m.AppGeneralConfig = generalConfig return m } type Migrator struct { AppGenera...
package migrator import ( "github.com/mattes/migrate/migrate" "github.com/resourced/resourced-master/config" ) func New(generalConfig config.GeneralConfig) *Migrator { m := &Migrator{} m.AppGeneralConfig = generalConfig return m } type Migrator struct { AppGeneralConfig config.GeneralConfig } func (m *Migrat...
Enable background start of Cordova Android apps This closes #322
/* 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...
/* 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...
Use www.wikidata.org instead of wikidata.org Rewrite-followup to r11105 Patch #3605769 by Legoktm Because of various issues [1], using wikidata.org may cause random problems. Using www.wikidata.org will fix these. [1] https://bugzilla.wikimedia.org/show_bug.cgi?id=45005
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family # The wikidata family class Family(family.WikimediaFamily): def __init__(self): super(Family, self).__init__() self.name = 'wikidata' self.langs = { 'wikidata': 'www.wikidata.org', 'repo': ...
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family # The wikidata family class Family(family.WikimediaFamily): def __init__(self): super(Family, self).__init__() self.name = 'wikidata' self.langs = { 'wikidata': 'wikidata.org', 'repo': 'wik...
Fix action node overflow, background
import React from 'react'; import JSONTree from './JSONTree'; const styles = { actionBar: { paddingTop: 8, paddingBottom: 7, paddingLeft: 16 }, payload: { margin: 0, overflow: 'auto' } }; export default class LogMonitorAction extends React.Component { renderPayload(payload) { return...
import React from 'react'; import JSONTree from './JSONTree'; const styles = { actionBar: { paddingTop: 8, paddingBottom: 7, paddingLeft: 16 }, payload: { paddingLeft: 15 } }; export default class LogMonitorAction extends React.Component { renderPayload(payload) { return ( <div st...
Change api for better semantics
class SimpleTest { constructor() { this.passed = 0; this.failed = 0; this.total = 0; } addAssert(condition, label = 'Unknown') { this.total++; if (!condition) { this.failed++; console.error('Test failed: ' + label); } else { this.passed++; } return this; } ...
class SimpleTest { constructor() { this.passed = 0; this.failed = 0; this.total = 0; } assert(condition, label = 'Unknown') { this.total++; if (!condition) { this.failed++; console.error('Test failed: ' + label); } else { this.passed++; } return this; } sho...
Fix incompatibility with recent factory_boy postgeneration.
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, you can obtain one at http://mozilla.org/MPL/2.0/. import factory from django.contrib.auth.models import User, Group from django.contrib.auth.hashers import make_password ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, you can obtain one at http://mozilla.org/MPL/2.0/. import factory from django.contrib.auth.models import User, Group class GroupFactory(factory.django.DjangoModelFactory...
Add new release task w/ API doc prebuilding
from os.path import join from shutil import rmtree, move from invoke import Collection, ctask as task from invocations import docs as _docs from invocations.packaging import publish d = 'sites' # Usage doc/API site (published as docs.paramiko.org) docs_path = join(d, 'docs') docs_build = join(docs_path, '_build') d...
from os.path import join from invoke import Collection, ctask as task from invocations import docs as _docs d = 'sites' # Usage doc/API site (published as docs.paramiko.org) path = join(d, 'docs') docs = Collection.from_module(_docs, name='docs', config={ 'sphinx.source': path, 'sphinx.target': join(path, '...
Fix ongov customs settings formatting.
''' Enclose property names in double quotes in order to JSON serialize the contents in the API ''' CUSTOMIZATIONS = { "serializers": { "Location": { "includeFields":[ "id", "verifiableOrgId", ...
''' Enclose property names in double quotes in order to JSON serialize the contents in the API ''' CUSTOMIZATIONS = { "serializers": { "Location": { "includeFields":{ "id", "verifiableOrgId", ...
Allow _ in service and project ids We use dash to nest projects (infra-internal), so it cannot be used for word separation (depot_tools). R=vadimsh@chromium.org BUG= Review URL: https://codereview.chromium.org/1185823003.
# Copyright 2015 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. import re ################################################################################ ## Config set patterns. SERVICE_ID_PATTERN = '[a-z0-9\-_]+' ...
# Copyright 2015 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. import re ################################################################################ ## Config set patterns. SERVICE_ID_PATTERN = '[a-z0-9\-]+' S...
Update ansible version number to 2.8.0.dev0
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
Delete project reminder on backend When a reminder is deleted on the front-end ensure that it is also deleted on the backend.
class MCProjectHomeRemindersComponentController { /*@ngInject*/ constructor(projectsAPI) { this.projectsAPI = projectsAPI; } removeReminder(index) { this.project.reminders.splice(index, 1); this.projectsAPI.updateProject(this.project.id, {reminders: this.project.reminders}); ...
class MCProjectHomeRemindersComponentController { /*@ngInject*/ constructor(projectsAPI) { this.projectsAPI = projectsAPI; } removeReminder(index) { this.project.reminders.splice(index, 1); } addReminder() { this.project.reminders.push({note: '', status: 'none'}); }...
Create a closure for click handlers in a loop
var d = new Discovery(); var controller; $("button#discovery").bind("click", function(e){ d.start(function(data) { $("output .progress").append(data.host).append("<br/>"); controller = new NetiaController(data.host, data.port); fillActions($("output .controller"), controller); }); }) $("button#c...
var d = new Discovery(); var controller; $("button#discovery").bind("click", function(e){ d.start(function(data) { $("output .progress").append(data.host).append("<br/>"); controller = new NetiaController(data.host, data.port); fillActions($("output .controller"), controller); }); }) $("button#c...
Move `||` at the beginning of lines to end of previous line
<?php declare (strict_types = 1); \Jentil()->utilities->loader->loadPartial('header'); if (!\Jentil()->utilities->page->is('singular')) { if (($jentil_title = \Jentil()->utilities->page->title->themeMod()->get()) || \Jentil()->utilities->page->is('customize_preview') ) { ?> <header cla...
<?php declare (strict_types = 1); \Jentil()->utilities->loader->loadPartial('header'); if (!\Jentil()->utilities->page->is('singular')) { if (($jentil_title = \Jentil()->utilities->page->title->themeMod()->get()) || \Jentil()->utilities->page->is('customize_preview') ) { ?> <header class="page...
Fix incorrect login after confirming token
<?php namespace Flarum\Core\Handlers\Commands; use Flarum\Core\Repositories\UserRepositoryInterface as UserRepository; use Flarum\Core\Events\UserWillBeSaved; use Flarum\Core\Support\DispatchesEvents; use Flarum\Core\Exceptions\InvalidConfirmationTokenException; use Flarum\Core\Models\EmailToken; class ConfirmEmailCo...
<?php namespace Flarum\Core\Handlers\Commands; use Flarum\Core\Repositories\UserRepositoryInterface as UserRepository; use Flarum\Core\Events\UserWillBeSaved; use Flarum\Core\Support\DispatchesEvents; use Flarum\Core\Exceptions\InvalidConfirmationTokenException; use Flarum\Core\Models\EmailToken; class ConfirmEmailCo...
Set charset in DSN string
<?php /** * This file is part of the Krystal Framework * * Copyright (c) No Global State Lab * * For the full copyright and license information, please view * the license file that was distributed with this source code. */ namespace Krystal\Db\Sql\Connector; use PDO; final class MySQL implements ConnectorI...
<?php /** * This file is part of the Krystal Framework * * Copyright (c) No Global State Lab * * For the full copyright and license information, please view * the license file that was distributed with this source code. */ namespace Krystal\Db\Sql\Connector; use PDO; final class MySQL implements ConnectorI...
Fix impl of the phase handler interfaces
package main import ( "fmt" "log" "github.com/ghthor/engine/rpg2d" "github.com/ghthor/engine/rpg2d/quad" "github.com/ghthor/engine/sim/stime" ) type inputPhase struct{} type narrowPhase struct{} func (inputPhase) ApplyInputsIn(c quad.Chunk, now stime.Time) quad.Chunk { for _, e := range c.Entities { switch ...
package main import ( "fmt" "log" "github.com/ghthor/engine/rpg2d" "github.com/ghthor/engine/rpg2d/quad" ) type inputPhase struct{} type narrowPhase struct{} func (inputPhase) ApplyInputsIn(c quad.Chunk) quad.Chunk { for _, e := range c.Entities { switch a := e.(type) { case actor: input := a.ReadInput(...
Startup: Make test room shorter for ease of testing
import sge from . import config from . import game from . import player from . import rooms def initialize(config): """Load assets and initialize the game objects""" sge.game = game.Game( width=config.GAME_WINDOW_WIDTH, height=config.GAME_WINDOW_HEIGHT, fps=config.GAME_FPS, wi...
import sge from . import config from . import game from . import player from . import rooms def initialize(config): """Load assets and initialize the game objects""" sge.game = game.Game( width=config.GAME_WINDOW_WIDTH, height=config.GAME_WINDOW_HEIGHT, fps=config.GAME_FPS, wi...
Add example to escapeURI function.
/** * Escape URI components utility. * * Site Kit by Google, Copyright 2020 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE...
/** * Escape URI components utility. * * Site Kit by Google, Copyright 2020 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE...
Remove slash from asset paths.
var ready = function(fn) { if (document.readyState != 'loading') { fn(); } else if (document.addEventListener) { document.addEventListener('DOMContentLoaded', fn); } else { document.attachEvent('onreadystatechange', function() { if (document.readyState != 'loading') ...
var ready = function(fn) { if (document.readyState != 'loading') { fn(); } else if (document.addEventListener) { document.addEventListener('DOMContentLoaded', fn); } else { document.attachEvent('onreadystatechange', function() { if (document.readyState != 'loading') ...
Copy space separeted title and url to clipboard
function copyToClipboard(str){ 'use strict'; // Copy str to clipboard var textArea = document.createElement('textarea'); document.body.appendChild(textArea); textArea.value = str; textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); } window.addEventListener('load', fu...
function copyToClipboard(str){ 'use strict'; // Copy str to clipboard var textArea = document.createElement('textarea'); document.body.appendChild(textArea); textArea.value = str; textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); } window.addEventListener('load', fu...
Bump version to 0.1.post1 to re-release on PyPi correctly packaged
#!/usr/bin/env python # # The Template-Python distribution is Copyright (C) Sean McAfee 2007-2008, # derived from the Perl Template Toolkit Copyright (C) 1996-2007 Andy # Wardley. All Rights Reserved. # # The file "LICENSE" at the top level of this source distribution describes # the terms under which this file ...
#!/usr/bin/env python # # The Template-Python distribution is Copyright (C) Sean McAfee 2007-2008, # derived from the Perl Template Toolkit Copyright (C) 1996-2007 Andy # Wardley. All Rights Reserved. # # The file "LICENSE" at the top level of this source distribution describes # the terms under which this file ...
Add data base root commands
/** * Created by Eduardo veras on 19-Jun-16. * Edited by Siclait on 19-Juu-16 */ import Entity.*; import Service.*; import java.util.List; public class DatabaseManager { // Singleton Constructor private DatabaseManager(){ } public static void BootDataBase(){ List<User> users = UserORMS...
/** * Created by Eduardo veras on 19-Jun-16. * Edited by Siclait on 19-Juu-16 */ import Entity.*; import Service.*; import java.util.List; public class DatabaseManager { // Singleton Constructor private DatabaseManager(){ } public static void BootDataBase(){ List<User> users = UserORMS...
Update how we set the connection information for MongoDB to support Mongo 3.0.5 Signed-off-by: Robert Dempsey <715b5a941e732be1613fdd9d94dfd8e50c02b187@gmail.com>
# -*- coding: utf-8 -*- from flask import Flask, render_template from flask.ext.mongoengine import MongoEngine, MongoEngineSessionInterface import configparser from .momentjs import momentjs app = Flask(__name__) # Security WTF_CSRF_ENABLED = True app.config['SECRET_KEY'] = '2bN9UUaBpcjrxR' app.jinja_env.globals['mome...
# -*- coding: utf-8 -*- from flask import Flask, render_template from flask.ext.mongoengine import MongoEngine, MongoEngineSessionInterface import configparser from .momentjs import momentjs app = Flask(__name__) # Security WTF_CSRF_ENABLED = True app.config['SECRET_KEY'] = '2bN9UUaBpcjrxR' app.jinja_env.globals['mome...
Insert new sections into collection.
Template.addSection.events({ 'click #add-section-button': function (event, template) { /* / Add new section to the course */ // Get current sections, before adding new section if (this.sections) { // If sections exists, use them var sections = this.se...
Template.addSection.events({ 'click #add-section-button': function (event, template) { /* / Add new section to the course */ // Get current sections, before adding new section if (this.sections) { // If sections exists, use them var sections = this.se...
Set DB's Error if get any validation error
package validations import ( "errors" "fmt" "github.com/jinzhu/gorm" ) var settingKey = "validations:errors" func AddError(db *gorm.DB, resource interface{}, err string) { var validationErrors = GetErrors(db) var scope = db.NewScope(resource) key := fmt.Sprintf("%v_%v", scope.GetModelStruct().ModelType.Name(...
package validations import ( "fmt" "github.com/jinzhu/gorm" ) var settingKey = "validations:errors" func AddError(db *gorm.DB, resource interface{}, err string) { var errors = GetErrors(db) var scope = db.NewScope(resource) key := fmt.Sprintf("%v_%v", scope.GetModelStruct().ModelType.Name(), scope.PrimaryKeyV...
Change the generated markup so that attribute names are properly marked.
# Lame substitute for a fine script to generate the table from ast.txt from compiler import astgen AST_DEF = '../compiler/ast.txt' def sort(l): l = l[:] l.sort(lambda a, b: cmp(a.name, b.name)) return l def main(): nodes = astgen.parse_spec(AST_DEF) print "\\begin{longtableiii}{lll}{class}{Node ...
# Lame substitute for a fine script to generate the table from ast.txt from compiler import astgen AST_DEF = '../compiler/ast.txt' def sort(l): l = l[:] l.sort(lambda a, b: cmp(a.name, b.name)) return l def main(): nodes = astgen.parse_spec(AST_DEF) print "\\begin{longtableiii}{lll}{class}{Node ...
Improve logging for unknown/empty messages
/* * Copyright 2016 higherfrequencytrading.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 required by applicable la...
/* * Copyright 2016 higherfrequencytrading.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 required by applicable la...
Add default FS root to new FS objects
/* * * 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"); y...
/* * * 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"); y...
Update fields helper to use relative keystone path - @morenoh149
var fs = require('fs'), keystone = require('../index'); exports.init = function (shouldRunTests) { keystone.init(); var typesLoc = __dirname + '/../fields/types'; var types = fs.readdirSync(typesLoc); types.forEach(function(name) { var serverTestLoc = typesLoc + '/' + name + '/test/server.js'; if (!fs.exist...
var fs = require('fs'), keystone = require('keystone'); exports.init = function (shouldRunTests) { keystone.init(); var typesLoc = __dirname + '/../fields/types'; var types = fs.readdirSync(typesLoc); types.forEach(function(name) { var serverTestLoc = typesLoc + '/' + name + '/test/server.js'; if (!fs.exist...
Use yaml for file format...
package config import ( "io/ioutil" "gopkg.in/yaml.v2" ) type Config struct { ConfigFile string Paths map[string]string } func (c *Config) readConfig() error { c.Paths = make(map[string]string) content, err := ioutil.ReadFile(c.ConfigFile) if err != nil { return err } m := make(map[interface{}]inte...
package config import ( "bufio" "fmt" "os" "strings" ) type Config struct { ConfigFile string Paths map[string]string } func (c *Config) readConfig() error { c.Paths = make(map[string]string) file, err := os.Open(c.ConfigFile) defer file.Close() if err == nil { scanner := bufio.NewScanner(file) f...
Add return type to __toString()
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\LoginLink; /** * @author Ryan Weaver <...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\LoginLink; /** * @author Ryan Weaver <...
Change watcher to include the lib dir
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), browserify: { RTCReceiver: { src: './RTCReceiver/main.js', dest: '../webservice/public/js/builds/RTCReceiver.js' }, RTCSender: { src: './RTCSender/main.js', dest: '...
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), browserify: { RTCReceiver: { src: './RTCReceiver/main.js', dest: '../webservice/public/js/builds/RTCReceiver.js' }, RTCSender: { src: './RTCSender/main.js', dest: '...
Remove duplicate Flask-Login session protection setting
from flask import Flask from flask.ext.bootstrap import Bootstrap from flask.ext.mail import Mail from flask.ext.moment import Moment from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from config import config bootstrap = Bootstrap() mail = Mail() moment = Moment() db = SQLAlchemy() ...
from flask import Flask from flask.ext.bootstrap import Bootstrap from flask.ext.mail import Mail from flask.ext.moment import Moment from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from config import config bootstrap = Bootstrap() mail = Mail() moment = Moment() db = SQLAlchemy() ...
chore(repl): Use process argv as inspection source
var UDF = require( '..' ) var BlockDevice = require( 'blockdevice' ) var util = require( 'util' ) var fs = require( 'fs' ) var path = require( 'path' ) var argv = process.argv.slice(2) function inspect( value ) { return util.inspect( value, { depth: null, colors: process.stdout.isTTY, }) } var EOL = '\n' ...
var UDF = require( '..' ) var BlockDevice = require( 'blockdevice' ) var util = require( 'util' ) var fs = require( 'fs' ) var path = require( 'path' ) function inspect( value ) { return util.inspect( value, { depth: null, colors: process.stdout.isTTY, }) } var EOL = '\n' console.log( EOL + 'UDF', inspec...
Tidy up upload response a bit
import os.path from flask import abort, request, jsonify, redirect, url_for from IATISimpleTester import app, db from IATISimpleTester.models import SuppliedData @app.route('/upload', methods=['GET', 'POST']) def upload(): source_url = request.args.get('source_url') file = request.files.get('file') raw_...
import os.path from flask import request, jsonify, redirect, url_for from IATISimpleTester import app, db from IATISimpleTester.models import SuppliedData @app.route('/upload', methods=['GET', 'POST']) def upload(): resp = {} source_url = request.args.get('source_url') file = request.files.get('file') ...
Stop forwarding flash by default, it breaks more than it doesn't. git-svn-id: 87d19257dd11500985d055ec4730e446075a5f07@1279 78c7df6f-8922-0410-bcd3-9426b1ad491b
# Copyright (c) 2006-2007 Open Source Applications Foundation # Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@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 # # ...
# Copyright (c) 2006-2007 Open Source Applications Foundation # Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@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 # # ...
Use min version of jQuery
const path = require('path') const webpack = require('webpack') const pkg = require('./package') module.exports = { mode: 'production', entry: { main: [ path.resolve(__dirname, 'node_modules/jquery/dist/jquery.js'), path.resolve(__dirname, 'node_modules/css-modal/modal.js'), path.resolve(__di...
const path = require('path') const webpack = require('webpack') const pkg = require('./package') module.exports = { mode: 'production', entry: { main: [ path.resolve(__dirname, 'node_modules/jquery/dist/jquery.min.js'), path.resolve(__dirname, 'node_modules/css-modal/modal.js'), path.resolve(...
Move form creation to containers for new project
const React = require('react'); const ReactRedux = require('react-redux'); const ReduxForm = require('redux-form'); const selectors = require('@state/selectors'); const PropTypes = require('@root/prop-types'); const CreateProject = require('@components/new-project'); const { connect } = ReactRedux; const { reduxF...
const React = require('react'); const ReactRedux = require('react-redux'); const ReduxForm = require('redux-form'); const selectors = require('@state/selectors'); const selectors = require('@state/selectors'); const PropTypes = require('@root/prop-types'); const CreateProject = require('@components/new-project'); con...
Use DefaultRouter which includes a default API root view.
from django.conf.urls import include, url from django.contrib import admin from rest_framework import routers from rest_framework.authtoken.views import obtain_auth_token from grd import views router = routers.DefaultRouter() router.register(r'devices', views.DeviceView) urlpatterns = [ # Examples: # url(r'...
from django.conf.urls import include, url from django.contrib import admin from rest_framework import routers from rest_framework.authtoken.views import obtain_auth_token from grd import views router = routers.SimpleRouter() router.register(r'devices', views.DeviceView) urlpatterns = [ # Examples: # url(r'^...
Add docstrings to view classes
from django.http import HttpResponse from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView from rest_framework.response import Response from registries.models import Organization from registries.serializers import DrillerListSerializer, DrillerSerializer class APIDrillerListCreateView(Lis...
from django.http import HttpResponse from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView from rest_framework.response import Response from registries.models import Organization from registries.serializers import DrillerListSerializer, DrillerSerializer class APIDrillerListCreateView(Lis...
Fix screenName parameter in ScreenHit class Changed property dp to cd to match Google Analytics screen hit request reference See https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide *Request* `` v=1 // Version. &tid=UA-XXXXX-Y // Tracking ID /...
export class Serializable { constructor(props) { this.properties = props || {}; } toObject() { return this.properties; } toString() { return JSON.stringify(this.toObject()); } toJSON() { return JSON.stringify(this.properties); } toQueryString() { ...
export class Serializable { constructor(props) { this.properties = props || {}; } toObject() { return this.properties; } toString() { return JSON.stringify(this.toObject()); } toJSON() { return JSON.stringify(this.properties); } toQueryString() { ...
Update to make sure the auth date is on utc for time zone support on devices
from django.contrib.auth.models import * from django.contrib.auth.backends import ModelBackend from django.utils.translation import ugettext_lazy as _ from OctaHomeCore.basemodels import * from OctaHomeCore.authmodels import * import datetime import string import random import hashlib import time from authy.api impor...
from django.contrib.auth.models import * from django.contrib.auth.backends import ModelBackend from django.utils.translation import ugettext_lazy as _ from OctaHomeCore.basemodels import * from OctaHomeCore.authmodels import * import string import random import hashlib import time from authy.api import AuthyApiClient...
Add test for deleting message
import React from 'react'; import expect from 'expect'; import { mount } from 'enzyme'; import styles from '../../src/chat.scss'; import Message from '../../src/components/messages/Message'; const props = { message: { id: 1, name: 'John', avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/oagra/12...
import React from 'react'; import expect from 'expect'; import { mount } from 'enzyme'; import styles from '../../src/chat.scss'; import Message from '../../src/components/messages/Message'; const props = { message: { id: 1, name: 'John', avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/oagra/12...
Remove static import, code is more readable like this
package com.nelsonjrodrigues.pchud.net; public class Extractor { private byte[] buffer; private int offset; private int length; public Extractor(byte[] buffer, int offset, int length) { this.buffer = buffer; this.offset = offset; this.length = length; } public int u8(...
package com.nelsonjrodrigues.pchud.net; import static java.lang.Byte.toUnsignedInt; public class Extractor { private byte[] buffer; private int offset; private int length; public Extractor(byte[] buffer, int offset, int length) { this.buffer = buffer; this.offset = offset; ...
Throw explicit error when we can't find a skin.
const { getSkinToReview } = require("../../s3"); const Utils = require("../utils"); async function reviewSkin(message) { const skin = await getSkinToReview(); if(skin == null) { throw new Error("No skins to review"); } const {md5, filename} = skin; await Utils.postSkin({ md5, title: filename => `...
const { getSkinToReview } = require("../../s3"); const Utils = require("../utils"); async function reviewSkin(message) { const { md5 } = await getSkinToReview(); await Utils.postSkin({ md5, title: filename => `Review: ${filename}`, dest: message.channel }); } async function handler(message, args) { ...
Fix response tests in py3
import json from echo.response import EchoResponse, EchoSimplePlainTextResponse from echo.tests import BaseEchoTestCase class TestEchoSimplePlainTextResponse(BaseEchoTestCase): def test_populates_text_in_response(self): """The Plain text response should populate the outputSpeech""" expected = "Th...
import json from echo.response import EchoResponse, EchoSimplePlainTextResponse from echo.tests import BaseEchoTestCase class TestEchoSimplePlainTextResponse(BaseEchoTestCase): def test_populates_text_in_response(self): """The Plain text response should populate the outputSpeech""" expected = "Th...
Adjust migration for cumulative field.
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateModifiersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('amazo_mods', function (Blueprint $table) { ...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateModifiersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('amazo_mods', function (Blueprint $table) { ...
Fix for no role in admin access wrapper
from flask import redirect as _redirect, url_for, render_template, g from functools import wraps def login_required(f, redirect='login'): """Redirects non-logged in users to a specified location. Usage: `@login_required`, `@login_required(redirect=<url>)` """ @wraps(f) def decorated_function(*args, **kwar...
from flask import redirect as _redirect, url_for, render_template, g from functools import wraps def login_required(f, redirect='login'): """Redirects non-logged in users to a specified location. Usage: `@login_required`, `@login_required(redirect=<url>)` """ @wraps(f) def decorated_function(*args, **kwar...
FIX example for both Win and NIX TODO: tasks wont work
import asyncio import sys from contextlib import suppress sys.path.append("..") from asynccmd import Cmd class Commander(Cmd): def __init__(self, intro, prompt): if sys.platform == 'win32': super().__init__(mode="Run", run_loop=False) else: super().__init__(mode="Reader", ru...
import asyncio import sys from contextlib import suppress sys.path.append("..") from asynccmd import Cmd class Commander(Cmd): def __init__(self, intro, prompt): if sys.platform == 'win32': super().__init__(mode="Run", run_loop=False) else: super().__init__(mode="Reader", ru...
Fix name of command sent by send_dialogue action.
from go.vumitools.conversation.definition import ( ConversationDefinitionBase, ConversationAction) class SendDialogueAction(ConversationAction): action_name = 'send_dialogue' action_display_name = 'Send Dialogue' needs_confirmation = True needs_group = True needs_running = True def chec...
from go.vumitools.conversation.definition import ( ConversationDefinitionBase, ConversationAction) class SendDialogueAction(ConversationAction): action_name = 'send_dialogue' action_display_name = 'Send Dialogue' needs_confirmation = True needs_group = True needs_running = True def chec...
Convert price to float to compare
<?php function GetAuctionData($gameID){ $data = json_decode(file_get_contents('https://www.g2a.com/marketplace/product/auctions/?id=' . $gameID), true); $data = array_values(array_values($data)[0])[0]; $result = array(); $result['price'] = (float) $data['p']; $result['rating'] = $data['r']; $res...
<?php function GetAuctionData($gameID){ $data = json_decode(file_get_contents('https://www.g2a.com/marketplace/product/auctions/?id=' . $gameID), true); $data = array_values(array_values($data)[0])[0]; $result = array(); $result['price'] = $data['p']; $result['rating'] = $data['r']; $result['sel...