text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Add button that navigate to login 3 from login 2
import React from 'react'; import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "center", alignItems: "center", backgr...
import React from 'react'; import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "center", alignItems: "center", backgr...
Edit to the regular expression pattern used to identify meta-mapped references.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' Constant mapping appropriate quantipy types to pandas dtypes ''' DTYPE_MAP = { "float": ["float64", "float32", "float16"], "int": ["int64", "int32", "int16", "int8", "int0", "float64", "float32", "float16"], "string": [...
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' Constant mapping appropriate quantipy types to pandas dtypes ''' DTYPE_MAP = { "float": ["float64", "float32", "float16"], "int": ["int64", "int32", "int16", "int8", "int0", "float64", "float32", "float16"], "string": [...
Drop `author_email` - oops, excessive copy-paste
import os from setuptools import setup, find_packages __version__ = '0.1' HERE = os.path.dirname(__file__) try: long_description = open(os.path.join(HERE, 'README.rst')).read() except: long_description = None setup( name='rubberjack-cli', version=__version__, packages=find_packages(exclude=['tes...
import os from setuptools import setup, find_packages __version__ = '0.1' HERE = os.path.dirname(__file__) try: long_description = open(os.path.join(HERE, 'README.rst')).read() except: long_description = None setup( name='rubberjack-cli', version=__version__, packages=find_packages(exclude=['tes...
Make tensorflow be optional to allow using tensorflow-gpu
from setuptools import setup, find_packages exec(open('keras_vggface/version.py').read()) setup( name='keras_vggface', version=__version__, description='VGGFace implementation with Keras framework', url='https://github.com/rcmalli/keras-vggface', author='Refik Can MALLI', author_email="mallir@it...
from setuptools import setup, find_packages exec(open('keras_vggface/version.py').read()) setup(name='keras_vggface', version=__version__, description='VGGFace implementation with Keras framework', url='https://github.com/rcmalli/keras-vggface', author='Refik Can MALLI', author_email = "ma...
Refresh global addresses when joining
'use strict'; angular.module('copayApp.controllers').controller('CopayersController', function($scope, $rootScope, $location, backupService, walletFactory, controllerUtils) { $scope.backup = function() { var w = $rootScope.wallet; w.setBackupReady(); backupService.download(w); }; $sco...
'use strict'; angular.module('copayApp.controllers').controller('CopayersController', function($scope, $rootScope, $location, backupService, walletFactory, controllerUtils) { $scope.backup = function() { var w = $rootScope.wallet; w.setBackupReady(); backupService.download(w); }; $sco...
Change because of duplication issue
<?php use Interop\Container\ContainerInterface; use DI\Factory\RequestedEntry; return [ 'ActionListener' => DI\object(Sarcofag\SPI\EventManager\GenericListener::class), 'DataFilterListener' => DI\object(Sarcofag\SPI\EventManager\GenericListener::class), 'DefaultStaticPostController' => DI\object(Sarcofag\T...
<?php use Interop\Container\ContainerInterface; use DI\Factory\RequestedEntry; return [ 'ActionListener' => DI\object(Sarcofag\SPI\EventManager\GenericListener::class), 'DataFilterListener' => DI\object(Sarcofag\SPI\EventManager\GenericListener::class), 'DefaultStaticPostController' => DI\object(Sarcofag\T...
Update iprestrict models in initial data
"""Disable iprestriction completely.""" from iprestrict.models import RangeBasedIPGroup, IPRange, Rule def load_data(**kwargs): allow_all() def allow_all(): all_group = get_or_create_all_group() Rule.objects.all().delete() Rule.objects.create( ip_group=all_group, action='A', ...
"""Disable iprestriction completely.""" from iprestrict.models import IPGroup, IPRange, Rule def load_data(**kwargs): allow_all() def allow_all(): all_group = get_or_create_all_group() Rule.objects.all().delete() Rule.objects.create( ip_group=all_group, action='A', url_patt...
Fix promisifySync case of promise arguments
// Promisify synchronous function 'use strict'; var callable = require('es5-ext/lib/Object/valid-callable') , deferred = require('../../deferred') , isPromise = require('../../is-promise') , processArguments = require('../_process-arguments') , apply = Function.prototype.apply , app...
// Promisify synchronous function 'use strict'; var callable = require('es5-ext/lib/Object/valid-callable') , deferred = require('../../deferred') , isPromise = require('../../is-promise') , processArguments = require('../_process-arguments') , apply = Function.prototype.apply , app...
Use relative imports again to support python 3
# inbuild python imports # inbuilt django imports from django.test import LiveServerTestCase # third party imports # inter-app imports # local imports from . import mixins from .mixins import SimpleTestCase class MongoTestCase(mixins.MongoTestMixin, SimpleTestCase): """ TestCase that creates a mongo collecti...
# inbuild python imports # inbuilt django imports from django.test import LiveServerTestCase # third party imports # inter-app imports # local imports import mixins from mixins import SimpleTestCase class MongoTestCase(mixins.MongoTestMixin, SimpleTestCase): """ TestCase that creates a mongo collection and c...
Front: Remove reference to nonexistent file
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from shuup.front.views.product import ProductDetailView class ProductPrevi...
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from shuup.front.views.product import ProductDetailView class ProductPrevi...
fix(exception-mapper): Return 500 errors for all unmapped exceptions
/** * Copyright (C) 2016 Red Hat, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
/** * Copyright (C) 2016 Red Hat, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
Save draft button tweak on homepage
<div class="card"> <div class="card-header"> <h2>Quick Draft <small>Save a quick draft post:</small> </h2> <br> @include('canvas::shared.errors') @include('canvas::shared.success') <form class="keyboard-save" role="form" method="POST" id="postCreate" a...
<div class="card"> <div class="card-header"> <h2>Quick Draft <small>Save a quick draft post:</small> </h2> <br> @include('canvas::shared.errors') @include('canvas::shared.success') <form class="keyboard-save" role="form" method="POST" id="postCreate" a...
Add utility function to write pvs to file
# Function to return a list of pvs from a given file import pkg_resources pkg_resources.require('aphla') import aphla as ap def get_pv_names(mode): ''' Given a certain ring mode as a string, return all available pvs ''' ap.machines.load(mode) result = set() elements = ap.getElements('*') for el...
# Function to return a list of pvs from a given file import pkg_resources pkg_resources.require('aphla') import aphla as ap def get_pv_names(mode): ''' Given a certain ring mode as a string, return all available pvs ''' ap.machines.load(mode) result = set() elements = ap.getElements('*') for ele...
FIX deprecation warning for using assertEquals
""" Test utilities. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import json from unittest import TestCase def parent_module(module_name): # type: (AnyStr) -> AnyStr """Return the parent module name for a module. :...
""" Test utilities. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import json from unittest import TestCase def parent_module(module_name): # type: (AnyStr) -> AnyStr """Return the parent module name for a module. :...
Fix extension loading functional test Call the agent _report_state() before checking the report state itself Change-Id: Idbf552d5ca5968bc95b0a3c395499c3f2d215729 Closes-Bug: 1658089
# Copyright (c) 2016 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
# Copyright (c) 2016 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
Fix production build broken by tracking
import ua from 'universal-analytics' import { machineIdSync } from 'node-machine-id' import { version as appVersion } from '../package.json' import config from './config' const DEFAULT_CATEGORY = 'Cerebro App' const isTrackingEnabled = () => ( process.env.NODE_ENV === 'production' && config.get('trackingEnabled') )...
import ua from 'universal-analytics' import { machineIdSync } from 'node-machine-id' import { version as appVersion } from '../package.json' import config from './config' const DEFAULT_CATEGORY = 'Cerebro App' const trackingEnabled = process.env.NODE_ENV === 'production' && config.get('trackingEnabled') let visitor ...
Add watch task to gulp
'use strict'; const gulp = require('gulp'); const babel = require('gulp-babel'); const uglify = require('gulp-uglify'); const browserify = require('browserify'); const source = require('vinyl-source-stream'); const buffer = require('vinyl-buffer'); const del = require('del'); gulp.task('clean', () => { return del([...
'use strict'; const gulp = require('gulp'); const babel = require('gulp-babel'); const uglify = require('gulp-uglify'); const browserify = require('browserify'); const source = require('vinyl-source-stream'); const buffer = require('vinyl-buffer'); const del = require('del'); gulp.task('clean', () => { return del([...
Set class on page load.
/* Leaflet.ZoomCSS Adding a css class on the map div element, so other elements, such as markers can be automatically styled based on the zoom level using css instead of javascript Copyright (c) 2014, Dag Jomar Mersland, dagjomar@gmail.com, @dagjomar https://github.com/dagjomar/Leaflet.ZoomCSS */ L.Map.merge...
/* Leaflet.ZoomCSS Adding a css class on the map div element, so other elements, such as markers can be automatically styled based on the zoom level using css instead of javascript Copyright (c) 2014, Dag Jomar Mersland, dagjomar@gmail.com, @dagjomar https://github.com/dagjomar/Leaflet.ZoomCSS */ L.Map.merge...
Use a choices for specifiying type of reporter
# -*- coding: utf-8 -*- import sys import argparse from mamba import application_factory, __version__ from mamba.infrastructure import is_python3 def main(): arguments = _parse_arguments() if arguments.version: print(__version__) return factory = application_factory.ApplicationFactory(a...
# -*- coding: utf-8 -*- import sys import argparse from mamba import application_factory, __version__ from mamba.infrastructure import is_python3 def main(): arguments = _parse_arguments() if arguments.version: print(__version__) return factory = application_factory.ApplicationFactory(a...
Use numeric value for day of week in CRON expression.
export default (app) => { app.jobs.schedule('send audit email', '0 16 * * 6', async () => { app.info('CRON: sending audit email - starting') const mailerConfig = app.get('mailer') const recipients = mailerConfig.auditRecipients && mailerConfig.auditRecipients.split(',') app.info(`recipients: $...
export default (app) => { app.jobs.schedule('send audit email', '0 16 * * FRI', async () => { app.info('CRON: sending audit email - starting') const mailerConfig = app.get('mailer') const recipients = mailerConfig.auditRecipients && mailerConfig.auditRecipients.split(',') if (recipients) { ...
Update ver 0.1 Beta (Build 7) plg_system examples
<?php require("bin/fw.php"); define('N', "\n"); define('BR', "<br />"); define('BRN', "<br />\n"); # plg_visitor echo "You are using ".browserName." ver ".browserVer." on ".platformFamily." ".(is64bit ? "64 bit" : "32 bit")." from ".getIP().BRN; # plg_dump $arr = array("Defined Variables"=>get_defined_vars(), "...
<?php require("bin/fw.php"); define('N', "\n"); define('BR', "<br />"); define('BRN', "<br />\n"); # plg_visitor echo "You are using ".browserName." ver ".browserVer." on ".platformFamily." ".(is64bit ? "64 bit" : "32 bit")." from ".getIP().BRN; # plg_dump $arr = array("Defined Variables"=>get_defined_vars(), "...
Move these to macros, the exact type of these functions changes by deifne
# 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, software # distributed under the...
# 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, software # distributed under the...
Implement navigation to engine class.
package net.bitpot.railways.models.routes; import com.intellij.openapi.module.Module; import net.bitpot.railways.gui.RailwaysIcons; import net.bitpot.railways.models.Route; import net.bitpot.railways.models.requestMethods.RequestMethod; import net.bitpot.railways.utils.RailwaysPsiUtils; import net.bitpot.railways.util...
package net.bitpot.railways.models.routes; import com.intellij.openapi.module.Module; import net.bitpot.railways.gui.RailwaysIcons; import net.bitpot.railways.models.Route; import net.bitpot.railways.models.requestMethods.RequestMethod; import javax.swing.*; /** * @author Basil Gren * on 14.12.2014. */ pu...
Fix error reported by jshint
/** * Run script for Grunt, task runner * * The MIT License (MIT) * Copyright (c) 2015 GochoMugo <mugo@forfuture.co.ke> */ "use strict"; exports = module.exports = function(grunt) { grunt.initConfig({ benchmark: { all: { src: ["benchmark/*.js"], dest: "benchmark/results.csv" } }...
/** * Run script for Grunt, task runner * * The MIT License (MIT) * Copyright (c) 2015 GochoMugo <mugo@forfuture.co.ke> */ exports = module.exports = function(grunt) { "use strict"; grunt.initConfig({ benchmark: { all: { src: ["benchmark/*.js"], dest: "benchmark/results.csv" } }...
Fix count() method that might not return a relevant result
<?php namespace BenTools\ETL\Tests\Iterator; use BenTools\ETL\Iterator\CsvFileIterator; use BenTools\ETL\Tests\TestSuite; use PHPUnit\Framework\TestCase; class CsvFileIteratorTest extends TestCase { public function testIterator() { $file = new \SplFileObject(TestSuite::getDataFile('dictators.csv...
<?php namespace BenTools\ETL\Tests\Iterator; use BenTools\ETL\Iterator\CsvFileIterator; use BenTools\ETL\Tests\TestSuite; use PHPUnit\Framework\TestCase; class CsvFileIteratorTest extends TestCase { public function testIterator() { $file = new \SplFileObject(TestSuite::getDataFile('dictators.csv...
Fix sending of empty string
'use strict'; const debug = require('debug')('sockjs:connection'); const stream = require('stream'); const uuid = require('uuid/v4'); class SockJSConnection extends stream.Duplex { constructor(session) { super({ decodeStrings: false, encoding: 'utf8', readableObjectMode: true }); this._session = session; ...
'use strict'; const debug = require('debug')('sockjs:connection'); const stream = require('stream'); const uuid = require('uuid/v4'); class SockJSConnection extends stream.Duplex { constructor(session) { super({ decodeStrings: false, encoding: 'utf8' }); this._session = session; this.id = uuid(); th...
Revert "Tests default to MySQL strict" This reverts commit 53d1ba7fcfa1e238b8e24e8071436ced8f45ec58.
<?php namespace Pheasant\Tests; class MysqlTestCase extends \PHPUnit_Framework_TestCase { public function setUp() { // initialize a new pheasant $this->pheasant = \Pheasant::setup( 'mysql://root@localhost/pheasanttest?charset=utf8&strict=false' ); // wipe sequence pool $this->pheasant->connection() ...
<?php namespace Pheasant\Tests; class MysqlTestCase extends \PHPUnit_Framework_TestCase { public function setUp() { // initialize a new pheasant $this->pheasant = \Pheasant::setup( 'mysql://root@localhost/pheasanttest?charset=utf8&strict=true' ); // wipe sequence pool $this->pheasant->connection() ...
Fix test: use sortable because builtin does not accept third parameter.
<?php namespace Mimic\Test; use PHPUnit_Framework_TestCase; use Mimic\Functional as F; /** * Unit Test for sort Mimic library function. * * @since 0.1.0 */ class SortFuncTest extends PHPUnit_Framework_TestCase { public function dataProvider() { return array( array(false, F\sortable(), array(4, 2, 1, 3), ar...
<?php namespace Mimic\Test; use PHPUnit_Framework_TestCase; use Mimic\Functional as F; /** * Unit Test for sort Mimic library function. * * @since 0.1.0 */ class SortFuncTest extends PHPUnit_Framework_TestCase { public function dataProvider() { return array( array(false, F\sortable(), array(4, 2, 1, 3), ar...
Fix package version and remove django from list of required packages.
from distutils.core import setup LONG_DESC = """ Unicode URLS in django.""" setup( name='unicode_urls', packages=['unicode_urls', 'unicode_urls.django', 'unicode_urls.cms'], version='0.2.1', long_description=LONG_DESC, description='Unicode urls.', author='Alex Gavrisco', author_email='alex...
from distutils.core import setup LONG_DESC = """ Unicode URLS in django.""" setup( name='unicode_urls', packages=['unicode_urls', 'unicode_urls.django', 'unicode_urls.cms'], version='0.0.1', long_description=LONG_DESC, description='Unicode urls.', author='Alex Gavrisco', author_email='alex...
Fix eclipse error message on mod_wsgi import Signed-off-by: Jonathan Dieter <ddc8e8b9809278692339ab749e05e6020a8d4c9a@lesbg.com>
# lesson/main.py # # This file is part of LESSON. LESSON 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, version 2 or later. # # This program is distributed in the hope that it will be useful, but WITHOUT # A...
# lesson/main.py # # This file is part of LESSON. LESSON 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, version 2 or later. # # This program is distributed in the hope that it will be useful, but WITHOUT # A...
Increase max password size so it works with the default Heroku-generated password of 64 characters
package io.github.jhipster.registry.web.rest.dto; import javax.validation.constraints.*; /** * A DTO representing a user's credentials */ public class LoginDTO { @NotNull @Size(min = 1, max = 50) private String username; @NotNull @Size(min = 5, max = 64) private String password; priva...
package io.github.jhipster.registry.web.rest.dto; import javax.validation.constraints.*; /** * A DTO representing a user's credentials */ public class LoginDTO { @NotNull @Size(min = 1, max = 50) private String username; @NotNull @Size(min = 5, max = 50) private String password; priva...
Remove + / - buttons
const h = require('virtual-dom/h'); module.exports = function (data) { const {gameID, game} = data; return h('div', {className: 'room'}, [ game.playing ? null : h('form', {method: 'post', action: `/${gameID}`}, [ h('input', {type: 'number', name: 'max-score', min: '1', value: game.maxScore}), h('bu...
const h = require('virtual-dom/h'); module.exports = function (data) { const {gameID, game} = data; return h('div', {className: 'room'}, [ game.playing ? null : h('form', {method: 'post', action: `/${gameID}`}, [ h('button', {type: 'button', id: 'min'}, '-'), h('input', {type: 'number', name: 'max-...
Fix unit test by adding new namespace
<?php /** * @author Jaisen Mathai <jaisen@jmathai.com> * @copyright Copyright 2015, Jaisen Mathai */ namespace JMathai\S3BucketStreamZipTest; use JMathai\S3BucketStreamZip\S3BucketStreamZip; use PHPUnit_Framework_TestCase; class S3BucketStreamZipTest extends PHPUnit_Framework_TestCase { /** * @expectedExcepti...
<?php /** * @author Jaisen Mathai <jaisen@jmathai.com> * @copyright Copyright 2015, Jaisen Mathai */ namespace S3BucketStreamZipTest; use S3BucketStreamZip\S3BucketStreamZip; use PHPUnit_Framework_TestCase; class S3BucketStreamZipTest extends PHPUnit_Framework_TestCase { /** * @expectedException \S3BucketStre...
Make lyra export work thanks to @RussellSprouts and @arvind.
'use strict'; angular.module('vleApp') .directive('lyraExport', function () { return { template: '<a href="#" ng-click="export()">export to lyra...</a>', restrict: 'E', controller: function ($scope, $timeout, Vegalite, Alerts) { $scope.export = function() { var vegaSpec = Vega...
'use strict'; angular.module('vleApp') .directive('lyraExport', function () { return { template: '<a href="#" ng-click="export()">export to lyra...</a>', restrict: 'E', controller: function ($scope, $timeout, Vegalite, Alerts) { $scope.export = function() { var vegaSpec = Vega...
Remove CfP, add Committee page
<?php /******************************************************************************* * Copyright (c) 2015 Eclipse Foundation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution,...
<?php /******************************************************************************* * Copyright (c) 2015 Eclipse Foundation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution,...
Change the search path to look locally In order to use tools/build.py, we need to search locally for imports. Closes-bug: #1592030 Change-Id: Idfa651c1268f93366de9f4e3fa80c33be42c71c3
#!/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, software...
#!/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, software...
Use next to get the zone
import os import types from unittest import TestCase from yoconfigurator.base import read_config from yoconfig import configure_services from pycloudflare.services import CloudFlareService app_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) conf = read_config(app_dir) class ZonesTest(TestCase)...
import os import types from unittest import TestCase from yoconfigurator.base import read_config from yoconfig import configure_services from pycloudflare.services import CloudFlareService app_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) conf = read_config(app_dir) class ZonesTest(TestCase)...
Fix undefined `$items` variable in `devtoolsProjectList.tpl` By simply extending the `MultipleLinkPage` class, the `$items` variable is automatically set. See #2354
<?php namespace wcf\acp\page; use wcf\data\devtools\project\DevtoolsProjectList; use wcf\page\MultipleLinkPage; /** * Shows a list of devtools projects. * * @author Alexander Ebert * @copyright 2001-2017 WoltLab GmbH * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> ...
<?php namespace wcf\acp\page; use wcf\data\devtools\project\DevtoolsProjectList; use wcf\page\AbstractPage; use wcf\system\WCF; /** * Shows a list of devtools projects. * * @author Alexander Ebert * @copyright 2001-2017 WoltLab GmbH * @license GNU Lesser General Public License <http://opensource.org/licenses/lgp...
Update factory. Reset migrations & add fake data again
<?php /* |-------------------------------------------------------------------------- | Model Factories |-------------------------------------------------------------------------- | | Here you may define all of your model factories. Model factories give | you a convenient way to create model...
<?php /* |-------------------------------------------------------------------------- | Model Factories |-------------------------------------------------------------------------- | | Here you may define all of your model factories. Model factories give | you a convenient way to create models for testing and seeding yo...
Remove deprecated methods encoding in lib/x509util.GetPermittedMethods().
package x509util import ( "crypto/x509" "encoding/asn1" "fmt" "github.com/Symantec/Dominator/lib/constants" "strings" ) func getPermittedMethods(cert *x509.Certificate) (map[string]struct{}, error) { methodList := make(map[string]struct{}) for _, extension := range cert.Extensions { if extension.Id.String() ...
package x509util import ( "crypto/x509" "encoding/asn1" "fmt" "github.com/Symantec/Dominator/lib/constants" "strings" ) func getPermittedMethods(cert *x509.Certificate) (map[string]struct{}, error) { methodList := make(map[string]struct{}) for _, extension := range cert.Extensions { if extension.Id.String() ...
Add missing type hint for field_schema parameter
from typing import Any, Callable, Dict, Iterable, Optional, Type from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile from pydantic.fields import ModelField __all__ = ["UploadedFile"] class UploadedFile(DjangoUploadedFile): @classmethod def __get_validators__(cls: Type["UploadedFile...
from typing import Any, Callable, Iterable, Optional, Type from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile from pydantic.fields import ModelField __all__ = ["UploadedFile"] class UploadedFile(DjangoUploadedFile): @classmethod def __get_validators__(cls: Type["UploadedFile"]) ->...
Use app storage sub path
<?php return array( /* |-------------------------------------------------------------------------- | Service |-------------------------------------------------------------------------- | | Current only supports 'maxmind'. | */ 'service' => 'maxmind', /* |--------------------------------------------------...
<?php return array( /* |-------------------------------------------------------------------------- | Service |-------------------------------------------------------------------------- | | Current only supports 'maxmind'. | */ 'service' => 'maxmind', /* |--------------------------------------------------...
Add data to log for spec map
<?php /** * Humbug * * @category Humbug * @package Humbug * @copyright Copyright (c) 2015 Pádraic Brady (http://blog.astrumfutura.com) * @license https://github.com/padraic/humbug/blob/master/LICENSE New BSD License */ namespace Humbug\PhpSpec\Listener; use Humbug\PhpSpec\Logger\JsonSpecMapLogger; use...
<?php /** * Humbug * * @category Humbug * @package Humbug * @copyright Copyright (c) 2015 Pádraic Brady (http://blog.astrumfutura.com) * @license https://github.com/padraic/humbug/blob/master/LICENSE New BSD License */ namespace Humbug\PhpSpec\Listener; use Humbug\PhpSpec\Logger\JsonSpecMapLogger; use...
Update SWFError with a formatted type
# -*- coding: utf-8 -*- # Copyright (c) 2013, Theo Crevon # Copyright (c) 2013, Greg Leclercq # # See the file LICENSE for copying permission. class SWFError(Exception): def __init__(self, message, raw_error, *args): Exception.__init__(self, message, *args) self.kind, self.details = raw_error.spli...
# -*- coding: utf-8 -*- # Copyright (c) 2013, Theo Crevon # Copyright (c) 2013, Greg Leclercq # # See the file LICENSE for copying permission. class SWFError(Exception): def __init__(self, message, raw_error, *args): Exception.__init__(self, message, *args) self.kind, self.details = raw_error.spli...
Change to removed widget namespace in views
/* ************************************************************************ ${Name} Copyright: 2010 Deutsche Telekom AG, Germany, http://telekom.com ************************************************************************ */ /* ************************************************************************ #a...
/* ************************************************************************ ${Name} Copyright: 2010 Deutsche Telekom AG, Germany, http://telekom.com ************************************************************************ */ /* ************************************************************************ #a...
Add Manage App Store link
<?php define('COOKIE_SESSION', true); require_once("../config.php"); session_start(); require_once("gate.php"); if ( $REDIRECTED === true || ! isset($_SESSION["admin"]) ) return; setcookie("adminmenu","true", 0, "/"); \Tsugi\Core\LTIX::getConnection(); $OUTPUT->header(); $OUTPUT->bodyStart(); $OUTPUT->topNav(); ?> <...
<?php define('COOKIE_SESSION', true); require_once("../config.php"); session_start(); require_once("gate.php"); if ( $REDIRECTED === true || ! isset($_SESSION["admin"]) ) return; setcookie("adminmenu","true", 0, "/"); \Tsugi\Core\LTIX::getConnection(); $OUTPUT->header(); $OUTPUT->bodyStart(); $OUTPUT->topNav(); ?> <...
Fix problem introduced during recent refactor
/* * Copyright 2020 Crown Copyright * * 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...
/* * Copyright 2020 Crown Copyright * * 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...
Change merge order for default data
<?php namespace StickyNotes; /** * Sticky Notes * * An open source lightweight pastebin application * * @package StickyNotes * @author Sayak Banerjee * @copyright (c) 2013 Sayak Banerjee <mail@sayakbanerjee.com> * @license http://www.opensource.org/licenses/bsd-license.php * @link http:/...
<?php namespace StickyNotes; /** * Sticky Notes * * An open source lightweight pastebin application * * @package StickyNotes * @author Sayak Banerjee * @copyright (c) 2013 Sayak Banerjee <mail@sayakbanerjee.com> * @license http://www.opensource.org/licenses/bsd-license.php * @link http:/...
Update composite section to handle notifications
package ca.antonious.viewcelladapter.sections; import java.util.ArrayList; import java.util.List; import ca.antonious.viewcelladapter.internal.SectionObserver; import ca.antonious.viewcelladapter.viewcells.AbstractViewCell; import ca.antonious.viewcelladapter.utils.ViewCellUtils; /** * Created by George on 2016-12-...
package ca.antonious.viewcelladapter.sections; import java.util.ArrayList; import java.util.List; import ca.antonious.viewcelladapter.viewcells.AbstractViewCell; import ca.antonious.viewcelladapter.utils.ViewCellUtils; /** * Created by George on 2016-12-17. */ public class CompositeSection extends AbstractSection...
Delete init code (mount App)
import React from 'react'; import ReactDOM from 'react-dom'; import { Router, Route, IndexRoute, browserHistory } from 'react-router'; import './index.css'; import App from './App'; import { CoursesListPage } from './pages/courses-list/couses-list'; import { CoursesItemPage } from './pages/courses-item/cours...
import React from 'react'; import ReactDOM from 'react-dom'; import { Router, Route, IndexRoute, browserHistory } from 'react-router'; import './index.css'; import App from './App'; import { CoursesListPage } from './pages/courses-list/couses-list'; import { CoursesItemPage } from './pages/courses-item/cours...
Fix is ajax change in custom actions
import client from './client' import superagent from 'superagent' export default { getCustomActions (callback) { client.get('/api/data/custom-actions', callback) }, newCustomAction (customAction, callback) { const data = { name: customAction.name, url: customAction.url } client.post(...
import client from './client' import superagent from 'superagent' export default { getCustomActions (callback) { client.get('/api/data/custom-actions', callback) }, newCustomAction (customAction, callback) { const data = { name: customAction.name, url: customAction.url } client.post(...
Use class methods for unittests
import unittest from app import create_app, db from app.utils import get_or_create from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all() def t...
import unittest from app import create_app, db from app.utils import get_or_create from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all() def t...
Use GuiUtils instead of extending Gui
package mezz.jei.gui; import cpw.mods.fml.client.config.GuiUtils; import mezz.jei.api.gui.IDrawable; import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; import javax.annotation.Nonnull; public class DrawableResource implements IDrawable { @Nonnull private final ResourceLocation reso...
package mezz.jei.gui; import mezz.jei.api.gui.IDrawable; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.util.ResourceLocation; import javax.annotation.Nonnull; public class DrawableResource extends Gui implements IDrawable { @Nonnull private final ResourceLocation...
Update the playground to support custom services
/*global Playground*/ (function() { "use strict"; Playground.VideoService = Conductor.Oasis.Service.extend({ initialize: function (port) { this.sandbox.videoPort = port; } }); Playground.SurveyService = Conductor.Oasis.Service.extend({ initialize: function (port) { this.sandbox.survey...
/*global Playground*/ (function() { "use strict"; Playground.VideoService = Conductor.Oasis.Service.extend({ initialize: function (port) { this.sandbox.videoPort = port; } }); Playground.SurveyService = Conductor.Oasis.Service.extend({ initialize: function (port) { this.sandbox.survey...
Use str type instead of bytes in Python 2
""" Compatibility constants and functions for the different Python versions. """ import sys # Python 2.6 or older? PY26 = (sys.version_info < (2, 7)) # Python 3.0 or newer? PY3 = (sys.version_info >= (3,)) # Python 3.3 or newer? PY33 = (sys.version_info >= (3, 3)) # Python 3.4 or newer? PY34 = sys.version_info >= (...
""" Compatibility constants and functions for the different Python versions. """ import sys # Python 2.6 or older? PY26 = (sys.version_info < (2, 7)) # Python 3.0 or newer? PY3 = (sys.version_info >= (3,)) # Python 3.3 or newer? PY33 = (sys.version_info >= (3, 3)) # Python 3.4 or newer? PY34 = sys.version_info >= (...
Use docblock tag instead of a plain php comment. This prevents accidentally exporting the ::build() method on the XML-RPC server. svn commit r1712
<?php require_once 'Swat/SwatPage.php'; require_once 'XML/RPC2/Server.php'; /** * Base class for an XML-RPC Server * * The XML-RPC server acts as a regular page in an application . This means * all the regular page security features work for XML-RPC servers. * * Swat XML-RPC server pages use the PEAR::XML_RPC2 ...
<?php require_once 'Swat/SwatPage.php'; require_once 'XML/RPC2/Server.php'; /** * Base class for an XML-RPC Server * * The XML-RPC server acts as a regular page in an application . This means * all the regular page security features work for XML-RPC servers. * * Swat XML-RPC server pages use the PEAR::XML_RPC2 ...
Load scripts in debug mode Bug: T124633 Change-Id: I82d1366428e529c541297e6848fa0e71678c270c
<?php /** * ResourceLoader module providing extra data to the client-side. * * @file * @ingroup Extensions */ namespace Kartographer; use ResourceLoader; use ResourceLoaderContext; use ResourceLoaderModule; class DataModule extends ResourceLoaderModule { protected $origin = self::ORIGIN_USER_SITEWIDE; protec...
<?php /** * ResourceLoader module providing extra data to the client-side. * * @file * @ingroup Extensions */ namespace Kartographer; use ResourceLoader; use ResourceLoaderContext; use ResourceLoaderModule; class DataModule extends ResourceLoaderModule { protected $origin = self::ORIGIN_USER_SITEWIDE; protec...
Remove south from test requirements
from setuptools import setup, find_packages setup( name = "django-report-builder", version = "2.0.2", author = "David Burke", author_email = "david@burkesoftware.com", description = ("Query and Report builder for Django ORM"), license = "BSD", keywords = "django report", url = "https://...
from setuptools import setup, find_packages setup( name = "django-report-builder", version = "2.0.2", author = "David Burke", author_email = "david@burkesoftware.com", description = ("Query and Report builder for Django ORM"), license = "BSD", keywords = "django report", url = "https://...
Test XHR throw ex on mailformed URL. On branch rc1 modified: firefox/content/prototype.js
var Q = require("events"); var HTTP = require("http"); var P; window.addEventListener("load", function (e) { var r = HTTP.create(); var p = r.send("GET", "htt://www.foodoes_not_exist/"); dump("call to r.send() returned\n"); p.then( function (res) { dump("RESPONSE status:\...
var Q = require("events"); var HTTP = require("http"); var P; window.addEventListener("load", function (e) { var r = HTTP.create(); var p = r.send("GET", "http://www.foodoes_not_exist/"); dump("call to r.send() returned\n"); p.then( function (res) { dump("RESPONSE status:...
Fix bug: KeyError: 'HOME' in Windows.
#!/usr/bin/env python """ Utility to copy ROUGE script. It has to be run before `setup.py` """ import os import shutil from files2rouge import settings from six.moves import input def copy_rouge(): if 'HOME' not in os.environ: home = os.environ['HOMEPATH'] else: home = os.environ['HO...
#!/usr/bin/env python """ Utility to copy ROUGE script. It has to be run before `setup.py` """ import os import shutil from files2rouge import settings from six.moves import input def copy_rouge(): home = os.environ['HOME'] src_rouge_root = "./files2rouge/RELEASE-1.5.5/" default_root = os.path...
Update to version 0.1.1 (already in pypi). PiperOrigin-RevId: 391948484 Change-Id: Idf5c7f00dbba8ffe2ca292961d4e0e0e26bcd1cb
# Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Correct regex in unit test Summary: Correct regex used in unit tests. Test Plan: Unit test Reviewed By: @alikhtarov Differential Revision: D1804582
# Copyright (c) 2015, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import absolute_...
# Copyright (c) 2015, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import absolute_...
Make non-browserfiable interested in non-javascript resources.
var allJavascript = /\.js$/; var json = /package\.json$/; var coffeeOrJs = /\.(?:js)|(?:coffee)$/; var nonModule = /scripts/; var minified = /-min\.js$/; var generated = /generated/; var stub = /\.stub\.js/; exports.allJavascript = function (f) { return allJavascript.test(f) && !stub.test(f); }; exports.handwri...
var allJavascript = /\.js$/; var json = /package\.json$/; var coffeeOrJs = /\.(?:js)|(?:coffee)$/; var nonModule = /scripts/; var minified = /-min\.js$/; var generated = /generated/; var stub = /\.stub\.js/; exports.allJavascript = function (f) { return allJavascript.test(f) && !stub.test(f); }; exports.handwri...
Deploy to GitHub pages [ci skip]
export Tuttolino404 from "./tuttolino-404.png" export TuttolinoCompetitor from "./tuttolino-competitor.svg" export TuttolinoErrorMobile from "./tuttolino-error-mobile.png" export TuttolinoError from "./tuttolino-error.svg" export TuttolinoFamilySofa from "./tuttolino-family-sofa.svg" export TuttolinoFamily from "./tutt...
export Tuttolino404 from "./tuttolino-404.png" export TuttolinoCompetitor from "./tuttolino-competitor.svg" export TuttolinoErrorMobile from "./tuttolino-error-mobile.png" export TuttolinoError from "./tuttolino-error.svg" export TuttolinoFamilySofa from "./tuttolino-family-sofa.svg" export TuttolinoFamily from "./tutt...
Enable source maps in production
const config = require('./webpack.config.js'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); config.devtool = 'cheap-module-source-map'; // Set environment to production config.plugins.push(new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringi...
const config = require('./webpack.config.js'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); config.devtool = 'cheap-module-source-map'; // Set environment to production config.plugins.push(new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringi...
Fix the 'base' attribute for ng-apps
<!doctype html> <html class="no-js" <?php language_attributes(); ?>> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="alternate" type="application/rss+xml" title="<?= get_bloginfo('name')...
<!doctype html> <html class="no-js" <?php language_attributes(); ?>> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="alternate" type="application/rss+xml" title="<?= get_bloginfo('name')...
Swap word API out with Chuck Norris joke API
/* * We are using jQuery functions as they are pretty easy to use. * You can do all of this stuff using vanilla javascript though */ // $(...) will run the function you give it when the page is loaded & ready $(function() { // console.log will log a message or object to the browser developer console console.log...
/* * We are using jQuery functions as they are pretty easy to use. * You can do all of this stuff using vanilla javascript though */ // $(...) will run the function you give it when the page is loaded & ready $(function() { // console.log will log a message or object to the browser developer console console.log...
Use a protocol relative URL so the package can be used other HTTPS as well
module.exports = asString module.exports.add = append function asString(fonts) { var href = getHref(fonts) return '<link href="' + href + '" rel="stylesheet" type="text/css">' } function asElement(fonts) { var href = getHref(fonts) var link = document.createElement('link') link.setAttribute('href', href) ...
module.exports = asString module.exports.add = append function asString(fonts) { var href = getHref(fonts) return '<link href="' + href + '" rel="stylesheet" type="text/css">' } function asElement(fonts) { var href = getHref(fonts) var link = document.createElement('link') link.setAttribute('href', href) ...
Add colour to execution status.
#!/usr/bin/env node const fs = require('fs') colours = require('colors') program = require('commander'); program .version('0.0.1') .description('A command line script to minify files.') .option('-f, --file <file>', 'Specify the file to minify: minify -f thisFile.js') .parse(process.argv); if (prog...
#!/usr/bin/env node const fs = require('fs') program = require('commander'); program .version('0.0.1') .description('A command line script to minify files.') .option('-f, --file <file>', 'Specify the file to minify: minify -f thisFile.js') .parse(process.argv); if (program.file) { /* Read the file...
Call os.Exit() with m.Run()'s return value This closes #149. This closes #151.
package main import ( "flag" "fmt" "log" "math/rand" "os" "testing" "time" "github.com/keybase/client/go/libkb" bserver "github.com/keybase/kbfs/bserver" ) var ( BServerRemote = flag.Bool("kbfs.bserverRemote", false, "which bserver to use, local or remote") ) func init() { flag.Parse() } func TestMain(m...
package main import ( "flag" "fmt" "github.com/keybase/client/go/libkb" bserver "github.com/keybase/kbfs/bserver" "log" "math/rand" "testing" "time" ) var ( BServerRemote = flag.Bool("kbfs.bserverRemote", false, "which bserver to use, local or remote") ) func init() { flag.Parse() } func TestMain(m *testi...
Change app-level error handler to use api_client.error exceptions
# coding=utf-8 from flask import render_template from . import main from ..api_client.error import APIError @main.app_errorhandler(APIError) def api_error_handler(e): return _render_error_page(e.status_code) @main.app_errorhandler(404) def page_not_found(e): return _render_error_page(404) @main.app_error...
# coding=utf-8 from flask import render_template from . import main from dmapiclient import APIError @main.app_errorhandler(APIError) def api_error_handler(e): return _render_error_page(e.status_code) @main.app_errorhandler(404) def page_not_found(e): return _render_error_page(404) @main.app_errorhandler...
Fix tests for visit_Attribute on 2.5/PyPy
from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'type(value).__name__': "'int'", ...
from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'value.denominator': '1', '...
Update the path to the methods
// Define DrupalAjaxRequest var DrupalAjaxRequest = (function () { var fetchNode = function(node_id, callback) { Zepto.ajax( { url: Kiosk.util.contentUrl('node'), dataType: 'jsonp', data: {nid: node_id}, type: 'GET', cache: false, success: function (result) { ...
// Define DrupalAjaxRequest var DrupalAjaxRequest = (function () { var fetchNode = function(node_id, callback) { Zepto.ajax( { url: Kiosk.contentUrl('node'), dataType: 'jsonp', data: {nid: node_id}, type: 'GET', cache: false, success: function (result) { ...
Change database init script for daemon tests
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
Fix evil eval warning in lint
/** * Main controller for the Huna JS app. Shows the main (index) page */ app.controller('ErrorController', function($scope, $interval){ var stop; $scope.timeout = ""; $scope.busy = false; $scope.parseError = function(){ countDown(); var a = ""; a.asdf = asdf; }; $scope.syntaxError = functi...
/** * Main controller for the Huna JS app. Shows the main (index) page */ app.controller('ErrorController', function($scope, $interval){ var stop; $scope.timeout = ""; $scope.busy = false; $scope.parseError = function(){ countDown(); var a = ""; a.asdf = asdf; }; $scope.syntaxError = functi...
Call $scope.$apply after running the logic of the function/updating the property
angular.module('apps', ['angular-loading-bar', 'apis']) .controller('mailserversetting', ['$window', '$timeout', 'systemApi', function ($window, $timeout, $api) { var self = this; self.Initialize = function () { self.JsonModel = $window['MailServerSettingJson']; self.AlertSuccess = false; self.AlertError...
angular.module('apps', ['angular-loading-bar', 'apis']) .controller('mailserversetting', ['$window', '$timeout', 'systemApi', function ($window, $timeout, $api) { var self = this; self.Initialize = function () { self.JsonModel = $window['MailServerSettingJson']; self.AlertSuccess = false; self.AlertError...
Convert DiscordSync route to POST
<?php /* |-------------------------------------------------------------------------- | API Routes |-------------------------------------------------------------------------- | | Here is where you can register API routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | ...
<?php /* |-------------------------------------------------------------------------- | API Routes |-------------------------------------------------------------------------- | | Here is where you can register API routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | ...
Fix ini_set('error_log', ...) with HHVM https://github.com/facebook/hhvm/issues/3558
<?php /** * * This file is part of the Apix Project. * * (c) Franck Cassedanne <franck at ouarz.net> * * @license http://opensource.org/licenses/BSD-3-Clause New BSD License * */ namespace Apix\Log\tests\Logger; use Apix\Log\Logger; class ErrorLogTest extends TestCase { protected $dest = './apix-u...
<?php /** * * This file is part of the Apix Project. * * (c) Franck Cassedanne <franck at ouarz.net> * * @license http://opensource.org/licenses/BSD-3-Clause New BSD License * */ namespace Apix\Log\tests\Logger; use Apix\Log\Logger; class ErrorLogTest extends TestCase { protected $dest = './apix-u...
Set update job timeout back to a more reasonable value
import sys import time import logging logging.basicConfig(level=logging.DEBUG) from redis import StrictRedis from rq import Queue from apscheduler.schedulers.blocking import BlockingScheduler from d1lod import jobs conn = StrictRedis(host='redis', port='6379') q = Queue(connection=conn) sched = BlockingScheduler() ...
import sys import time import logging logging.basicConfig(level=logging.DEBUG) from redis import StrictRedis from rq import Queue from apscheduler.schedulers.blocking import BlockingScheduler from d1lod import jobs conn = StrictRedis(host='redis', port='6379') q = Queue(connection=conn) sched = BlockingScheduler() ...
Verify key type instead of value This is to make the code cleaner and easier to understand
var extend = require('extend'); var Plom = function(options) { this.options = options || {}; this.data = this.options.data || {}; } Plom.extend = function(object) { var NewPlom = function(options) { this.options = options || {}; this.data = this.options.data || {}; if(this.initialize) { this...
var extend = require('extend'); var Plom = function(options) { this.options = options || {}; this.data = this.options.data || {}; } Plom.extend = function(object) { var NewPlom = function(options) { this.options = options || {}; this.data = this.options.data || {}; if(this.initialize) { this...
Stop using `exposed` prefix for remote attributes, per rpyc v4
import sys import rpyc from rpyc.utils.server import OneShotServer class GhcompService(rpyc.ClassicService): def on_connect(self, conn): print('Incoming connection.') super(GhcompService, self).on_connect(conn) import ghpythonlib.components as ghcomp self.ghcomp = ghcomp def o...
import sys import rpyc from rpyc.utils.server import OneShotServer class GhcompService(rpyc.ClassicService): def on_connect(self, conn): print('Incoming connection.') super(GhcompService, self).on_connect(conn) import ghpythonlib.components as ghcomp self.ghcomp = ghcomp def o...
Fix Attempting to Display Blank Errors Fix attempting to display blank errors in single pages - This is particularly apparent with the newer `Controller::$error` property.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); if (isset($error) && $error != '') { if ($error instanceof Exception) { $_error[] = $error->getMessage(); } else if ($error instanceof ValidationErrorHelper) { $_error = $error->getList(); } else if (is_array($error)) { $_error = $error; } else if (is...
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); if (isset($error) && $error != '') { if ($error instanceof Exception) { $_error[] = $error->getMessage(); } else if ($error instanceof ValidationErrorHelper) { $_error = $error->getList(); } else if (is_array($error)) { $_error = $error; } else if (is...
Hide the sidebar by default.
import {Experiment, ExperimentStep} from './experiment.model'; angular.module('materialscommons').component('mcExperiment', { templateUrl: 'app/project/experiments/experiment/mc-experiment.html', controller: MCExperimentComponentController }); /*@ngInject*/ function MCExperimentComponentController($scope, mov...
import {Experiment, ExperimentStep} from './experiment.model'; angular.module('materialscommons').component('mcExperiment', { templateUrl: 'app/project/experiments/experiment/mc-experiment.html', controller: MCExperimentComponentController }); /*@ngInject*/ function MCExperimentComponentController($scope, mov...
Refactor to avoid duplicate code
from ..constants import FORMAT_CHECKS from ..post import HEADER_OPTIONAL_FIELD_TYPES, HEADER_REQUIRED_FIELD_TYPES from ..postprocessor import KnowledgePostProcessor class FormatChecks(KnowledgePostProcessor): _registry_keys = [FORMAT_CHECKS] def process(self, kp): headers = kp.headers for fie...
from ..constants import FORMAT_CHECKS from ..post import HEADER_OPTIONAL_FIELD_TYPES, HEADER_REQUIRED_FIELD_TYPES from ..postprocessor import KnowledgePostProcessor class FormatChecks(KnowledgePostProcessor): _registry_keys = [FORMAT_CHECKS] def process(self, kp): headers = kp.headers for fie...
Fix location factory field name
# coding: utf-8 import factory import random from .models import Location, Region class RegionFactory(factory.Factory): FACTORY_FOR = Region name = factory.Sequence(lambda n: "Region_%s" % n) slug = factory.LazyAttribute(lambda a: a.name.lower()) latitude = random.uniform(-90.0, 90.0) longitude...
# coding: utf-8 import factory import random from .models import Location, Region class RegionFactory(factory.Factory): FACTORY_FOR = Region name = factory.Sequence(lambda n: "Region_%s" % n) slug = factory.LazyAttribute(lambda a: a.name.lower()) latitude = random.uniform(-90.0, 90.0) longitude...
Use an older raven until our Sentry is upgraded to 5.1
from setuptools import setup, find_packages setup( name='jmbo-skeleton', version='0.6', description='Create a Jmbo project environment quickly. Includes a Jmbo demo application.', long_description = open('README.rst', 'r').read() + open('AUTHORS.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(), ...
from setuptools import setup, find_packages setup( name='jmbo-skeleton', version='0.6', description='Create a Jmbo project environment quickly. Includes a Jmbo demo application.', long_description = open('README.rst', 'r').read() + open('AUTHORS.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(), ...
Print status at the extension's badge
var MoochSentinel = { render: function(status) { if (status.okay) { var msg = "Okay"; var color = [255, 0, 0, 0]; } else { var msg = "Blocked"; var color = [0, 255, 0, 0]; } document.getElementById("status").innerText = msg; chrome.browserAction.s...
var MoochSentinel = { render: function(status) { document.getElementById("status").innerText = status.okay? "Okay!" : "Blocked"; }, requestStatus: function() { var user = localStorage['moochLogin']; if (!user) { document.getElementById("status").innerText = "Please, set u...
Add utility to retrieve all extension type bases
"Simple utilities related to extension types" #------------------------------------------------------------------------ # Read state from extension types #------------------------------------------------------------------------ def get_attributes_type(py_class): "Return the attribute struct type of the numba exte...
"Simple utilities related to extension types" #------------------------------------------------------------------------ # Read state from extension types #------------------------------------------------------------------------ def get_attributes_type(py_class): "Return the attribute struct type of the numba exte...
Update the reply count display
<div class="data-list"> @foreach ($discussions as $discussion) <div class="d-flex align-items-start align-items-md-center justify-content-start mb-2 p-2"> <div class="d-flex align-items-start align-items-md-center mr-auto"> <div class="mr-3"> <div class="hidden-sm-down">{!! avatar($discussion->author)->link()...
<div class="data-list"> @foreach ($discussions as $discussion) <div class="d-flex align-items-start align-items-md-center justify-content-start mb-2 p-2"> <div class="d-flex align-items-start align-items-md-center mr-auto"> <div class="mr-3"> <div class="hidden-sm-down">{!! avatar($discussion->author)->link()...
Add longDescription and exampleStringValue to sleep
package org.cytoscape.commandDialog.internal.tasks; import org.cytoscape.work.AbstractTask; import org.cytoscape.work.ProvidesTitle; import org.cytoscape.work.TaskMonitor; import org.cytoscape.work.Tunable; public class SleepCommandTask extends AbstractEmptyObservableTask { @ProvidesTitle public String getTitle() ...
package org.cytoscape.commandDialog.internal.tasks; import org.cytoscape.work.AbstractTask; import org.cytoscape.work.ProvidesTitle; import org.cytoscape.work.TaskMonitor; import org.cytoscape.work.Tunable; public class SleepCommandTask extends AbstractEmptyObservableTask { @ProvidesTitle public String getTitle() ...
Add the google analytics traking
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics...
<!-- jQuery --> <script src="<?php echo base_url('assets/js/libs/jquery.js')?>"></script> <!-- Plugins --> <script src="<?php echo base_url('assets/js/plugins.js')?>"></script> <!-- Main --> <script src="<?php echo base_url('assets/js/main.js')?>"></script> <!-- Google Analytics: change UA-XXXXX-X to be your site's ...
Use 24-hour format for German translations
// German jQuery.extend( jQuery.fn.pickadate.defaults, { monthsFull: [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' ], monthsShort: [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ], weekdaysFull: ...
// German jQuery.extend( jQuery.fn.pickadate.defaults, { monthsFull: [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' ], monthsShort: [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ], weekdaysFull: ...
Fix DI container when using console controller
<?php namespace haqqi\storm; use yii\base\Application; use yii\base\BootstrapInterface; use yii\base\Event; use yii\console\Controller; use yii\web\View; class Bootstrap implements BootstrapInterface { public function bootstrap($app) { $app->on(Application::EVENT_BEFORE_REQUEST, function ($event) { /*...
<?php namespace haqqi\storm; use yii\base\Application; use yii\base\BootstrapInterface; use yii\base\Event; use yii\console\Controller; use yii\web\View; class Bootstrap implements BootstrapInterface { public function bootstrap($app) { $app->on(Application::EVENT_BEFORE_REQUEST, function ($event) { /*...
Update to universal Google Analytics
<!-- footer --> <footer class="footer" role="contentinfo"> <!-- copyright --> <p class="copyright"> &copy; <?php echo date("Y"); ?> Copyright <?php bloginfo('name'); ?>. <?php _e('Powered by', 'html5blank'); ?> <a href="//wordpress.org" title="WordPress">WordPress</a> &amp; <a href="//html...
<!-- footer --> <footer class="footer" role="contentinfo"> <!-- copyright --> <p class="copyright"> &copy; <?php echo date("Y"); ?> Copyright <?php bloginfo('name'); ?>. <?php _e('Powered by', 'html5blank'); ?> <a href="//wordpress.org" title="WordPress">WordPress</a> &amp; <a href="//html...
Add environment variable for exported views
"use strict"; const Promise = require('bluebird'); const Task = require('../Task'); const path = require('path'); const ProjectType = require('../../ProjectType'); const fs = require('fs'); class ViewImportTask extends Task { constructor(buildManager, taskRunner) { super(buildManager, taskRunner); ...
"use strict"; const Promise = require('bluebird'); const Task = require('../Task'); const path = require('path'); const ProjectType = require('../../ProjectType'); const fs = require('fs'); class ViewImportTask extends Task { constructor(buildManager, taskRunner) { super(buildManager, taskRunner); ...
Unify bokeh's text properties' values with bokehjs
"""Classes that can be mixed-in to HasProps classes to get them the corresponding attributes. """ from .properties import HasProps, ColorSpec, DataSpec, Enum, DashPattern, Int, String from .enums import LineJoin, LineCap, FontStyle, TextAlign, TextBaseline class FillProps(HasProps): """ Mirrors the BokehJS proper...
"""Classes that can be mixed-in to HasProps classes to get them the corresponding attributes. """ from .properties import HasProps, ColorSpec, DataSpec, Enum, DashPattern, Int, String from .enums import LineJoin, LineCap, FontStyle, TextAlign, TextBaseline class FillProps(HasProps): """ Mirrors the BokehJS proper...
Fix missing parameter in docs of setChannel function
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Channel\Model; use Sylius\Component\Resource\Model\CodeAwareInterface; use...
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Channel\Model; use Sylius\Component\Resource\Model\CodeAwareInterface; use...
Update params to send object literal with `digits` property
import chai, { expect } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; chai.use(sinonChai); import ResourceTestHelper from './ResourceTestHelper'; import DtmfResource from '../lib/DtmfResource'; import HttpClient from '../lib/HttpClient'; import Credentials from '../lib...
import chai, { expect } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; chai.use(sinonChai); import ResourceTestHelper from './ResourceTestHelper'; import DtmfResource from '../lib/DtmfResource'; import HttpClient from '../lib/HttpClient'; import Credentials from '../lib...
Revert "Change DATE_FORMAT to be equivalent to datetime.isoformat()" This reverts commit 2085cf0c103df44c500bae9bccdc2ce16cd8710f. See discussion of the original commit https://github.com/amiv-eth/amivapi/commit/2085cf0c103df44c500bae9bccdc2ce16cd8710f
"""Default settings for all environments. These settings will be extended by additional config files in ROOT/config. Run `python manage.py create_config` to create such a config file. """ from os.path import abspath, dirname, join # Custom ROOT_DIR = abspath(join(dirname(__file__), "..")) EMAIL_REGEX = '^[a-zA-Z0-9_...
"""Default settings for all environments. These settings will be extended by additional config files in ROOT/config. Run `python manage.py create_config` to create such a config file. """ from os.path import abspath, dirname, join # Custom ROOT_DIR = abspath(join(dirname(__file__), "..")) EMAIL_REGEX = '^[a-zA-Z0-9_...
Add type declartions and docstrings
import flask from flask_login import login_user from server.models import User from server.login_manager import login_manager @login_manager.user_loader def load_user(user_id: int) -> User: """Returns a user from the database based on their id :param user_id: a users unique id :return: User object with c...
from flask import Response from flask_login import login_user from server.models import User from server.login_manager import login_manager @login_manager.user_loader def load_user(user_id): """Returns a user from the database based on their id""" return User.query.filter_by(id=user_id).first() def handle_...