text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Make cards hoverable for dat ux
@extends('layouts.default') @section('content') <main class="container events"> <hr /> <h1>{{$day}}</h1> <hr /> <div class="row"> @foreach($events as $event) <div class="col s12 m6 l4"> <div class="card hoverable"> @if( $event->image ) <div class="card-image"> <a href="https://www.face...
@extends('layouts.default') @section('content') <main class="container events"> <hr /> <h1>{{$day}}</h1> <hr /> <div class="row"> @foreach($events as $event) <div class="col s12 m6 l4"> <div class="card"> @if( $event->image ) <div class="card-image"> <a href="https://www.facebook.com/e...
Add user factory to auth handler
<?php namespace Colorium\Stateful; abstract class Auth { /** @var provider */ protected static $provider; /** @var \Closure */ protected static $factory; /** @var object */ protected static $user; /** @var string */ protected static $root = '__AUTH__'; /** * Load session...
<?php namespace Colorium\Stateful; abstract class Auth { /** @var Provider */ protected static $provider; /** @var string */ protected static $root = '__AUTH__'; /** * Load session provider * * @param Provider $provider * @return Provider */ public static function ...
Create destination directory if not exists
<?php namespace phtamas\yii2\imagecontroller; use yii\base\Action as BaseAction; use yii\web\NotFoundHttpException; class Action extends BaseAction { /** * @var \phtamas\yii2\imageprocessor\Component */ public $imageProcessor; /** * @var string */ public $sourceDir; /** ...
<?php namespace phtamas\yii2\imagecontroller; use yii\base\Action as BaseAction; use yii\web\NotFoundHttpException; class Action extends BaseAction { /** * @var \phtamas\yii2\imageprocessor\Component */ public $imageProcessor; /** * @var string */ public $sourceDir; /** ...
Fix a lint indent issue
from ..auth_provider import KnowledgeAuthProvider from ..models import User from flask import ( redirect, render_template, request, url_for, ) from ldap3 import Connection, Server, ALL from knowledge_repo.constants import AUTH_LOGIN_FORM, LDAP, USERNAME class LdapAuthProvider(KnowledgeAuthProvider): ...
from ..auth_provider import KnowledgeAuthProvider from ..models import User from flask import ( redirect, render_template, request, url_for, ) from ldap3 import Server, Connection, ALL from knowledge_repo.constants import AUTH_LOGIN_FORM, LDAP, USERNAME class LdapAuthProvider(KnowledgeAuthProvider): ...
Fix login controller to go to correct route.
Application.Controllers.controller('login', ["$scope", "$state", "User", "alertService", "mcapi", "Nav", "pubsub", "model.projects", "projectFiles", function ($scope, $state, User, alertService, mcapi, Nav, pubsub, projects, projectFiles) { $scope.login = function () { mcapi('/us...
Application.Controllers.controller('login', ["$scope", "$state", "User", "alertService", "mcapi", "Nav", "pubsub", "model.projects", "projectFiles", function ($scope, $state, User, alertService, mcapi, Nav, pubsub, projects, projectFiles) { $scope.login = function () { mcapi('/us...
Add check for holding any of the Appointments Collection
<?php namespace App; use Illuminate\Support\Collection; use Illuminate\Database\Eloquent\Model; use Carbon\Carbon; class Vacancy extends Model { protected $fillable = ['business_id', 'service_id', 'date', 'start_at', 'finish_at', 'capacity']; protected $guarded = ['id']; protected $dates = ['start_at',...
<?php namespace App; use Illuminate\Support\Collection; use Illuminate\Database\Eloquent\Model; use Carbon\Carbon; class Vacancy extends Model { protected $fillable = ['business_id', 'service_id', 'date', 'start_at', 'finish_at', 'capacity']; protected $guarded = ['id']; protected $dates = ['start_at',...
Fix for queued job support
<?php /** * If the queued jobs module is installed, this will be used instead of * updating vfi's in onBeforeWrite. * * @author Mark Guinn <mark@adaircreative.com> * @date 07.02.2015 * @package shop_search * @subpackage helpers */ if (!interface_exists('QueuedJob')) { return; } class VirtualFieldIndexQ...
<?php /** * If the queued jobs module is installed, this will be used instead of * updating vfi's in onBeforeWrite. * * @author Mark Guinn <mark@adaircreative.com> * @date 07.02.2015 * @package shop_search * @subpackage helpers */ if (!interface_exists('QueuedJob')) { return; } class VirtualFieldIndexQ...
Allow for generators in ipc handlers
const { ipcMain } = require('electron'); function isPromise(object) { return object.then && typeof(object.then) === 'function'; } function isGenerator(object) { return object.next && typeof(object.next) === 'function'; } class IPCHandler { handle(event, funct, binding = this) { const localFunc = ...
const { ipcMain } = require('electron'); class IPCHandler { handle(event, funct, binding = this) { const localFunc = funct.bind(binding); ipcMain.on(event, (ev, ...args) => { const localFuncResult = localFunc(...args); if(localFuncResult.then) { localFuncResu...
Allow for multiple mappings by dbxref
<?php namespace AppBundle\API\Mapping; use AppBundle\API\Webservice; use AppBundle\User\FennecUser; use Symfony\Component\HttpFoundation\ParameterBag; class ByDbxrefId extends Webservice { private $db; /** * @inheritdoc */ public function execute(ParameterBag $query, FennecUser $user = null) ...
<?php namespace AppBundle\API\Mapping; use AppBundle\API\Webservice; use AppBundle\User\FennecUser; use Symfony\Component\HttpFoundation\ParameterBag; class ByDbxrefId extends Webservice { private $db; /** * @inheritdoc */ public function execute(ParameterBag $query, FennecUser $user = null) ...
Rename var name as same asa parameter
<?php declare(strict_types=1); namespace Ray\Di\MultiBinding; use Koriym\ParamReader\ParamReaderInterface; use Ray\Di\Di\Set; use Ray\Di\Exception\SetNotFound; use Ray\Di\InjectionPointInterface; use Ray\Di\InjectorInterface; use Ray\Di\ProviderInterface; final class MapProvider implements ProviderInterface { /...
<?php declare(strict_types=1); namespace Ray\Di\MultiBinding; use Koriym\ParamReader\ParamReaderInterface; use Ray\Di\Di\Set; use Ray\Di\Exception\SetNotFound; use Ray\Di\InjectionPointInterface; use Ray\Di\InjectorInterface; use Ray\Di\ProviderInterface; final class MapProvider implements ProviderInterface { /...
:art: Refactor rule to work with gonzales 3.2.1
'use strict'; var helpers = require('../helpers'); module.exports = { 'name': 'space-after-comma', 'defaults': { 'include': true }, 'detect': function (ast, parser) { var result = []; ast.traverseByTypes(['operator', 'delimiter'], function (operator, i, parent) { var next, doubleN...
'use strict'; var helpers = require('../helpers'); module.exports = { 'name': 'space-after-comma', 'defaults': { 'include': true }, 'detect': function (ast, parser) { var result = []; ast.traverseByTypes(['operator', 'delimiter'], function (operator, i, parent) { var next; if (operat...
Implement Gref.tips() to fetch it's tips.
import os class Gref(object): def __init__(self, store, channel, identifier): self.store = store self.channel = channel.replace("/", "_") self.identifier = identifier self._node_path = os.path.join(self.store.gref_path(), self.channel, ...
import os class Gref(object): def __init__(self, store, channel, identifier): self.store = store self.channel = channel.replace("/", "_") self.identifier = identifier self._node_path = os.path.join(self.store.gref_path(), self.channel, ...
Remove text to make tweet unique for testing
# Listener Class Override import time import json from tweepy.streaming import StreamListener import sys class Listener(StreamListener): def __init__(self, twitter_api, start_time=time.time()): self.time = start_time self.api = twitter_api def on_data(self, data): # uids we are current...
# Listener Class Override import time import json from tweepy.streaming import StreamListener import sys class Listener(StreamListener): def __init__(self, twitter_api, start_time=time.time()): self.time = start_time self.api = twitter_api def on_data(self, data): # uids we are current...
FIX "message: Class \SecucardConnect\Product\Payment\Model\Merchant does not exist" for some php versions
<?php namespace SecucardConnect\Product\Payment\Model; use SecucardConnect\Product\Common\Model\BaseModel; /** * Class Transactions * @package SecucardConnect\Product\Payment\Model */ class Transactions extends BaseModel { /** * @var \SecucardConnect\Product\General\Model\Merchant */ public $mer...
<?php namespace SecucardConnect\Product\Payment\Model; use SecucardConnect\Product\Common\Model\BaseModel; use SecucardConnect\Product\Common\Model\Contact; use SecucardConnect\Product\General\Model\Merchant; /** * Class Transactions * @package SecucardConnect\Product\Payment\Model */ class Transactions extends B...
Fix Product Picker to lookup SKU. Before: Ransack was not finding sku on product, thereby it was not including it in the search. After: Sku is correctly looked up on the product master.
$.fn.productAutocomplete = function (options) { 'use strict'; // Default options options = options || {}; var multiple = typeof(options.multiple) !== 'undefined' ? options.multiple : true; this.select2({ minimumInputLength: 3, multiple: multiple, initSelection: function (element, callback) { ...
$.fn.productAutocomplete = function (options) { 'use strict'; // Default options options = options || {}; var multiple = typeof(options.multiple) !== 'undefined' ? options.multiple : true; this.select2({ minimumInputLength: 3, multiple: multiple, initSelection: function (element, callback) { ...
Use Window instead of JFrame to find top-level parent.
/* * Copyright (c) 2009 Kathryn Huxtable and Kenneth Orr. * * This file is part of the SeaGlass Pluggable Look and Feel. * * 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:...
/* * Copyright (c) 2009 Kathryn Huxtable and Kenneth Orr. * * This file is part of the SeaGlass Pluggable Look and Feel. * * 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:...
Fix unicode declaration on test
from __future__ import unicode_literals import random from ..pipeline import TextCategorizer from ..lang.en import English from ..vocab import Vocab from ..tokens import Doc from ..gold import GoldParse def test_textcat_learns_multilabel(): docs = [] nlp = English() vocab = nlp.vocab letters = ['a', ...
import random from ..pipeline import TextCategorizer from ..lang.en import English from ..vocab import Vocab from ..tokens import Doc from ..gold import GoldParse def test_textcat_learns_multilabel(): docs = [] nlp = English() vocab = nlp.vocab letters = ['a', 'b', 'c'] for w1 in letters: ...
Fix error where DateTime is sometimes null
<?php namespace Concrete\Core\Summary\Data\Field; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use DateTime; use DateTimeZone; class DatetimeDataFieldData implements DataFieldDataInterface { /** * @var DateTime | null */ protected $dateTime; public function __construc...
<?php namespace Concrete\Core\Summary\Data\Field; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use DateTime; use DateTimeZone; class DatetimeDataFieldData implements DataFieldDataInterface { /** * @var DateTime */ protected $dateTime; public function __construct(DateT...
Move override logic into update rather than touch
from framework.auth.core import _get_current_user from website.files.models.base import File, Folder, FileNode, FileVersion __all__ = ('DataverseFile', 'DataverseFolder', 'DataverseFileNode') class DataverseFileNode(FileNode): provider = 'dataverse' class DataverseFolder(DataverseFileNode, Folder): pass ...
import requests from framework.auth.core import _get_current_user from website.files.models.base import File, Folder, FileNode, FileVersion __all__ = ('DataverseFile', 'DataverseFolder', 'DataverseFileNode') class DataverseFileNode(FileNode): provider = 'dataverse' class DataverseFolder(DataverseFileNode, F...
Solve navigation problem when you are in list view and pres the button to come back to view (before it was to home)
/** * @author Jose A. Dianes <jdianes@ebi.ac.uk> * * The prc-cluster-list-filters directive allows us to reuse a spectra visualisations using SpeckTackle. * */ var clusterListFiltersDirective = angular.module('prideClusterApp.clusterListFiltersDirective', []) clusterListFiltersDirective.directive('prcClusterList...
/** * @author Jose A. Dianes <jdianes@ebi.ac.uk> * * The prc-cluster-list-filters directive allows us to reuse a spectra visualisations using SpeckTackle. * */ var clusterListFiltersDirective = angular.module('prideClusterApp.clusterListFiltersDirective', []) clusterListFiltersDirective.directive('prcClusterList...
Set entity loader to autoload Http namespace
<?php namespace Luminary\Services\ApiLoader\Loaders; use Luminary\Services\ApiLoader\Registry\Registrar; class EntityLoader extends AbstractApiLoader { /** * Return the relative path to the directory * for auto loading * * @return string */ public static function path() :string {...
<?php namespace Luminary\Services\ApiLoader\Loaders; use Luminary\Services\ApiLoader\Registry\Registrar; class EntityLoader extends AbstractApiLoader { /** * Return the relative path to the directory * for auto loading * * @return string */ public static function path() :string {...
Fix exception handling in HTTPNotifier
import logging import requests from .base import Notifier log = logging.getLogger(__name__) class HTTPNotifier(Notifier): ''' A Notifier that sends http post request to a given url ''' def __init__(self, auth=None, json=True, **kwargs): ''' Create a new HTTPNotifier :param auth: If ...
import logging import requests from .base import Notifier log = logging.getLogger(__name__) class HTTPNotifier(Notifier): ''' A Notifier that sends http post request to a given url ''' def __init__(self, auth=None, json=True, **kwargs): ''' Create a new HTTPNotifier :param auth: If ...
Add API key to context
from __future__ import absolute_import from django.contrib.auth.models import AnonymousUser from django.utils.crypto import constant_time_compare from rest_framework.authentication import BasicAuthentication from rest_framework.exceptions import AuthenticationFailed from sentry.app import raven from sentry.models imp...
from __future__ import absolute_import from django.contrib.auth.models import AnonymousUser from django.utils.crypto import constant_time_compare from rest_framework.authentication import BasicAuthentication from rest_framework.exceptions import AuthenticationFailed from sentry.models import ApiKey, ProjectKey clas...
Change injection method to append
(function() { const IS_LOCAL = !!(localStorage["ultratypedev"]), URL_REMOTE = "https://rawgit.com/ultratype/UltraTypeBot/master/OUT/OUT.js", URL_OUT = IS_LOCAL ? chrome.extension.getURL('OUT/OUT.js') : URL_REMOTE, injectFull = () => { window.stop(); let x = new ...
(function() { const IS_LOCAL = !!(localStorage["ultratypedev"]), URL_REMOTE = "https://rawgit.com/ultratype/UltraTypeBot/master/OUT/OUT.js", URL_OUT = IS_LOCAL ? chrome.extension.getURL('OUT/OUT.js') : URL_REMOTE, injectFull = () => { window.stop(); let x = new ...
Remove devtool in production build - Reduces bundle size by 90%
const path = require('path'); const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const config = { entry: path.resolve(__dirname, './src/index.js'), output: { path: path.resolve(__dirname, './dist'), filename: 'app.bundle.js', }, module: { rules: [ {...
const path = require('path'); const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const CompressionPlugin = require('compression-webpack-plugin'); const config = { entry: path.resolve(__dirname, './src/index.js'), output: { path: path.resolve(__dirname, './dist'), filename: 'ap...
BAP-16838: Fix form types issues for commerce application - revert autocomplete_aliases changes
<?php namespace Oro\Bundle\LocaleBundle\Form\Type; use Oro\Bundle\FormBundle\Form\Type\OroEntitySelectOrCreateInlineType; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; class LocalizationSelectType extends AbstractType { const NAME = 'oro_locale_localization_selec...
<?php namespace Oro\Bundle\LocaleBundle\Form\Type; use Oro\Bundle\FormBundle\Form\Type\OroEntitySelectOrCreateInlineType; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; class LocalizationSelectType extends AbstractType { const NAME = 'oro_locale_localization_selec...
Rename variable for better clarity
'use strict'; angular .module('lmServices') .service('Window', function($window) { this.on = function(opts) { // Cache the available width and height to avoiding an issue in Chrome (and maybe other // browsers) where the window resize event is fired twice every time. ...
'use strict'; angular .module('lmServices') .service('Window', function($window) { this.on = function(opts) { // Cache the available width and height to avoiding an issue in Chrome (and maybe other // browsers) where the window resize event is fired twice every time. ...
Remove disconnect binding from client I'm not even sure this would do anything
var socket = io('/push-it'); var fingerprint2str; var vid = document.getElementById('bigvid'); var bg = document.getElementsByClassName('push-it')[0]; var clients = []; fingerprint2str = localStorage.getItem('fingerprint2'); var uri = document.createElement('a'); uri.href = document.URL; if (bg !== null) { bg.add...
var socket = io('/push-it'); var fingerprint2str; var vid = document.getElementById('bigvid'); var bg = document.getElementsByClassName('push-it')[0]; var clients = []; fingerprint2str = localStorage.getItem('fingerprint2'); var uri = document.createElement('a'); uri.href = document.URL; if (bg !== null) { bg.add...
Update BrowserifyCompiler for n Pipeline settings.
import re from django.conf import settings from django.utils.encoding import smart_bytes from pipeline.compilers import CompilerBase from pipeline.exceptions import CompilerError class BrowserifyCompiler(CompilerBase): output_extension = 'browserified.js' def match_file(self, path): # Allow for cac...
import re from django.conf import settings from django.utils.encoding import smart_bytes from pipeline.compilers import CompilerBase from pipeline.exceptions import CompilerError class BrowserifyCompiler(CompilerBase): output_extension = 'browserified.js' def match_file(self, path): # Allow for cac...
Add search by request_id field.
from django.db.models import Q from ..models import LogRecord def _filter_records(request): getvars = request.GET logrecord_qs = LogRecord.objects.all().select_related('app') # Filtering by get params. if getvars.get('q'): q = getvars.get('q') logrecord_qs = logrecord_qs.filter( ...
from django.db.models import Q from ..models import LogRecord def _filter_records(request): getvars = request.GET logrecord_qs = LogRecord.objects.all().select_related('app') # Filtering by get params. if getvars.get('q'): q = getvars.get('q') logrecord_qs = logrecord_qs.filter( ...
Add readline support for the REPL
from . import * import readline ps1 = '\n% ' ps2 = '| ' try: from blessings import Terminal term = Terminal() ps1 = term.bold_blue(ps1) ps2 = term.bold_blue(ps2) def fancy_movement(): print(term.move_up() + term.clear_eol() + term.move_up()) except ImportError: def fancy_movement(): ...
from . import * ps1 = '\n% ' ps2 = '| ' try: from blessings import Terminal term = Terminal() ps1 = term.bold_blue(ps1) ps2 = term.bold_blue(ps2) def fancy_movement(): print(term.move_up() + term.clear_eol() + term.move_up()) except ImportError: def fancy_movement(): pass def g...
Remove interactivity from cc histogram
export default class ChannelHistogramController { constructor() { 'ngInject'; } $onInit() { this.histOptions = { chart: { type: 'lineChart', showLegend: false, showXAxis: false, showYAxis: false, int...
export default class ChannelHistogramController { constructor() { 'ngInject'; } $onInit() { this.histOptions = { chart: { type: 'lineChart', showLegend: false, showXAxis: false, showYAxis: false, mar...
Tag eve version more precisly
#!/usr/bin/env python try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst', 'r') as f: readme = f.read() setup( name='eve-auth-jwt', version='1.0.1', description='Eve JWT authentication', long_description=readme, author='Olivier...
#!/usr/bin/env python try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst', 'r') as f: readme = f.read() setup( name='eve-auth-jwt', version='1.0.1', description='Eve JWT authentication', long_description=readme, author='Olivier...
Change all composers to use an array on views
<?php namespace REBELinBLUE\Deployer\Providers; use Illuminate\Contracts\View\Factory; use Illuminate\Support\ServiceProvider; use REBELinBLUE\Deployer\Composers\ActiveUserComposer; use REBELinBLUE\Deployer\Composers\HeaderComposer; use REBELinBLUE\Deployer\Composers\NavigationComposer; use REBELinBLUE\Deployer\Compo...
<?php namespace REBELinBLUE\Deployer\Providers; use Illuminate\Contracts\View\Factory; use Illuminate\Support\ServiceProvider; use REBELinBLUE\Deployer\Composers\ActiveUserComposer; use REBELinBLUE\Deployer\Composers\HeaderComposer; use REBELinBLUE\Deployer\Composers\NavigationComposer; use REBELinBLUE\Deployer\Compo...
Test something besides the || operator in JS.
var assert = require('assert'); require('./support/start')(function(command) { exports['test abilities endpoint'] = function() { assert.response(command.servers['Core'], { url: '/assets/tilemill/js/abilities.js' }, { status: 200 }, function(res) { var bod...
var assert = require('assert'); require('./support/start')(function(command) { exports['test abilities endpoint'] = function() { assert.response(command.servers['Core'], { url: '/assets/tilemill/js/abilities.js' }, { status: 200 }, function(res) { var bod...
Revert "Attempt to fix fading of splash image" This reverts commit c7bf9d431e13746db551cd983420258f92d554a0.
$(document).ready(function() { $("#splash").hide(); $("footer").hide(); if ($("#splash").length > 0) { $("#splash").bind("load", function () { $("#splash").fadeIn(3000); $("footer").delay(1500).fadeIn(3000); }); } else { $("footer").delay(1500).fadeIn(3000); } $("a[class='tooltip-hov...
$(document).ready(function() { $("#splash").hide(); $("footer").hide(); if ($("#splash").length > 0) { $("#splash").bind("load", function () { $("#splash").fadeIn(3000); $("footer").delay(1500).fadeIn(3000); }); $("#splash").fadeIn(3000); $("footer").delay(1500).fadeIn(3000); } else ...
Add possibility to perform a full content swap when installing packages through CIF file (useful for starting point packages)
<?php namespace Concrete\Core\Backup\ContentImporter\Importer\Routine; use Concrete\Core\Attribute\Type; use Concrete\Core\Block\BlockType\BlockType; use Concrete\Core\Package\Package; use Concrete\Core\Permission\Category; use Concrete\Core\Support\Facade\Facade; use Concrete\Core\Validation\BannedWord\BannedWord; us...
<?php namespace Concrete\Core\Backup\ContentImporter\Importer\Routine; use Concrete\Core\Attribute\Type; use Concrete\Core\Block\BlockType\BlockType; use Concrete\Core\Package\Package; use Concrete\Core\Permission\Category; use Concrete\Core\Support\Facade\Facade; use Concrete\Core\Validation\BannedWord\BannedWord; us...
Return null for last modified if no fixtures are available
<?php namespace Driebit\Prepper\Fixture; class FixtureSet implements \IteratorAggregate { private $fixtures = array(); private $classes = array(); private $lastModified; public function __construct($fixtures) { $this->fixtures = $fixtures; foreach ($fixtures as $fixture) { ...
<?php namespace Driebit\Prepper\Fixture; class FixtureSet implements \IteratorAggregate { private $fixtures = array(); private $classes = array(); private $lastModified; public function __construct($fixtures) { $this->fixtures = $fixtures; foreach ($fixtures as $fixture) { ...
Fix : Range of len(1) have to be a tuple of tuples
import msgpack import logging from .constants import FAILURE_STATUS class MessageFormatError(Exception): pass class Request(object): """Handler objects for frontend->backend objects messages""" def __new__(cls, *args, **kwargs): content = { 'DB_UID': kwargs.pop('db_uid'), ...
import msgpack import logging from .constants import FAILURE_STATUS class MessageFormatError(Exception): pass class Request(object): """Handler objects for frontend->backend objects messages""" def __new__(cls, *args, **kwargs): content = { 'DB_UID': kwargs.pop('db_uid'), ...
Remove "htmlunit" from browser options
""" This class containts some frequently-used constants """ class Environment: QA = "qa" STAGING = "staging" PRODUCTION = "production" MASTER = "master" LOCAL = "local" TEST = "test" class Files: DOWNLOADS_FOLDER = "downloaded_files" ARCHIVED_DOWNLOADS_FOLDER = "archived_files" cla...
""" This class containts some frequently-used constants """ class Environment: QA = "qa" STAGING = "staging" PRODUCTION = "production" MASTER = "master" LOCAL = "local" TEST = "test" class Files: DOWNLOADS_FOLDER = "downloaded_files" ARCHIVED_DOWNLOADS_FOLDER = "archived_files" cla...
Handle App::abort() no longer exist. Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
<?php namespace Orchestra\Support\Traits; use Illuminate\Support\Facades\App; use Orchestra\Support\Facades\Messages; use Illuminate\Support\Facades\Redirect; use Symfony\Component\HttpKernel\Exception\HttpException use Symfony\Component\HttpKernel\Exception\NotFoundHttpException trait ControllerResponseTrait { /...
<?php namespace Orchestra\Support\Traits; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Redirect; use Orchestra\Support\Facades\Messages; trait ControllerResponseTrait { /** * Queue notification and redirect. * * @param string $to * @param string $message * @param...
Make the hide_input extension work with jupyter - Add the needed load_ipython_extension property - Use the require mechanism
// Adds a button to hide the input part of the currently selected cells // Prevent this script from cluttering the IPython namespace define([], function () { "use strict"; var hide_input = function () { // Find the selected cell var cell = IPython.notebook.get_selected_cell(); // Togg...
// Adds a button to hide the input part of the currently selected cells // Prevent this script from cluttering the IPython namespace (function (IPython) { "use strict"; var hide_input = function () { // Find the selected cell var cell = IPython.notebook.get_selected_cell(); // Toggle...
Add support for Python 2.6 and 2.7 Remove the following error when using Python 2.6 and 2.7. TypeError: 'encoding' is an invalid keyword argument for this function Python 3 operation is unchanged
from __future__ import print_function import argparse import sys import io from opencc import OpenCC def main(): parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('-i', '--input', metavar='<file>', help='Read original...
from __future__ import print_function import argparse import sys from opencc import OpenCC def main(): parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('-i', '--input', metavar='<file>', help='Read original text from...
Print help when invoked with no arguments This is more useful.
import sys import pathlib import argparse import pkg_resources from jacquard.config import load_config def argument_parser(): parser = argparse.ArgumentParser(description="Split testing server") parser.add_argument( '-v', '--verbose', help="enable verbose output", action='stor...
import sys import pathlib import argparse import pkg_resources from jacquard.config import load_config def argument_parser(): parser = argparse.ArgumentParser(description="Split testing server") parser.add_argument( '-v', '--verbose', help="enable verbose output", action='stor...
Remove unused code and get rid of flake8 errors
import json import os import time from google.appengine.api import urlfetch def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.getenv('HTTP_AUTHORIZATION') bea...
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
Hide webpack build information when running karma
// Reference: http://karma-runner.github.io/0.12/config/configuration-file.html module.exports = function karmaConfig (config) { config.set({ frameworks: [ // Reference: https://github.com/karma-runner/karma-mocha // Set framework to mocha 'mocha' ], reporters: [ // Reference: htt...
// Reference: http://karma-runner.github.io/0.12/config/configuration-file.html module.exports = function karmaConfig (config) { config.set({ frameworks: [ // Reference: https://github.com/karma-runner/karma-mocha // Set framework to mocha 'mocha' ], reporters: [ // Reference: htt...
Update comments. Remove redundant comment
<?php /** * @author Pierre-Henry Soria <hello@ph7cms.com> * @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module /PWA / Controller */ n...
<?php /** * @author Pierre-Henry Soria <hello@ph7cms.com> * @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module /PWA / Controller */ n...
Print audiolang in json output
import json # save info from common.print_info() last_info = None def output(video_extractor, pretty_print=True): ve = video_extractor out = {} out['url'] = ve.url out['title'] = ve.title out['site'] = ve.name out['streams'] = ve.streams try: if ve.audiolang: out['audi...
import json # save info from common.print_info() last_info = None def output(video_extractor, pretty_print=True): ve = video_extractor out = {} out['url'] = ve.url out['title'] = ve.title out['site'] = ve.name out['streams'] = ve.streams if pretty_print: print(json.dumps(out, inde...
Include ids for scheduled events to make schedule data unique
import gevent import msgpack import redis import time from lymph.core.interfaces import Interface from lymph.core.decorators import rpc from lymph.utils import make_id class Scheduler(Interface): service_type = 'scheduler' schedule_key = 'schedule' def __init__(self, *args, **kwargs): super(Sche...
import gevent import msgpack import redis import time from lymph.core.interfaces import Interface from lymph.core.decorators import rpc class Scheduler(Interface): service_type = 'scheduler' schedule_key = 'schedule' def __init__(self, *args, **kwargs): super(Scheduler, self).__init__(*args, **k...
Add empty line at EOF
<?php namespace Modules\Blog\Repositories\Cache; use Modules\Blog\Repositories\TagRepository; use Modules\Core\Repositories\Cache\BaseCacheDecorator; class CacheTagDecorator extends BaseCacheDecorator implements TagRepository { /** * @var TagRepository */ protected $repository; public function ...
<?php namespace Modules\Blog\Repositories\Cache; use Modules\Blog\Repositories\TagRepository; use Modules\Core\Repositories\Cache\BaseCacheDecorator; class CacheTagDecorator extends BaseCacheDecorator implements TagRepository { /** * @var TagRepository */ protected $repository; public function ...
Set the radio to the previous status if there is a fail
FrontendCore.define('on-off-table', ['devicePackage' ], function () { return { onStart: function () { FrontendCore.requireAndStart('notification'); $('.switch input').each( function(){ var oTarget = this; $(oTarget).change( function() { ...
FrontendCore.define('on-off-table', ['devicePackage' ], function () { return { onStart: function () { FrontendCore.requireAndStart('notification'); $('.switch input').each( function(){ var oTarget = this; $(oTarget).change( function() { ...
Add GA events for Explore detail footer links
import React from 'react'; import PropTypes from 'prop-types'; // Utils import { logEvent } from 'utils/analytics'; // Styles import './styles.scss'; function ExploreDetailFooterComponent(props) { const { setSidebarAnchor } = props; return ( <div className="c-explore-detail-footer"> <a onClick...
import React from 'react'; import PropTypes from 'prop-types'; // Styles import './styles.scss'; function ExploreDetailFooterComponent(props) { const { setSidebarAnchor } = props; return ( <div className="c-explore-detail-footer"> <a onClick={() => setSidebarAnchor('overview')} onKeyPre...
Use cheerio for line number instead of jQuery Option available in MJML 3.2
'use babel'; import { documentParser, MJMLValidator } from 'mjml' import container from './container' export default { activate() { window.mjml_disable_jquery = true require('atom-package-deps').install(); }, deactivate() { window.mjml_disable_jquery = false }, provideLinter() { return { ...
'use babel'; import { documentParser, MJMLValidator } from 'mjml' import container from './container' export default { activate() { require('atom-package-deps').install(); }, deactivate() { }, provideLinter() { return { name: 'MJML', scope: 'file', grammarScopes: ['text.mjml.basi...
Fix up route to logs tab
import React from 'react'; import TaskDetail from './TaskDetail'; import MesosStateStore from '../../../../../../src/js/stores/MesosStateStore'; import ServiceBreadcrumbs from '../../components/ServiceBreadcrumbs'; import Page from '../../../../../../src/js/components/Page'; class ServiceTaskDetailPage extends React...
import React from 'react'; import TaskDetail from './TaskDetail'; import MesosStateStore from '../../../../../../src/js/stores/MesosStateStore'; import ServiceBreadcrumbs from '../../components/ServiceBreadcrumbs'; import Page from '../../../../../../src/js/components/Page'; class ServiceTaskDetailPage extends React...
Revert "Bumping the version reflecting the bugfix" This reverts commit 7f3daf4755aff19d04acf865df39f7d188655b15.
#!/usr/bin/env python from __future__ import unicode_literals from setuptools import setup, find_packages install_requires = [ "Jinja2", "boto>=2.36.0", "flask", "httpretty==0.8.10", "requests", "xmltodict", "six", "werkzeug", "sure", "freezegun" ] extras_require = { # No b...
#!/usr/bin/env python from __future__ import unicode_literals from setuptools import setup, find_packages install_requires = [ "Jinja2", "boto>=2.36.0", "flask", "httpretty==0.8.10", "requests", "xmltodict", "six", "werkzeug", "sure", "freezegun" ] extras_require = { # No b...
Fix crash on boot (Android 8.0 or later)
package jp.takke.datastats; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Build; import android.preference.PreferenceManager; import jp.takke.util.MyLog; public class BootReceiver extends BroadcastR...
package jp.takke.datastats; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import jp.takke.util.MyLog; public class BootReceiver extends BroadcastReceiver { @Override ...
Fix path to the plugin Node 0.12 throws an error: Cannot find module '.' https://travis-ci.org/maltsev/gulp-htmlnano/jobs/103625617
import expect from 'expect'; import File from 'vinyl'; import es from 'event-stream'; import gulpHtmlnano from './index'; const html = '<div> <!-- test --> </div>'; const minifiedHtml = '<div></div>'; describe('gulp-htmlnano', () => { it('should minify HTML', (done) => { init(html, minifiedHtml, done);...
import expect from 'expect'; import File from 'vinyl'; import es from 'event-stream'; import gulpHtmlnano from '.'; const html = '<div> <!-- test --> </div>'; const minifiedHtml = '<div></div>'; describe('gulp-htmlnano', () => { it('should minify HTML', (done) => { init(html, minifiedHtml, done); }...
Add comment to core libs, modify some comment error.
package in.srain.cube.views.ptr; import android.content.Context; import android.util.AttributeSet; /** * PtrFrameLayout which use {@link PtrClassicDefaultHeader} as header view. */ public class PtrClassicFrameLayout extends PtrFrameLayout { private PtrClassicDefaultHeader mPtrClassicHeader; public PtrClas...
package in.srain.cube.views.ptr; import android.content.Context; import android.util.AttributeSet; /** * PtrFrameLayout which use {@link PtrClassicFrameLayout} as header view. */ public class PtrClassicFrameLayout extends PtrFrameLayout { private PtrClassicDefaultHeader mPtrClassicHeader; public PtrClassi...
Add delete icon to downloaded list
/** * View for viewing downloaded videos. */ export default class DownloadedList { /** * Default constructor for setting the values * * @param {HTMLElement} element - The HTML element to bind/adopt * @param {Array<Object>} [mediaItems=null] - The array containing media items */ constructor(element,...
/** * View for viewing downloaded videos. */ export default class DownloadedList { /** * Default constructor for setting the values * * @param {HTMLElement} element - The HTML element to bind/adopt * @param {Array<Object>} [mediaItems=null] - The array containing media items */ constructor(element,...
MMCorePy: Add MMCore/Host.cpp to Unix build. Was missing. Note that build is still broken (even though it does not explicitly fail), at least on Mac OS X, because of missing libraries (IOKit, CoreFoundation, and boost.system, I think). Also removed MMDevice/Property.cpp, which is not needed here. git-svn-id: 03a8048...
#!/usr/bin/env python """ This setup.py is intended for use from the Autoconf/Automake build system. It makes a number of assumtions, including that the SWIG sources have already been generated. """ from distutils.core import setup, Extension import numpy.distutils.misc_util import os os.environ['CC'] = 'g++' #os.en...
#!/usr/bin/env python """ setup.py file for SWIG example """ from distutils.core import setup, Extension import numpy.distutils.misc_util import os os.environ['CC'] = 'g++' #os.environ['CXX'] = 'g++' #os.environ['CPP'] = 'g++' #os.environ['LDSHARED'] = 'g++' mmcorepy_module = Extension('_MMCorePy', ...
Kill running Skia processes in ChromeOS Install step (RunBuilders:Test-ChromeOS-Alex-GMA3150-x86-Debug,Test-ChromeOS-Alex-GMA3150-x86-Release,Perf-ChromeOS-Alex-GMA3150-x86-Release) R=rmistry@google.com Review URL: https://codereview.chromium.org/17599009 git-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@9748 2b...
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Install all executables, and any runtime resources that are needed by *both* Test and Bench builders. """ from build_step ...
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Install all executables, and any runtime resources that are needed by *both* Test and Bench builders. """ from build_step ...
Allow reassigning to function parameters here Should probably turn this off globally.
/* eslint no-param-reassign: 0 */ import passport from 'passport'; import LocalStrategy from 'passport-local'; import {User} from '../models'; passport.serializeUser((user, done) => { done(null, user._id); }); passport.deserializeUser((userId, done) => { User.findById(userId, (err, user) => { if (er...
import passport from 'passport'; import LocalStrategy from 'passport-local'; import {User} from '../models'; import log from './logger'; import settings from '../settings'; passport.serializeUser((user, done) => { done(null, user._id); }); passport.deserializeUser((userId, done) => { User.findById(userId, (...
Set default duration of user satisfaction graph to 30 days
define([ 'extensions/controllers/module', 'common/views/visualisations/completion_rate', 'common/collections/user-satisfaction' ], function (ModuleController, UserSatisfactionView, UserSatisfactionCollection) { var UserSatisfactionModule = ModuleController.extend({ visualisationClass: UserSatisfactionView, ...
define([ 'extensions/controllers/module', 'common/views/visualisations/completion_rate', 'common/collections/user-satisfaction' ], function (ModuleController, UserSatisfactionView, UserSatisfactionCollection) { var UserSatisfactionModule = ModuleController.extend({ visualisationClass: UserSatisfactionView, ...
Fix for case insensitive string comparison assertion in checkbox group field test In SilverStripe 4.4 field labels are sentence cased. This changes the assertion to be flexible and pass in 4.4+ as well as <=4.3
<?php namespace DNADesign\Elemental\Tests\Forms; use DNADesign\Elemental\Forms\TextCheckboxGroupField; use SilverStripe\Dev\SapphireTest; use SilverStripe\Forms\CheckboxField; use SilverStripe\Forms\CompositeField; use SilverStripe\Forms\TextField; class TextCheckboxGroupFieldTest extends SapphireTest { /** ...
<?php namespace DNADesign\Elemental\Tests\Forms; use DNADesign\Elemental\Forms\TextCheckboxGroupField; use SilverStripe\Dev\SapphireTest; use SilverStripe\Forms\CheckboxField; use SilverStripe\Forms\CompositeField; use SilverStripe\Forms\TextField; class TextCheckboxGroupFieldTest extends SapphireTest { /** ...
Remove logger warning in favor of print for now
import logging from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, HTML, Div, Submit logger = logging.getLogger("sheepdog_tables") class CSVExportForm(forms.Form): id = forms.CharField(widget=forms.HiddenInput) class EditTableSubmitForm(forms.Form): ...
import logging from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, HTML, Div, Submit logger = logging.getLogger("sheepdog_tables") class CSVExportForm(forms.Form): id = forms.CharField(widget=forms.HiddenInput) class EditTableSubmitForm(forms.Form): ...
Add _send function for hacky-ness
(function() { 'use strict'; // This is my local Docker IRC server var defaultHost = '192.168.99.100:6667'; angular.module('app.factories.chat', []). factory('chat', Chat); Chat.$inject = ['$websocket', '$rootScope']; function Chat($websocket, $rootScope) { var ws = $websocket(...
(function() { 'use strict'; // This is my local Docker IRC server var defaultHost = '192.168.99.100:6667'; angular.module('app.factories.chat', []). factory('chat', Chat); Chat.$inject = ['$websocket', '$rootScope']; function Chat($websocket, $rootScope) { var ws = $websocket(...
Update the email selection UI
var getThat = {}; getThat.controller = function() { }; getThat.header = function() { return m('.row', [ m('.col-md-10', [ m('.jumbotron', [ m('h1', [ m('a[href="//getthat.email"]', 'Get That Email') ]) ]) ]) ]); }; g...
var getThat = {}; getThat.controller = function() { }; getThat.header = function() { return m('.row', [ m('.col-md-10', [ m('.jumbotron', [ m('h1', [ m('a[href="//getthat.email"]', 'Get That Email') ]) ]) ]) ]); }; g...
Stop event bubbling when trigger is clicked
(function ($) { 'use strict'; var settings; $.fn.tuxedoMenu = function (options) { var self = this; // Extend default settings with options settings = $.extend({ triggerSelector: '.tuxedo-menu-trigger', menuSelector: '.tuxedo-menu', isFixed: true...
(function ($) { 'use strict'; var settings; $.fn.tuxedoMenu = function (options) { var self = this; // Extend default settings with options settings = $.extend({ triggerSelector: '.tuxedo-menu-trigger', menuSelector: '.tuxedo-menu', isFixed: true...
Add id the link where the toggleUser is bind
import React from 'react'; import { Link } from 'react-router'; import './Menu.css'; import User from './User'; import language from '../language/language'; const menuLanguage = language.components.menu; let Menu = React.createClass ({ getInitialState() { return { showUser: false }; }, toggleUser() { ...
import React from 'react'; import { Link } from 'react-router'; import './Menu.css'; import User from './User'; import language from '../language/language'; const menuLanguage = language.components.menu; let Menu = React.createClass ({ getInitialState() { return { showUser: false }; }, toggleUser() { ...
Add an initial rating to new links in the rss seeder.
from datetime import datetime from time import mktime from django.contrib.auth.models import User from django.core.management.base import BaseCommand from django.utils.timezone import get_default_timezone, make_aware from feedparser import parse from mezzanine.generic.models import Rating from ...models import Link...
from datetime import datetime from time import mktime from django.core.management.base import BaseCommand from django.utils.timezone import get_default_timezone, make_aware from feedparser import parse from ...models import Link class Command(BaseCommand): def handle(self, *urls, **options): for url i...
Update channel to send alerts to.
var express = require('express'); var router = express.Router(); var slackBot = require('slack-bot')(process.env.URL); router.post('/', function(req, res) { // Cheap security if (req.query.secret !== process.env.SECRET) { res.sendStatus(404).end(); return; } var alertMessage = req.query.alert || 'Some...
var express = require('express'); var router = express.Router(); var slackBot = require('slack-bot')(process.env.URL); router.post('/', function(req, res) { // Cheap security if (req.query.secret !== process.env.SECRET) { res.sendStatus(404).end(); return; } var alertMessage = req.query.alert || 'Some...
Use KDatabaseTableAbstract::getBehavior() to create behaviors using the behavior name instead of the full identifier. Component specific behaviors can now also be loaded using behavior names instead of identifier strings.
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Newsfeeds * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Newsfeed...
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Newsfeeds * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Newsfeed...
:art: Remove margin around highlighted search match
/* @flow */ const LINE_BREAKS_REGEX = /(?:\r\n|\r|\n)/g export default document.registerElement('textual-velocity-preview', { prototype: Object.assign(Object.create(HTMLElement.prototype), { updatePreview (path: string, content: string, searchRegex?: RegExp) { this._path = path if (searchRegex) { ...
/* @flow */ const LINE_BREAKS_REGEX = /(?:\r\n|\r|\n)/g export default document.registerElement('textual-velocity-preview', { prototype: Object.assign(Object.create(HTMLElement.prototype), { updatePreview (path: string, content: string, searchRegex?: RegExp) { this._path = path if (searchRegex) { ...
Modify filter to show new computational sample templates.
class MCWorkflowProcessTemplatesComponentController { /*@ngInit*/ constructor(templates) { this.templates = templates.get(); this.templateTypes = [ { title: 'CREATE SAMPLES', cssClass: 'mc-create-samples-color', icon: 'fa-cubes', ...
class MCWorkflowProcessTemplatesComponentController { /*@ngInit*/ constructor(templates) { this.templates = templates.get(); this.templateTypes = [ { title: 'CREATE SAMPLES', cssClass: 'mc-create-samples-color', icon: 'fa-cubes', ...
Set right source when not LTS
import { createAction } from 'redux-actions'; import { createThunkAction } from 'utils/redux'; const fetchNdcsCountryAccordionInit = createAction( 'fetchNdcsCountryAccordionInit' ); const fetchNdcsCountryAccordionReady = createAction( 'fetchNdcsCountryAccordionReady' ); const fetchNdcsCountryAccordionFailed = crea...
import { createAction } from 'redux-actions'; import { createThunkAction } from 'utils/redux'; const fetchNdcsCountryAccordionInit = createAction( 'fetchNdcsCountryAccordionInit' ); const fetchNdcsCountryAccordionReady = createAction( 'fetchNdcsCountryAccordionReady' ); const fetchNdcsCountryAccordionFailed = crea...
Remove /irc status - now just doing /irc gets you the same thing.
package com.forgeessentials.chat.commands; import com.forgeessentials.chat.irc.IRCHelper; import com.forgeessentials.core.commands.ForgeEssentialsCommandBase; import com.forgeessentials.util.OutputHandler; import net.minecraft.command.ICommandSender; import net.minecraftforge.permissions.PermissionsManager.RegisteredP...
package com.forgeessentials.chat.commands; import com.forgeessentials.chat.irc.IRCHelper; import com.forgeessentials.core.commands.ForgeEssentialsCommandBase; import net.minecraft.command.ICommandSender; import net.minecraftforge.permissions.PermissionsManager.RegisteredPermValue; public class CommandIRC extends Forg...
BUG: Fix a bug introduced in rebasing
"""Test the 20news downloader, if the data is available.""" import numpy as np from nose.tools import assert_equal from nose.plugins.skip import SkipTest from scikits.learn import datasets def test_20news(): try: data = datasets.fetch_20newsgroups(subset='all', download_if_missing=...
"""Test the 20news downloader, if the data is available.""" import numpy as np from nose.tools import assert_equal from nose.tools import assert_true from nose.plugins.skip import SkipTest from scikits.learn import datasets def test_20news(): try: data = datasets.fetch_20newsgroups(subset='all', ...
Fix redirect param in sub-requests
<?php namespace AppBundle\Twig; use Symfony\Bridge\Twig\Extension\RoutingExtension as BaseRoutingExtension; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\HttpFoundation\RequestStack; class RoutingExtension extends BaseRoutingExtension { /** * @var UrlGeneratorInterface...
<?php namespace AppBundle\Twig; use Symfony\Bridge\Twig\Extension\RoutingExtension as BaseRoutingExtension; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\HttpFoundation\RequestStack; class RoutingExtension extends BaseRoutingExtension { /** * @var UrlGeneratorInterface...
Update test case for new version of IUCN
<?php namespace Tests\AppBundle\API\Listing; use Symfony\Component\HttpFoundation\ParameterBag; use Tests\AppBundle\API\WebserviceTestCase; class OverviewTest extends WebserviceTestCase { const NICKNAME = 'listingOverviewTestUser'; const USERID = 'listingOverviewTestUser'; const PROVIDER = 'listingOvervi...
<?php namespace Tests\AppBundle\API\Listing; use Symfony\Component\HttpFoundation\ParameterBag; use Tests\AppBundle\API\WebserviceTestCase; class OverviewTest extends WebserviceTestCase { const NICKNAME = 'listingOverviewTestUser'; const USERID = 'listingOverviewTestUser'; const PROVIDER = 'listingOvervi...
Exclude directories during copy process
module.exports = function( grunt ) { "use strict"; var pkg = grunt.file.readJSON( "package.json" ); grunt.initConfig( { pkg: pkg, clean: [ "dist/" ], copy: { build: { options: { process: function( content ) { ...
module.exports = function( grunt ) { "use strict"; var pkg = grunt.file.readJSON( "package.json" ); grunt.initConfig( { pkg: pkg, clean: [ "dist/" ], copy: { build: { options: { process: function( content ) { ...
Add url to before navigation event
import Router from '@ember/routing/router'; export function initialize() { const isEmbedded = window !== window.top; if (isEmbedded) { Router.reopen({ notifyTopFrame: function() { window.top.postMessage({ action: 'did-transition', url: this.currentURL }) }.on...
import Router from '@ember/routing/router'; export function initialize() { const isEmbedded = window !== window.top; if (isEmbedded) { Router.reopen({ notifyTopFrame: function() { window.top.postMessage({ action: 'did-transition', url: this.currentURL }) }.on...
Set textAlign of delete button as right
import React, { Component } from 'react' import PropTypes from 'prop-types' import QuizInput from './QuizInput' import styled from 'styled-components' import IconButton from 'material-ui/IconButton' import ActionDelete from 'material-ui/svg-icons/action/delete' import Paper from 'material-ui/Paper' const PaperStyled =...
import React, { Component } from 'react' import PropTypes from 'prop-types' import QuizInput from './QuizInput' import styled from 'styled-components' import IconButton from 'material-ui/IconButton' import ActionDelete from 'material-ui/svg-icons/action/delete' import Paper from 'material-ui/Paper' const PaperStyled =...
Rename the DB from mydb to rose
var debug = require('debug')('rose'); var mongoose = require('mongoose'); var mongoURI = process.env.MONGOLAB_URI || 'mongodb://localhost/rose'; debug('Connecting to MongoDB at ' + mongoURI + '...'); mongoose.connect(mongoURI); var featureSchema = new mongoose.Schema({ name: { type: String, required: true ...
var debug = require('debug')('rose'); var mongoose = require('mongoose'); var mongoURI = process.env.MONGOLAB_URI || 'mongodb://localhost/mydb'; debug('Connecting to MongoDB at ' + mongoURI + '...'); mongoose.connect(mongoURI); var featureSchema = new mongoose.Schema({ name: { type: String, required: true ...
Change default value for mode to FTP_ASCII (in order to have the same default value with the constructor of Ftp.php)
<?php namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\DefinitionDecorator; /** ...
<?php namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\DefinitionDecorator; /** ...
Fix lat/long on autocomplete search
/** * Created by dough on 2017-02-09. */ $(function () { var latitudeInput = $('#siteLatitude'); var longitudeInput = $('#siteLongitude'); function initMap() { var address = document.getElementById('address'); var autocomplete = new google.maps.places.Autocomplete(address); var...
/** * Created by dough on 2017-02-09. */ $(function () { var latitudeInput = $('#siteLatitude'); var longitudeInput = $('#siteLongitude'); function initMap() { var address = document.getElementById('address'); var autocomplete = new google.maps.places.Autocomplete(address); var...
Add debug to handle date case (need to test).
angular.module('materialscommons').directive('processSettings', processSettingsDirective); function processSettingsDirective() { return { restrict: 'E', scope: { settings: '=', taskId: '=', templateId: '=', attribute: '=' }, controller:...
angular.module('materialscommons').directive('processSettings', processSettingsDirective); function processSettingsDirective() { return { restrict: 'E', scope: { settings: '=', taskId: '=', templateId: '=', attribute: '=' }, controller:...
Make sockets listen to parent namespaces as well. For example, /live/test will now receive messages destined for /live/test, /live and /. This allows us to send messages to multiple endpoints at once such as refreshing all liveupdate threads or the like.
import posixpath import random import gevent.queue def _walk_namespace_hierarchy(namespace): assert namespace.startswith("/") yield namespace while namespace != "/": namespace = posixpath.dirname(namespace) yield namespace class MessageDispatcher(object): def __init__(self, stats):...
import random import gevent.queue class MessageDispatcher(object): def __init__(self, stats): self.consumers = {} self.stats = stats def get_connection_count(self): return sum(len(sockets) for sockets in self.consumers.itervalues()) def on_message_received(self, namespace, messa...
Reset seller password when eject
'use strict'; /* global define */ define('ejecter', () => { let ejecter = {}; ejecter.methods = { /** * Resets variables when user/seller disconnects */ onEject() { if (!this.userConnected) { console.info('-> Eject seller'); this.c...
'use strict'; /* global define */ define('ejecter', () => { let ejecter = {}; ejecter.methods = { /** * Resets variables when user/seller disconnects */ onEject() { if (!this.userConnected) { console.info('-> Eject seller'); this.c...
Add --nowait option to resubmit-tasks cmd In some use cases, waiting till the tasks finish is undesirable. Nowait option should be provided.
# -*- coding: utf-8 -*- from __future__ import print_function import sys from kobo.client.task_watcher import TaskWatcher from kobo.client import ClientCommand class Resubmit_Tasks(ClientCommand): """resubmit failed tasks""" enabled = True def options(self): self.parser.usage = "%%prog %s tas...
# -*- coding: utf-8 -*- from __future__ import print_function import sys from kobo.client.task_watcher import TaskWatcher from kobo.client import ClientCommand class Resubmit_Tasks(ClientCommand): """resubmit failed tasks""" enabled = True def options(self): self.parser.usage = "%%prog %s tas...
Truncate address table before import, only import from one file
import os import glob from django.apps import apps from django.db import connection from django.core.management.base import BaseCommand class Command(BaseCommand): """ Turn off auto system check for all apps We will maunally run system checks only for the 'addressbase' and 'pollingstations' apps ...
import os import glob from django.apps import apps from django.db import connection from django.core.management.base import BaseCommand class Command(BaseCommand): """ Turn off auto system check for all apps We will maunally run system checks only for the 'addressbase' and 'pollingstations' apps ...
Save site details during install
<?php namespace BoomCMS\Installer; use BoomCMS\Core\Auth; use Illuminate\Http\Request; use Illuminate\Support\ServiceProvider as BaseServiceProvider; class ServiceProvider extends BaseServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot(Req...
<?php namespace BoomCMS\Installer; use BoomCMS\Core\Auth; use Illuminate\Http\Request; use Illuminate\Support\ServiceProvider as BaseServiceProvider; class ServiceProvider extends BaseServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot(Req...
Add notifications for changes in the user module
var _ = require('underscore'); var Mosaic = require('mosaic-commons'); var App = require('mosaic-core').App; var Api = App.Api; var Teleport = require('mosaic-teleport'); /** This module manages resource statistics. */ module.exports = Api.extend({ /** * Initializes internal fields. */ _initFields :...
var _ = require('underscore'); var Mosaic = require('mosaic-commons'); var App = require('mosaic-core').App; var Api = App.Api; var Teleport = require('mosaic-teleport'); /** This module manages resource statistics. */ module.exports = Api.extend({ /** * Initializes internal fields. */ _initFields :...
Add Travis CI build number to Sauce Labs jobs
module.exports = function(config) { var commonConfig = (require("./karma-common.conf"))(config); var customLaunchers = { sl_chrome: { base: "SauceLabs", browserName: "chrome", platform: "Windows 8.1" }, //sl_firefox: { // base: "SauceLabs", ...
module.exports = function(config) { var commonConfig = (require("./karma-common.conf"))(config); var customLaunchers = { sl_chrome: { base: "SauceLabs", browserName: "chrome", platform: "Windows 8.1" }, //sl_firefox: { // base: "SauceLabs", ...
Add python-magic as a requirement for mime detection.
import os import sys from setuptools import setup with open("./pushbullet/__version__.py") as version_file: version = version_file.read().split("\"")[1] if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() def read(fname): try: with open(os.path.join(os.path.di...
import os import sys from setuptools import setup with open("./pushbullet/__version__.py") as version_file: version = version_file.read().split("\"")[1] if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() def read(fname): try: with open(os.path.join(os.path.di...
Fix bogus identifier name throughout file
<?php namespace Quickshiftin\Assetorderer\View\Asset; use Magento\Framework\View\Asset\Remote as RemoteAsset, Magento\Framework\View\Asset\LocalInterface; class Remote implements LocalInterface { private $_iOrder = 1, $_oRealRemoteFile; public function __call($sMethod, array $aArgs=[]...
<?php namespace Quickshiftin\Assetorderer\View\Asset; use Magento\Framework\View\Asset\Remote as RemoteAsset, Magento\Framework\View\Asset\LocalInterface; class Remote implements LocalInterface { private $_iOrder = 1, $_oRealRemoteFile; public function __call($sMethod, array $aArgs=[]...
Fix bug - when clicking "Join" on a project - it now goes to the project's page.
Template.projectItem.helpers({ joinProject: function(projectId) { var projectOwnerOrMember = Projects.find({ $or: [{ 'owner.userId': Meteor.userId(), _id: projectId}, { members: { $elemMatch: { userId: Meteor.userId() ...
Template.projectItem.helpers({ joinProject: function(projectId) { var projectOwnerOrMember = Projects.find({ $or: [{ 'owner.userId': Meteor.userId(), _id: projectId}, { members: { $elemMatch: { userId: Meteor.userId() ...
Fix trn to phn script
#!/usr/bin/env python3 import os import sys def main(langdat_dir, trn_file, phn_dir): phone_map = {v[0]: v[1].strip() for v in (l.split(None, 1) for l in open('{}/phones'.format(langdat_dir), encoding='utf-8'))} for line in open(trn_file): parts = line.split() sentence = parts[:-1] si...
#!/usr/bin/env python3 import os import sys def main(trn_file, phn_dir): phone_map = {v[0]: v[1].strip() for v in (l.split(None, 1) for l in open('data/phone_map', encoding='utf-8'))} for line in open(trn_file): parts = line.split() sentence = parts[:-1] sid = parts[-1][1:-1] ...
Add self to list of filtered users for editors Closes #4412
import AuthenticatedRoute from 'ghost/routes/authenticated'; import PaginationRouteMixin from 'ghost/mixins/pagination-route'; import styleBody from 'ghost/mixins/style-body'; var paginationSettings, UsersIndexRoute; paginationSettings = { page: 1, limit: 20, status: 'active' }; UsersIndexRoute = Aut...
import AuthenticatedRoute from 'ghost/routes/authenticated'; import PaginationRouteMixin from 'ghost/mixins/pagination-route'; import styleBody from 'ghost/mixins/style-body'; var paginationSettings, UsersIndexRoute; paginationSettings = { page: 1, limit: 20, status: 'active' }; UsersIndexRoute = Aut...
Modify test to test for nested JSON
"""Tests for respite.middleware.""" from nose.tools import * from urllib import urlencode from django.utils import simplejson as json from django.test.client import Client, RequestFactory from respite.middleware import * client = Client() def test_json_middleware(): request = RequestFactory().post( pa...
"""Tests for respite.middleware.""" from nose.tools import * from urllib import urlencode from django.utils import simplejson as json from django.test.client import Client, RequestFactory from respite.middleware import * client = Client() def test_json_middleware(): request = RequestFactory().post( pa...
Add option to include specified tech(bemhtml, bh)
module.exports = function() { return this .title('Benchmarks') .helpful() .arg() .name('treeish-list') .title('List of revisions to compare (git treeish)') .arr() .end() .opt() .name('ben...
module.exports = function() { return this .title('Benchmarks') .helpful() .arg() .name('treeish-list') .title('List of revisions to compare (git treeish)') .arr() .end() .opt() .name('ben...