text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Set default timezone based on config.
<?php /** * Bitcoin Status Page * * @category File * @package BitcoinStatus * @author Craig Watson <craig@cwatson.org> * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 * @link https://github.com/craigwatson/bitcoind-status */ if (!is_file('./php/config.php')) { die...
<?php /** * Bitcoin Status Page * * @category File * @package BitcoinStatus * @author Craig Watson <craig@cwatson.org> * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 * @link https://github.com/craigwatson/bitcoind-status */ if (!is_file('./php/config.php')) { die...
Fix null insertion in data context
import { EJSON } from 'meteor/ejson'; /* eslint-disable no-undef, import/no-extraneous-dependencies, import/no-unresolved, import/extensions, max-len */ import serialize from 'serialize-javascript'; /* eslint-enable */ import { valueSet } from '../../shared/actions/utils'; // Impure function /* eslint-disable no-param-...
import { EJSON } from 'meteor/ejson'; /* eslint-disable no-undef, import/no-extraneous-dependencies, import/no-unresolved, import/extensions, max-len */ import serialize from 'serialize-javascript'; /* eslint-enable */ import { valueSet } from '../../shared/actions/utils'; // Impure function /* eslint-disable no-param-...
Fix comments count in topic detail
package org.mazhuang.guanggoo.data.entity; import java.util.Map; /** * * @author mazhuang * @date 2017/9/17 */ public class TopicDetail { private Favorite favorite; private Topic topic; private String content; private Map<Integer, Comment> comments; public String getContent() { retu...
package org.mazhuang.guanggoo.data.entity; import java.util.Map; /** * * @author mazhuang * @date 2017/9/17 */ public class TopicDetail { private Favorite favorite; private Topic topic; private String content; private Map<Integer, Comment> comments; public String getContent() { retu...
Add newlines after class bracket
package com.kevinsimard.lambda.function; import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; @SuppressWarnings("unused") public class Example implements RequestHandler<Example.Request, Example.Response> { public Response handleRequest(Request request...
package com.kevinsimard.lambda.function; import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; @SuppressWarnings("unused") public class Example implements RequestHandler<Example.Request, Example.Response> { public Response handleRequest(Request request...
Allow function to be provided args
import { nextCoord } from './utils'; export function tile(coord) { coord = coord || { x: this.x, y: this.y }; return pixelToTile({ x: coord.x, y: coord.y, }); } export function nextTile(tile, faceDirection) { tile = tile || this.tile; faceDirection = faceDirection || this.faceDirection; return n...
import { nextCoord } from './utils'; export function tile() { return pixelToTile({ x: this.x, y: this.y, }); } export function nextTile(tile, faceDirection) { tile = tile || this.tile; faceDirection = faceDirection || this.faceDirection; return nextCoord(tile, faceDirection, 1); } export function ...
Allow latest targets, map to '*'-
var semver = require('semver'); var createError = require('./createError'); function decompose(endpoint) { var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)=)?([^\|#]+)(?:#(.*))?$/; var matches = endpoint.match(regExp); var target; if (!matches) { throw createError('Invalid endpoint: ' + endpoin...
var semver = require('semver'); var createError = require('./createError'); function decompose(endpoint) { var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)=)?([^\|#]+)(?:#(.*))?$/; var matches = endpoint.match(regExp); if (!matches) { throw createError('Invalid endpoint: ' + endpoint, 'EINVEND'); ...
[MIG] Migrate l10n_br_data_base to version 10
# -*- coding: utf-8 -*- # Copyright (C) 2009 - TODAY Renato Lima - Akretion # # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localisation Data Extension for Base', 'license': 'AGPL-3', 'author': 'Akretion, Odoo Community Association (OCA)', ...
# -*- coding: utf-8 -*- # Copyright (C) 2009 - TODAY Renato Lima - Akretion # # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localisation Data Extension for Base', 'license': 'AGPL-3', 'author': 'Akretion, Odoo Community Association (OCA)', ...
Enable using : to indicate . namespacing for mongo.
module.exports = { events: { 'submit': 'filter' }, attach: function() { var _view = this; _view.regex = []; this.$('input[data-regex]').each(function() { _view.regex.push({ el: this, namespace: this.name.split('.').map(function(value) { return value.split(':').join('.'); }), flags...
module.exports = { events: { 'submit': 'filter' }, attach: function() { var _view = this; _view.regex = []; this.$('input[data-regex]').each(function() { _view.regex.push({ el: this, namespace: this.name.split('.'), flags: $(this).data('flags') || '' }); }); }, filter: function(e)...
Change type to shipment in dispatching.
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class EcontDispatching extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::setConnection(DB::connection(Config::get('econt.connection')))->...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class EcontDispatching extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::setConnection(DB::connection(Config::get('econt.connection')))->...
Add a limit in ls command. AcceptMore middleware now works correctly. Signed-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@2metz.fr>
var intervals = require('./intervals') , Table = require('cli-table') , utils = require('./utils') ; module.exports = function(conf, opts) { var dates = utils.parseDate(opts.date); var start = dates[0]; var end = dates[dates.length - 1]; console.log("Show timesheet from %s to %s", start, end); ...
var intervals = require('./intervals') , Table = require('cli-table') , utils = require('./utils') ; module.exports = function(conf, opts) { var dates = utils.parseDate(opts.date); var start = dates[0]; var end = dates[dates.length - 1]; console.log("Show timesheet from %s to %s", start, end); ...
Support for multiple storage names
// Returns primitive { ownerId: sortIndexValue } map for provided sortKeyPath 'use strict'; var ensureString = require('es5-ext/object/validate-stringifiable-value') , ee = require('event-emitter') , memoize = require('memoizee') , dbDriver = require('mano').dbDriver , isArray = Array.isAr...
// Returns primitive { ownerId: sortIndexValue } map for provided sortKeyPath 'use strict'; var ensureString = require('es5-ext/object/validate-stringifiable-value') , ee = require('event-emitter') , memoize = require('memoizee') , dbDriver = require('mano').dbDriver; module.exports = memoiz...
Revert "changes in locator_50 file (current and old versions)" This reverts commit 819dfa4ed2033c1f82973edb09215b96d3c4b188.
from locators_51 import * import copy npsp_lex_locators = copy.deepcopy(npsp_lex_locators) npsp_lex_locators['delete_icon']='//span[contains(text() ,"{}")]/following::span[. = "{}"]/following-sibling::a/child::span[@class = "deleteIcon"]' npsp_lex_locators['object']['field']= "//div[contains(@class, 'uiInput')][.//lab...
from locators_51 import * import copy npsp_lex_locators = copy.deepcopy(npsp_lex_locators) # current version (Sravani's ) npsp_lex_locators['delete_icon']='//span[contains(text() ,"{}")]/following::span[. = "{}"]/following-sibling::a/child::span[@class = "deleteIcon"]' npsp_lex_locators['object']['field']= "//div[con...
Update file to exclude User Stories.
##PSEUDOCODE input: An array of numbers output: 1) the sum of all the numbers inside the array, 2) the "mean" average of the numbers inside the array, 3) the median number from the array # Create an array of single-digit numbers # Iterate through the array of numbers to calculate and return its sum (non-destructive...
##USER STORIES // /As a user i’d like to do three things to a list of numbers. // Using “sum” and the list I want to add together all the numbers whether the list is even or odd in length. // I’d like to use “mean” to return the average of all the numbers in the list. // Finally I’d like to use “median” to return the ...
Verify if any file was choosen inside of the iframe load handler.
var Bind = require("github/jillix/bind"); var Events = require("github/jillix/events"); module.exports = function(config) { var self = this; Events.call(self, config); var $iframe = $("iframe", self.dom); $("form", self.dom).on("submit", function () { var $form = $(this); $iframe.off(...
var Bind = require("github/jillix/bind"); var Events = require("github/jillix/events"); module.exports = function(config) { var self = this; Events.call(self, config); var $iframe = $("iframe", self.dom); $("form", self.dom).on("submit", function () { if (!$(this).find("input[type='file']").v...
Improve UX of deck upload button
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ...
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ...
Add save table row action
const ADD_TABLE_ROW = "ADD_TABLE_ROW" const EDIT_TABLE_ROW = "EDIT_TABLE_ROW" const SAVE_TABLE_ROW = "SAVE_TABLE_ROW" let nextTableRowId = 0 const addTableRow = (tableRow) => { return { type: ADD_TABLE_ROW, tableRow, id: nextTableRowId++ } } //Remove editing state from TableRow, use this passed down a...
const ADD_TABLE_ROW = "ADD_TABLE_ROW" const EDIT_TABLE_ROW = "EDIT_TABLE_ROW" const UPDATE_TABLE_CELL = "UPDATE_TABLE_CELL" let nextTableRowId = 0 const addTableRow = (tableRow) => { return { type: ADD_TABLE_ROW, tableRow, id: nextTableRowId++ } } const editTableRow = (id) => { return { type: ED...
Fix frontpage webhook to deploy from main
#!/usr/bin/env node /* eslint-disable no-console */ const fetch = require('node-fetch'); const { execSync } = require('child_process'); const { FRONTPAGE_WEBHOOK, FRONTPAGE_WEBHOOK_NEXT } = process.env; const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim(); const branchToHook = { main: FRON...
#!/usr/bin/env node /* eslint-disable no-console */ const fetch = require('node-fetch'); const { execSync } = require('child_process'); const { FRONTPAGE_WEBHOOK, FRONTPAGE_WEBHOOK_NEXT } = process.env; const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim(); const branchToHook = { master: FR...
Set min donation to 1
const config = { logLevel: process.env.LOG_LEVEL || 'info', couchDb: { url: process.env.COUCHDB_URL, dbName: 'q' }, http: { port: 3000 }, business: { adminFee: 0.15, maxDonation: 500, minDonation: 1 }, obp: { active: process.env.OBP_ACTIVE, userId: 'ccaec25d-214f-4ec3-a56...
const config = { logLevel: process.env.LOG_LEVEL || 'info', couchDb: { url: process.env.COUCHDB_URL, dbName: 'q' }, http: { port: 3000 }, business: { adminFee: 0.15, maxDonation: 500, minDonation: 0 }, obp: { active: process.env.OBP_ACTIVE, userId: 'ccaec25d-214f-4ec3-a56...
Fix data collector function unimplemented
<?php namespace JDecool\Bundle\TwigConstantAccessorBundle\DataCollector; use JDecool\Bundle\TwigConstantAccessorBundle\Accessor\ConstantCollection; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DataCollector\DataCollector; class Constant...
<?php namespace JDecool\Bundle\TwigConstantAccessorBundle\DataCollector; use JDecool\Bundle\TwigConstantAccessorBundle\Accessor\ConstantCollection; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DataCollector\DataCollector; class Constant...
Add Userscript variable to ESLint settings
module.exports = { "env": { "browser": true, "es2021": true }, "globals": { "module": "readonly", "Game": "writable", "l": "readonly", "b64_to_utf8": "readonly", "utf8_to_b64": "readonly", "Beautify": "writable", "realAudio": "readonly"...
module.exports = { "env": { "browser": true, "es2021": true }, "globals": { "module": "readonly", "Game": "writable", "l": "readonly", "b64_to_utf8": "readonly", "utf8_to_b64": "readonly", "Beautify": "writable", "realAudio": "readonly"...
Change distribution script to support python 3.5
import subprocess def load_configuration(environment): configuration = { "project": "nimp", "project_version": { "identifier": "0.9.6" }, "distribution": "nimp-cli", } configuration["project_version"]["revision"] = subprocess.check_output([ environment["git_executable"], "rev-pars...
import subprocess def load_configuration(environment): configuration = { "project": "nimp", "project_version": { "identifier": "0.9.6" }, "distribution": "nimp-cli", } revision = subprocess.run([ environment["git_executable"], "rev-parse", "--short=10", "HEAD" ], check = True, cap...
Remove async/await from example to comply with lts/boron lang support
const { expectRedux, storeSpy } = require("expect-redux"); const { configureStore } = require("./store"); const storeForTest = () => configureStore([storeSpy]); const effect = dispatch => { dispatch({ type: "REQUEST_STARTED" }); return fetch("/api/count").then(result => { if (result.ok) { return result...
const { expectRedux, storeSpy } = require("expect-redux"); const { configureStore } = require("./store"); const storeForTest = () => configureStore([storeSpy]); const effect = async dispatch => { dispatch({ type: "REQUEST_STARTED" }); const result = await fetch("/api/count"); if (result.ok) { dispatch({ ...
Add extra check in keyExtractor to prevent dublicate keys
import React from 'react' import { Text } from 'react-native' import { withNavigation } from 'react-navigation' import ShuttleOverview from './ShuttleOverview' import ScrollCard from '../common/ScrollCard' import Touchable from '../common/Touchable' import css from '../../styles/css' export const ShuttleCard = ({ na...
import React from 'react' import { Text } from 'react-native' import { withNavigation } from 'react-navigation' import ShuttleOverview from './ShuttleOverview' import ScrollCard from '../common/ScrollCard' import Touchable from '../common/Touchable' import css from '../../styles/css' export const ShuttleCard = ({ na...
Fix in 'modules' project for module class name to module base namespace for setting up routing.
<?php $router = $di->getRouter(); foreach ($application->getModules() as $key => $module) { $namespace = preg_replace('/Module$/', 'Controllers', $module["className"]); $router->add('/'.$key.'/:params', [ 'namespace' => $namespace, 'module' => $key, 'controller' => 'index', 'ac...
<?php $router = $di->get("router"); foreach ($application->getModules() as $key => $module) { $namespace = str_replace('Module','Controllers', $module["className"]); $router->add('/'.$key.'/:params', [ 'namespace' => $namespace, 'module' => $key, 'controller' => 'index', 'actio...
Make script run and fix all typos
import requests url = "https://ua.api.yle.fi/graphql?app_id=8d7303fe&app_key=105875199ef3a1f7e0fbf7e2834b2dc&query={uutisetMostRecentNews:articleList(publisher:YLE_UUTISET,limit:100,offset:0,coverage:NATIONAL){meta{count,total,remaining},items{fullUrl,properties}}}" i = 0 while True: url = "https://ua.api.yle....
import requests url = "https://ua.api.yle.fi/graphql?app_id=8d7303fe&app_key=105875199ef3a1f7e0fbf7e2834b2dc&query={uutisetMostRecentNews:articleList(publisher:YLE_UUTISET,limit:100,offset:0,coverage:NATIONAL){meta{count,total,remaining},items{fullUrl,properties}}}" i = 0 while True: url = "https://ua.api.yle.f...
Add rootCollection option to SkinGridStore.exist
var GridStore = require('mongodb').GridStore; /** * @param filename: filename or ObjectId */ var SkinGridStore = exports.SkinGridStore = function(skinDb) { this.skinDb = skinDb; } /** * @param filename: filename or ObjectId * callback(err, gridStoreObject) */ SkinGridStore.prototype.open = function(filename,...
var GridStore = require('mongodb').GridStore; /** * @param filename: filename or ObjectId */ var SkinGridStore = exports.SkinGridStore = function(skinDb) { this.skinDb = skinDb; } /** * @param filename: filename or ObjectId * callback(err, gridStoreObject) */ SkinGridStore.prototype.open = function(filename,...
Rename the WebView manifest key name Rename SET_DATA_DIRECTORY_SUFFIX:DEV to STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX Change-Id: Id2a0a29a3cbc6972bbf285836cd13e8d2af7fd3d Test: ./gradlew webkit:integration-tests:testapp:connectedAndroidTest Bug: 250553687
/* * Copyright 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
/* * Copyright 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
Update gulp export support pretty
const gulp = require('gulp'), rename = require('gulp-rename'), less = require('gulp-less'), pug = require('gulp-pug') argv = require('yargs').argv /** * Compile less to css and minify */ gulp.task('less', function () { gulp.src('./src/less/**/*.less') .pipe(less({ compress:t...
const gulp = require('gulp'), rename = require('gulp-rename'), less = require('gulp-less'), pug = require('gulp-pug') argv = require('yargs').argv /** * Compile less to css and minify */ gulp.task('less', function () { gulp.src('./src/less/**/*.less') .pipe(less({ compress:t...
Update master version to 0.3-dev
#from distutils.core import setup from setuptools import setup descr = """Tree representations and algorithms for Python. Viridis is named after the green tree python, Morelia viridis. """ DISTNAME = 'viridis' DESCRIPTION = 'Tree data structures and algorithms' LONG_DESCRIPTION = descr MAINTAIN...
#from distutils.core import setup from setuptools import setup descr = """Tree representations and algorithms for Python. Viridis is named after the green tree python, Morelia viridis. """ DISTNAME = 'viridis' DESCRIPTION = 'Tree data structures and algorithms' LONG_DESCRIPTION = descr MAINTAIN...
Make flatten more portable again
import bisect def binary_search(a, x): i = bisect.bisect_left(a, x) return i != len(a) and a[i] == x def flatten(lst): res = [] def dfs(l): try: for i in l: dfs(i) except: res.append(l) dfs(lst) return res def choose(l, k): cur = [...
import bisect def binary_search(a, x): i = bisect.bisect_left(a, x) return i != len(a) and a[i] == x def flatten(lst): res = [] def dfs(l): try: for i in l: dfs(i) except: res.append(i) dfs(lst) return res def choose(l, k): cur = [...
Change function name of getServer
package org.sipc.se.plugin; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public abstract class PluginImpl implements Plugin , Comparable<PluginImpl> { private...
package org.sipc.se.plugin; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public abstract class PluginImpl implements Plugin , Comparable<PluginImpl> { private...
Fix bug where pressing v to change view mode resulted in unstoppable constant viewmode changing
s.Controls.Keyboard = function() { this.keyboard = new s.Keyboard(); }; s.Controls.Keyboard.prototype.update = function() { this.pitch = 0; this.roll = 0; this.yaw = 0; this.thrust = 0; this.fire = false; this.changeViewMode = false; if (this.keyboard.pressed('left')) { this.yaw = 1; } else if...
s.Controls.Keyboard = function() { this.keyboard = new s.Keyboard(); }; s.Controls.Keyboard.prototype.update = function() { this.pitch = 0; this.roll = 0; this.yaw = 0; this.thrust = 0; this.fire = false; if (this.keyboard.pressed('left')) { this.yaw = 1; } else if (this.keyboard.pressed('right'...
Fix the benchmark so it's not throwing exceptions every time a message is written
""" Benchmark of message serialization. The goal here is to mostly focus on performance of serialization, in a vaguely realistic manner. That is, mesages are logged in context of a message with a small number of fields. """ from __future__ import unicode_literals import time from eliot import Message, start_action,...
""" Benchmark of message serialization. The goal here is to mostly focus on performance of serialization, in a vaguely realistic manner. That is, mesages are logged in context of a message with a small number of fields. """ from __future__ import unicode_literals import time from eliot import Message, start_action,...
Set root name in constructor of TreeBuilder
<?php namespace Spraed\PDFGeneratorBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http:/...
<?php namespace Spraed\PDFGeneratorBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http:/...
Adjust import to fix build with PyInstaller.
from grow.pods import pods from grow.pods import storage from grow.conversion import content_locale_split import click import os @click.command() @click.argument('pod_path', default='.') @click.option('--type', type=click.Choice(['content_locale_split'])) def convert(pod_path, type): """Converts pod files from an...
from grow.pods import pods from grow.pods import storage from grow.conversion import * import click import os @click.command() @click.argument('pod_path', default='.') @click.option('--type', type=click.Choice(['content_locale_split'])) def convert(pod_path, type): """Converts pod files from an earlier version of...
Add caret to signify dropdown menu Sorry, don't know how to merge commits! :P
@inject('user', 'Illuminate\Contracts\Auth\Authenticatable') @if(get_meta('navigation::usernav', true)) <ul class="nav navbar-nav navbar-right"> <li class="dropdown" id="user-menu"> <a href="#user-menu" rel="user-menu" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-user"></i> {{ ! is_null(...
@inject('user', 'Illuminate\Contracts\Auth\Authenticatable') @if(get_meta('navigation::usernav', true)) <ul class="nav navbar-nav navbar-right"> <li class="dropdown" id="user-menu"> <a href="#user-menu" rel="user-menu" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-user"></i> {{ ! is_null($user) ...
Replace deprecated "getName()" method from Twig extensions.
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\ContentBundle\Twi...
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\ContentBundle\Twi...
Refactor <Checkbox> tests to reduce duplication
import React from 'react'; import ReactDOM from 'react-dom'; import { Simulate } from 'react-addons-test-utils'; import Checkbox from '../../../../src/components/checkbox.jsx'; import toggleableTests from '../toggleable/base.spec.js'; import { render } from '../../../helpers/rendering.js'; import $ from 'jquery'; des...
import React from 'react'; import ReactDOM from 'react-dom'; import { Simulate } from 'react-addons-test-utils'; import Checkbox from '../../../../src/components/checkbox.jsx'; import toggleableTests from '../toggleable/base.spec.js'; import { render } from '../../../helpers/rendering.js'; import $ from 'jquery'; des...
Remove incorrect usage of softdeletable annotation at property level The trait was not usable before this
<?php namespace Gedmo\SoftDeleteable\Traits; /** * SoftDeletable Trait, usable with PHP >= 5.4 * * @author Wesley van Opdorp <wesley.van.opdorp@freshheads.com> * @link http://www.gediminasm.org * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ trait SoftDeleteableEntity { /** ...
<?php namespace Gedmo\SoftDeleteable\Traits; /** * SoftDeletable Trait, usable with PHP >= 5.4 * * @author Wesley van Opdorp <wesley.van.opdorp@freshheads.com> * @link http://www.gediminasm.org * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ trait SoftDeleteableEntity { /** ...
Add description to adapter generator
import { Base } from 'yeoman-generator'; import generatorArguments from './arguments'; import generatorOptions from './options'; import generatorSteps from './steps'; export default class AdapterGenerator extends Base { constructor(...args) { super(...args); Object.keys(generatorArguments).forEach(key => th...
import { Base } from 'yeoman-generator'; import generatorArguments from './arguments'; import generatorOptions from './options'; import generatorSteps from './steps'; export default class AdapterGenerator extends Base { constructor(...args) { super(...args); Object.keys(generatorArguments).forEach(key => th...
Set Access-Control-Allow-Origin header value for production
const program = require('commander'); const MongoClient = require('mongodb').MongoClient; const logger = require('./logging').logger; program .version('0.1.0') .option('-e, --environment <e>', 'An environment of the working project', /^(dev|production)$/i, 'production') .option('-o, --origin <o>', 'The or...
const program = require('commander'); const MongoClient = require('mongodb').MongoClient; const logger = require('./logging').logger; program .version('0.1.0') .option('-e, --environment <e>', 'An environment of the working project', /^(dev|production)$/i, 'production') .option('-o, --origin <o>', 'The or...
Make sure we include package data too.
#!/usr/bin/env python from setuptools import setup, find_packages setup( name="django-salmonella", version='0.6', author='Lincoln Loop: Seth Buntin, Yann Malet', author_email='info@lincolnloop.com', description=("raw_id_fields widget replacement that handles display of an object's " ...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name="django-salmonella", version='0.6', author='Lincoln Loop: Seth Buntin, Yann Malet', author_email='info@lincolnloop.com', description=("raw_id_fields widget replacement that handles display of an object's " ...
Fix persian name caused by encoding issue.
package net.sf.jabref.logic.l10n; import java.util.Map; import java.util.TreeMap; public class Languages { public static final Map<String, String> LANGUAGES; static { LANGUAGES = new TreeMap<>(); // LANGUAGES contains mappings for supported languages. LANGUAGES.put("Dansk", "da"); ...
package net.sf.jabref.logic.l10n; import java.util.Map; import java.util.TreeMap; public class Languages { public static final Map<String, String> LANGUAGES; static { LANGUAGES = new TreeMap<>(); // LANGUAGES contains mappings for supported languages. LANGUAGES.put("Dansk", "da"); ...
Use HyperlinkedIdentityField for entries in ProjectDetailSerializer
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry class ProjectSerializer(Hype...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import HyperlinkedModelSerializer from trex.models.project import Project, Entry class ProjectSerializer(HyperlinkedModelSerializer): class...
Increase tree grow chance when testing
import Phaser from 'phaser'; import Tree from '../Tree'; import config from '../../../config'; const chanceToGrow = config.test ? 60 : 10; export default function place() { this.placed = true; this.game.time.events.add(Phaser.Timer.SECOND * 5, function() { if (this.destroyed) return; const number = Math...
import Phaser from 'phaser'; import Tree from '../Tree'; const chanceToGrow = 10; export default function place() { this.placed = true; this.game.time.events.add(Phaser.Timer.SECOND * 5, function() { if (this.destroyed) return; const number = Math.floor(Math.random() * 100) + 1; const playerTile = ...
Reorder writing of bashrc body sections.
#!/usr/bin/python # install_dotfiles # This script will build platform-specific dotfiles and create the appropriate symlinks in ~ import platform import os sysName = platform.system() os.remove('bashrc') bashrc = open('bashrc','a') bashrc.write("#!/bin/bash\n") bashrc.write("# This file was generated by a script. D...
#!/usr/bin/python # install_dotfiles # This script will build platform-specific dotfiles and create the appropriate symlinks in ~ import platform import os sysName = platform.system() os.remove('bashrc') bashrc = open('bashrc','a') def writeSection(fileName, allowComments): f = open(fileName,'r') for line in f...
Correct but on Capital filter
/* Filters */ angular.module('myApp.filters').filter('interpolate', function(version) { 'use strict'; return function(text) { return String(text).replace(/\%VERSION\%/mg, version); }; }).filter('percent', function() { 'use strict'; return function(number) { if (typeof number != 'nu...
/* Filters */ angular.module('myApp.filters').filter('interpolate', function(version) { 'use strict'; return function(text) { return String(text).replace(/\%VERSION\%/mg, version); }; }).filter('percent', function() { 'use strict'; return function(number) { if (typeof number != 'nu...
Add method for human markers
package org.pdxfinder.repositories; import org.pdxfinder.dao.Marker; import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import java.util.Collection; import java.util.List; /** * Interf...
package org.pdxfinder.repositories; import org.pdxfinder.dao.Marker; import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import java.util.Collection; import java.util.List; /** * Interf...
feat(router): Add a precommit extension point to the pipeline
import {Container} from 'aurelia-dependency-injection'; import {Pipeline} from './pipeline'; import {BuildNavigationPlanStep} from './navigation-plan'; import {ApplyModelBindersStep} from './model-binding'; import {LoadRouteStep} from './route-loading'; import {CommitChangesStep} from './navigation-context'; import { ...
import {Container} from 'aurelia-dependency-injection'; import {Pipeline} from './pipeline'; import {BuildNavigationPlanStep} from './navigation-plan'; import {ApplyModelBindersStep} from './model-binding'; import {LoadRouteStep} from './route-loading'; import {CommitChangesStep} from './navigation-context'; import { ...
Remove random from aggregated feed parsing We had random data display in earlier versions of the app but don't actually use it. During an RB deploy today where we wanted to change the format to an array we discovered that the app was still expecting the random property to be an object. Therefore let's remove the rand...
package org.wikipedia.feed.aggregated; import android.support.annotation.Nullable; import com.google.gson.annotations.SerializedName; import org.wikipedia.feed.model.CardPageItem; import org.wikipedia.feed.mostread.MostReadArticles; import org.wikipedia.feed.news.NewsItem; import org.wikipedia.feed.image.FeaturedIma...
package org.wikipedia.feed.aggregated; import android.support.annotation.Nullable; import com.google.gson.annotations.SerializedName; import org.wikipedia.feed.model.CardPageItem; import org.wikipedia.feed.mostread.MostReadArticles; import org.wikipedia.feed.news.NewsItem; import org.wikipedia.feed.image.FeaturedIma...
Make ipythonprinting test more robust
"""Tests that the IPython printing module is properly loaded. """ from sympy.interactive.session import init_ipython_session from sympy.external import import_module ipython = import_module("IPython", min_module_version="0.11") # disable tests if ipython is not present if not ipython: disabled = True def test_i...
"""Tests that the IPython printing module is properly loaded. """ from sympy.interactive.session import init_ipython_session from sympy.external import import_module ipython = import_module("IPython", min_module_version="0.11") # disable tests if ipython is not present if not ipython: disabled = True def test_i...
Use new menu ordener in api controller
<?php namespace Modules\Menu\Http\Controllers\Api; use Illuminate\Contracts\Cache\Repository; use Illuminate\Http\Request; use Modules\Menu\Services\MenuOrdener; class MenuItemController { /** * @var Repository */ private $cache; /** * @var MenuOrdener */ private $menuOrdener; ...
<?php namespace Modules\Menu\Http\Controllers\Api; use Illuminate\Contracts\Cache\Repository; use Illuminate\Http\Request; use Modules\Menu\Services\MenuService; class MenuItemController { /** * @var MenuService */ private $menuService; /** * @var Repository */ private $cache; ...
Remove useless if check statement
var amqp = require('amqplib'); var amqpUrl, amqpConnection, intervalID; function connect(_amqpUrl) { amqpUrl = amqpUrl || _amqpUrl || process.env.AMQP_URL || 'amqp://localhost'; return amqp.connect(amqpUrl) .then(function (_connection) { amqpConnection = _connection; _connection.on('close', reconnect)...
var amqp = require('amqplib'); var amqpUrl, amqpConnection, intervalID; function connect(_amqpUrl) { amqpUrl = amqpUrl || _amqpUrl || process.env.AMQP_URL || 'amqp://localhost'; return amqp.connect(amqpUrl) .then(function (_connection) { amqpConnection = _connection; _connection.on('close', reconnect)...
Remove unused import of "os"
"""Linux-specific code""" from pysyte.types import paths def xdg_home(): """path to $XDG_CONFIG_HOME >>> assert xdg_home() == paths.path('~/.config').expand() """ return paths.environ_path('XDG_CONFIG_HOME', '~/.config') def xdg_home_config(filename): """path to that file in $XDG_CONFIG_HOME ...
"""Linux-specific code""" import os from pysyte.types import paths def xdg_home(): """path to $XDG_CONFIG_HOME >>> assert xdg_home() == os.path.expanduser('~/.config') """ return paths.environ_path('XDG_CONFIG_HOME', '~/.config') def xdg_home_config(filename): """path to that file in $XDG_CON...
Remove doNotForce method as it represents the default property value already
<?php namespace NotificationChannels\Authy; class AuthyMessage { /** * Determine whether to force the notification over cellphone network. * * @var bool */ public $force = false; /** * The notification method (sms/call). * * @var string */ public $method = 'sms...
<?php namespace NotificationChannels\Authy; class AuthyMessage { /** * Determine whether to force the notification over cellphone network. * * @var bool */ public $force = false; /** * The notification method (sms/call). * * @var string */ public $method = 'sms...
Revert "Add browser: true to env map to suppress eslint errors for browser globals" This reverts commit b314d1b8a1c2ec7c26600b4e7f39f83083a1b835. See commit 79167ab0f855beb6942d576735a19d65f0f503e2.
module.exports = { "root": true, "env": { "es6": true }, "extends": "eslint:recommended", "parserOptions": { "sourceType": "module" }, "rules": { "indent": [ "warn", "tab", { "SwitchCase": 1 } ], "linebreak-style": [ "error", "unix" ], "quotes": [ "error", "double" ], ...
module.exports = { "root": true, "env": { "es6": true, "browser": true }, "extends": "eslint:recommended", "parserOptions": { "sourceType": "module" }, "rules": { "indent": [ "warn", "tab", { "SwitchCase": 1 } ], "linebreak-style": [ "error", "unix" ], "quotes": [ "error"...
Save the default plugin configuration. Signed-off-by: Ian Macalinao <08370e385f4778cad8fe504ec5445edd3d45bd9a@gmail.com>
package com.simplyian.easydb; import com.simplyian.easydb.command.DBReloadCommand; import org.bukkit.plugin.java.JavaPlugin; /** * EasyDBPlugin Main class. */ public class EasyDBPlugin extends JavaPlugin { private Database db; @Override public void onEnable() { // Make sure the config has been ...
package com.simplyian.easydb; import com.simplyian.easydb.command.DBReloadCommand; import org.bukkit.plugin.java.JavaPlugin; /** * EasyDBPlugin Main class. */ public class EasyDBPlugin extends JavaPlugin { private Database db; @Override public void onEnable() { reloadDb(); getCommand("...
Revert "Conditionally set browser for karma" This reverts commit 9f43fe898e74a0541430a06532ba8b504796af6c.
module.exports = function (config) { config.set({ port: 9876, logLevel: config.LOG_INFO, autoWatch: true, singleRun: false, colors: true, plugins: [ 'karma-jasmine', 'karma-sinon', 'karma-spec-reporter', 'karma-phantomjs-launcher', 'karma-chrome-launcher', ...
module.exports = function (config) { config.set({ port: 9876, logLevel: config.LOG_INFO, autoWatch: true, singleRun: false, colors: true, plugins: [ 'karma-jasmine', 'karma-sinon', 'karma-spec-reporter', 'karma-phantomjs-launcher', 'karma-chrome-launcher', ...
Fix for broken 'add file set' button Just changed the nesting so that the form includes the pane-footer and the 'submit' button/input. Former-commit-id: 665cf13c7ffc7c6bc88eee66f431ac1e001cf986
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <? $ih = Loader::helper('concrete/interface'); ?> <?=Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Add Set'), false, false, false)?> <form method="post" id="file-sets-add" action="<?=$this->url('/dashboard/files/add_set', 'do_add')?...
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <? $ih = Loader::helper('concrete/interface'); ?> <?=Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Add Set'), false, false, false)?> <div class="ccm-pane-body"> <form method="post" id="file-sets-add" action="<?=$this->url('/dashboard/...
Add forms inside page editor. TinyMCE removes attitubutes.
function setImageValue(url){ $('.mce-btn.mce-open').parent().find('.mce-textbox').val(url); } $(document).ready(function(){ $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); tinymce.init({ menubar: false, selector:'textarea.richTextBox',...
function setImageValue(url){ $('.mce-btn.mce-open').parent().find('.mce-textbox').val(url); } $(document).ready(function(){ $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); tinymce.init({ menubar: false, selector:'textarea.richTextBox',...
Add missing @ in phpdoc return statement
<?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\Cache\Adapter; use Psr\Cache\CacheItemPoolInterface; ...
<?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\Cache\Adapter; use Psr\Cache\CacheItemPoolInterface; ...
Switch to using python standard library importlib Available in Python 2.7+, which is all that Gargoyle now supports. The Django version is removed in 1.9.
""" gargoyle ~~~~~~~~ :copyright: (c) 2010 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ from gargoyle.manager import gargoyle try: VERSION = __import__('pkg_resources').get_distribution('gargoyle-yplan').version except Exception, e: VERSION = 'unknown' __all__ = ('gargoyle', 'auto...
""" gargoyle ~~~~~~~~ :copyright: (c) 2010 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ from gargoyle.manager import gargoyle try: VERSION = __import__('pkg_resources').get_distribution('gargoyle-yplan').version except Exception, e: VERSION = 'unknown' __all__ = ('gargoyle', 'auto...
[DDW-557] Correct path for EPOCH files in Linux
// @flow import fs from 'fs'; import path from 'path'; import { appFolderPath } from '../config'; import { getNumberOfEpochsConsolidatedChannel } from '../ipc/getNumberOfEpochsConsolidated.ipc'; import type { GetNumberOfEpochsConsolidatedChannelResponse } from '../../common/ipc/api'; import { environment } from '../env...
// @flow import fs from 'fs'; import path from 'path'; import { appFolderPath } from '../config'; import { getNumberOfEpochsConsolidatedChannel } from '../ipc/getNumberOfEpochsConsolidated.ipc'; import type { GetNumberOfEpochsConsolidatedChannelResponse } from '../../common/ipc/api'; export const getNumberOfEpochsCons...
Remove unused test class attr
from django.test import TestCase from conman.tests.utils import RequestTestCase from . import factories from .. import views class TestPageDetail(RequestTestCase): def test_get_object(self): """PageDetail displays the page instance passed in the node kwarg.""" request = self.create_request() ...
from django.test import TestCase from conman.tests.utils import RequestTestCase from . import factories from .. import views class TestPageDetail(RequestTestCase): def test_get_object(self): """PageDetail displays the page instance passed in the node kwarg.""" request = self.create_request() ...
Fix problems with UTF-8 README.rst
#!/usr/bin/env python from codecs import open from setuptools import find_packages, setup with open('README.rst', 'r', 'utf-8') as f: readme = f.read() setup( name='django-paginationlinks', version='0.1', description='Django Pagination Links', long_description=readme, url='https://github.co...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='django-paginationlinks', version='0.1', description='Django Pagination Links', long_description=open('README.rst').read(), url='https://github.com/blancltd/django-paginationlinks', maintainer='Alex Tomkins', main...
Implement parser for trends and their frequencies and store those trends in datastore
// 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-2.0 // // Unless required by applicable law or agreed to in ...
// 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-2.0 // // Unless required by applicable law or agreed to in ...
Add speaker name in talk page
<?php /** * @file * template.php */ /** * theme_preprocess_page */ function tedxlausanne_preprocess_page(&$variables) { // Display speaker name in the talk title if(isset($variables['node']) && isset($variables['node']->field_talk_speaker['und'][0]['entity']->title) && $variables['node']->type == 'talk'){ ...
<?php /** * @file * template.php */ /** * theme_preprocess_page */ function tedxlausanne_preprocess_page(&$variables) { } /** * Preprocess variables for node.tpl.php * * @see node.tpl.php */ function tedxlausanne_preprocess_node(&$variables) { // That will let you use a template file like: node--[type|...
Drop loading jquery by django-debug-toolbar - it is integrated now
# -*- coding: utf-8 -*- ''' Local Configurations - Runs in Debug mode - Uses console backend for emails - Use Django Debug Toolbar ''' from configurations import values from .common import Common class Local(Common): # DEBUG DEBUG = values.BooleanValue(True) TEMPLATE_DEBUG = DEBUG # END DEBUG #...
# -*- coding: utf-8 -*- ''' Local Configurations - Runs in Debug mode - Uses console backend for emails - Use Django Debug Toolbar ''' from configurations import values from .common import Common class Local(Common): # DEBUG DEBUG = values.BooleanValue(True) TEMPLATE_DEBUG = DEBUG # END DEBUG #...
Allow undefined endpoints by default git-svn-id: 9326b53cbc4a8f4c3d02979b62b178127d5150fe@1033 c7d0bf07-ec0d-0410-b2cc-d48fa9be22ba
package org.codehaus.xfire.spring.config; import java.util.List; import javax.xml.namespace.QName; public abstract class AbstractSoapBindingBean { private String transport; private List endpoints; private QName name; private boolean allowUndefinedEndpoints = true; public boolean isAllowUndef...
package org.codehaus.xfire.spring.config; import java.util.List; import javax.xml.namespace.QName; public abstract class AbstractSoapBindingBean { private String transport; private List endpoints; private QName name; private boolean allowUndefinedEndpoints; public boolean isAllowUndefinedEnd...
Add a get note method
function NoteApplication (author) { this.author = author; this.notes = []; this.create = function(note_content) { if (note_content.length > 0) { this.notes.push(note_content); return "You have created a note"; } else { return "You haven't entered a valid note"; } } t...
function NoteApplication (author) { this.author = author; this.notes = []; this.create = function(note_content) { if (note_content.length > 0) { this.notes.push(note_content); return "You have created a note"; } else { return "You haven't entered a valid note"; } } t...
Fix galley close on esc
(function () { var addImageGallery = function(post) { if(post.length && !post.hasClass('smi-img-gallery')) { console.log('POST: ', post); post.addClass('smi-img-gallery'); post.find('img').each(function(){ var img = $(this); var link = img.attr('src'); if(!link || ...
(function () { var addImageGallery = function(post) { if(post.length && !post.hasClass('smi-img-gallery')) { console.log('POST: ', post); post.addClass('smi-img-gallery'); post.find('img').each(function(){ var img = $(this); var link = img.attr('src'); if(!link || ...
Remove DOMContentLoaded event listener after it's used
import detectIt from 'detect-it'; import addListener from 'the-listener'; function setupCurrentInput() { const body = document.querySelector('body'); let currentInput = undefined; function updateCurrentInput(input) { if (input !== currentInput) { body.classList.remove(`current-input-${currentInput}`);...
import detectIt from 'detect-it'; import addListener from 'the-listener'; function setupCurrentInput() { const body = document.querySelector('body'); let currentInput = undefined; function updateCurrentInput(input) { if (input !== currentInput) { body.classList.remove(`current-input-${currentInput}`);...
chore(engine): Improve wording in a javadoc comment
/* * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH * under one or more contributor license agreements. See the NOTICE file * distributed with this work for additional information regarding copyright * ownership. Camunda licenses this file to you under the Apache License, * Version 2.0; y...
/* * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH * under one or more contributor license agreements. See the NOTICE file * distributed with this work for additional information regarding copyright * ownership. Camunda licenses this file to you under the Apache License, * Version 2.0; y...
Attach image_input_click function to window object So other parts of the page can access it
///////////////////////////////////////////////////////////////////////////// // // Simple image input // //////////////////////////////////////////////////////////////////////////////// // click on image, return coordinates // put a dot at location of click, on imag window.image_input_click = function(id,event){ ...
///////////////////////////////////////////////////////////////////////////// // // Simple image input // //////////////////////////////////////////////////////////////////////////////// // click on image, return coordinates // put a dot at location of click, on imag // window.image_input_click = function(id,event)...
Adjust signature of test class fully
<?php namespace Neos\Flow\Tests\Functional\Configuration\Fixtures; /* * This file is part of the Neos.Flow package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distributed...
<?php namespace Neos\Flow\Tests\Functional\Configuration\Fixtures; /* * This file is part of the Neos.Flow package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distributed...
Fix dataconversion. Tests are passing now
<?php namespace OpenSRS\backwardcompatibility\dataconversion\domains\lookup; use OpenSRS\backwardcompatibility\dataconversion\DataConversion; use OpenSRS\Exception; class LookupDomain extends DataConversion { // New structure for API calls handled by // the toolkit. // // index: field name // value: location of...
<?php namespace OpenSRS\backwardcompatibility\dataconversion\domains\lookup; use OpenSRS\backwardcompatibility\dataconversion\DataConversion; use OpenSRS\Exception; class LookupDomain extends DataConversion { // New structure for API calls handled by // the toolkit. // // index: field name // value: location of...
CSRA-535: Add log info for successful save
import express from 'express'; import { databaseLogger as log } from '../services/logger'; export default function createRouter(assessment) { const router = express.Router(); router.post('/', (req, res) => { assessment.record(req.body) .then( (result) => { log.info(`Saved assessment, a...
import express from 'express'; import { databaseLogger as log } from '../services/logger'; export default function createRouter(assessment) { const router = express.Router(); router.post('/', (req, res) => { assessment.record(req.body) .then( result => res.json({ status: 'OK', ...
Deal with the compass.rb -> config.rb change
# Copyright 2013 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
# Copyright 2013 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
Save confirmed files with Google Books ID
from flask import Flask, render_template, request, jsonify import os import shutil import requests app = Flask(__name__) app.config.from_object('config.Debug') @app.route('/upload', methods=['GET', 'POST']) def upload(): if request.method == 'GET': return render_template('upload.html') elif request...
from flask import Flask, render_template, request, jsonify import os import shutil app = Flask(__name__) app.config.from_object('config.Debug') @app.route('/upload', methods=['GET', 'POST']) def upload(): if request.method == 'GET': return render_template('upload.html') elif request.method == 'POST...
Fix script to include repos in PYTHONPATH The repos checkout needs to be in the PYTHONPATH for the import of the xstatic module to work. Since we invoke the xstatic_check_version.py by absolute path, Python does not include the cwd() in the PYTHONPATH. Change-Id: Idd4f8db6334c9f29168e3bc39de3ed95a4e1c60f
#! /usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
#! /usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
Fix checkstyle error that one line exceeds the width.
package com.orhanobut.hawk; import java.lang.reflect.Type; /** * Intermediate layer that handles serialization/deserialization for the end result. * This is not the same as {@link Serializer}. This interface is only used to convert the intermediate value * into String or vice-versa to be used for {@link Storage} ...
package com.orhanobut.hawk; import java.lang.reflect.Type; /** * Intermediate layer that handles serialization/deserialization for the end result. * This is not the same as {@link Serializer}. This interface is only used to convert the intermediate value into String, * or vice-versa to be used for {@link Storage} ...
Select a citation after updating.
import { documentHelpers } from '../model' import ApiExtension from './ApiExtension' export default class ReferenceApi extends ApiExtension { /** * @param {object} data from ReferenceModal state */ addReference (data) { return this.insertReference(data) } /** * @param {object} data from Reference...
import { documentHelpers } from '../model' import ApiExtension from './ApiExtension' export default class ReferenceApi extends ApiExtension { /** * @param {object} data from ReferenceModal state */ addReference (data) { return this.insertReference(data) } /** * @param {object} data from Reference...
Return a JsonNode not a String from the serializer so that Play sends the correct headers.
package controllers.api; import java.io.IOException; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode...
package controllers.api; import java.io.IOException; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMa...
Allow local statisticians to view the ReportToken link links
<?php namespace TmlpStats\Policies; use TmlpStats\User; class ReportTokenPolicy extends Policy { /** * Create a new policy instance. * * @return void */ public function __construct() { // } /** * Can $user view the full list of reportTokens? * * @param U...
<?php namespace TmlpStats\Policies; use TmlpStats\User; class ReportTokenPolicy extends Policy { /** * Create a new policy instance. * * @return void */ public function __construct() { // } /** * Can $user view the full list of reportTokens? * * @param ...
Handle just parse errors in provider Previously all errors were reported as JSON parse errors.
/* * Copyright 2014-2015 Fabian Tollenaar <fabian@starting-point.nl> * * 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 requ...
/* * Copyright 2014-2015 Fabian Tollenaar <fabian@starting-point.nl> * * 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 requ...
Use different type hint here.
<?php namespace ParagonIE\Halite\Asymmetric; use ParagonIE\Halite\Alerts\{ CannotPerformOperation, InvalidType }; use ParagonIE\Halite\HiddenString; use ParagonIE\Halite\Key; /** * Class SecretKey * @package ParagonIE\Halite\Asymmetric * * This Source Code Form is subject to the terms of the Mozilla Publi...
<?php namespace ParagonIE\Halite\Asymmetric; use ParagonIE\Halite\Alerts\{ CannotPerformOperation, InvalidType }; use ParagonIE\Halite\HiddenString; use ParagonIE\Halite\Key; /** * Class SecretKey * @package ParagonIE\Halite\Asymmetric * * This Source Code Form is subject to the terms of the Mozilla Publi...
Debug update continued: Removed the cost of mesh position to ints.
package net.piemaster.jario.systems; import net.piemaster.jario.components.CollisionMesh; import net.piemaster.jario.components.Transform; import com.artemis.ComponentMapper; import com.artemis.Entity; import com.artemis.EntityProcessingSystem; public class CollisionMeshSystem extends EntityProcessingSystem...
package net.piemaster.jario.systems; import net.piemaster.jario.components.CollisionMesh; import net.piemaster.jario.components.Transform; import com.artemis.ComponentMapper; import com.artemis.Entity; import com.artemis.EntityProcessingSystem; public class CollisionMeshSystem extends EntityProcessingSystem...
Reorder config groups for better documentation
package io.quarkus.dynamodb.runtime; import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; @ConfigRoot(phase = ConfigPhase.RUN_TIME) public class DynamodbConfig { /** * Enable DynamoDB service endpoint discovery...
package io.quarkus.dynamodb.runtime; import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; @ConfigRoot(phase = ConfigPhase.RUN_TIME) public class DynamodbConfig { /** * Enable DynamoDB service endpoint discovery...
Add simple stub for GitHub Webhooks
<?php require_once 'lib/Config.php'; require_once 'lib/Session.php'; require_once 'lib/functions.php'; require_once 'lib/Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $db = new PDO(Config::get('datasource')); $app = new \Slim\Slim(); /* Index */ $app->get('/', function() use ($app) { $app->redirect('https:/...
<?php require_once 'lib/Config.php'; require_once 'lib/Session.php'; require_once 'lib/functions.php'; require_once 'lib/Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $db = new PDO(Config::get('datasource')); $app = new \Slim\Slim(); /* Index */ $app->get('/', function() use ($app) { $app->redirect('https:/...
Use Node 10.x within Vagrant
module.exports = { config: { FulgensVersion: '1.0.0', Name: "citybuilder", Vagrant: { Box: 'ubuntu/xenial64', BeforeInstall: [ "curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -" ], Install: 'nodejs docker.io' } }, software: { "couchdb": { ...
module.exports = { config: { Name: "citybuilder", Vagrant: { Box: 'ubuntu/xenial64', Install: 'npm docker.io' } }, software: { "couchdb": { Source: "couchdb" }, "node": { Source: "node", Artifact: "startServer.js", ExposedPort: 8080, configFile:...
Add test URL to try against server
/*global define*/ // ignore non-camel case decided by server /* jshint -W106*/ define(['underscore', 'backbone'], function(_, Backbone) { 'use strict'; // UsageModel // -------- // // This is the model backing the Usage Widget // window.Usage = Backbone.Model.extend({ url: function(...
/*global define*/ // ignore non-camel case decided by server /* jshint -W106*/ define(['underscore', 'backbone'], function(_, Backbone) { 'use strict'; // UsageModel // -------- // // This is the model backing the Usage Widget // return Backbone.Model.extend({ defaults: { ...
Use 0.0 as our version Signed-off-by: Tycho Andersen <10c18fcb898ee6b17d6575d444b125d10b3f4d6a@canonical.com>
/* This is a FLEXible file which can be used by both client and daemon. * Teehee. */ package lxd import ( "bufio" "os" "path/filepath" ) var Version = "0.0" /* * Please increment the api compat number every time you change the API. * * Version 1.0: ping */ var APICompat = 1 var APIVersion = "1.0" // VarPat...
/* This is a FLEXible file which can be used by both client and daemon. * Teehee. */ package lxd import ( "bufio" "os" "path/filepath" ) var Version = "0.0.1" /* * Please increment the api compat number every time you change the API. * * Version 1.0: ping */ var APICompat = 1 var APIVersion = "1.0" // VarP...
Change branding on default config.
/* exported defaults */ /* Magic Mirror * Config Defauls * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. */ var defaults = { port: 8080, language: "en", timeFormat: 24, modules: [ { module: "helloworld", position: "upper_third", config: { text: "Magic Mirror<sup>2</sup>", cla...
/* exported defaults */ /* Magic Mirror * Config Defauls * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. */ var defaults = { port: 8080, language: "en", timeFormat: 24, modules: [ { module: "helloworld", position: "upper_third", config: { text: "Magic Mirror V2", classes: "la...
Store and load methods (stubs)
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package nl.meg.propertiesutility; import java.io.InputStream; import java.io.OutputStream; import java.util.HashMap; import java.util...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package nl.meg.propertiesutility; import java.util.HashMap; import java.util.Map; /** * * @author meine */ public class Propertie...
Use try-with-resources instead of try/finally
/* * Copyright 2010 Proofpoint, 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 agree...
/* * Copyright 2010 Proofpoint, 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 agree...
Fix spec compliance of error title
<?php declare(strict_types=1); namespace WoohooLabs\Yin\JsonApi\Exception; use WoohooLabs\Yin\JsonApi\Schema\Error\Error; class RelationshipNotExists extends AbstractJsonApiException { /** * @var string */ protected $relationship; public function __construct(string $relationship) { ...
<?php declare(strict_types=1); namespace WoohooLabs\Yin\JsonApi\Exception; use WoohooLabs\Yin\JsonApi\Schema\Error\Error; class RelationshipNotExists extends AbstractJsonApiException { /** * @var string */ protected $relationship; public function __construct(string $relationship) { ...
Refactor Store Query to On-Demand Query with backward compatibility.
/* * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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.or...
/* * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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.or...
Remove the "view/" part for viewing signatures
from django.conf.urls import patterns, include, url from rest_framework import routers from crashmanager import views router = routers.DefaultRouter() router.register(r'signatures', views.BucketViewSet) router.register(r'crashes', views.CrashEntryViewSet) urlpatterns = patterns('', url(r'^rest/api-auth/', include...
from django.conf.urls import patterns, include, url from rest_framework import routers from crashmanager import views router = routers.DefaultRouter() router.register(r'signatures', views.BucketViewSet) router.register(r'crashes', views.CrashEntryViewSet) urlpatterns = patterns('', url(r'^rest/api-auth/', include...
Fix reaggroing when player gets hit while deaggrod.
import Obstacle from './Obstacle' export default class extends Obstacle { constructor (game, player, x, y, frame, bulletFrame) { super(game, player, x, y, frame) this.weapon = this.game.plugins.add(Phaser.Weapon) this.weapon.trackSprite(this) this.weapon.createBullets(50, 'chars_small', bulletFrame)...
import Obstacle from './Obstacle' export default class extends Obstacle { constructor (game, player, x, y, frame, bulletFrame) { super(game, player, x, y, frame) this.weapon = this.game.plugins.add(Phaser.Weapon) this.weapon.trackSprite(this) this.weapon.createBullets(50, 'chars_small', bulletFrame)...
Use sceneRecord.get to get current route
/* @flow */ import React from "react-native"; import routeMapper from "../routes/routeMapper"; import Colors from "../../Colors.json"; const { NavigationCard, StyleSheet, View } = React; const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: Colors.lightGrey }, normal: { marginTop: 56...
/* @flow */ import React from "react-native"; import routeMapper from "../routes/routeMapper"; import Colors from "../../Colors.json"; const { NavigationCard, StyleSheet, View } = React; const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: Colors.lightGrey }, normal: { marginTop: 56...