text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix unit tests for python2
from rdflib import Graph, URIRef, Literal, BNode from rdflib.plugins.sparql import prepareQuery from rdflib.compare import isomorphic import unittest from nose.tools import eq_ class TestConstructInitBindings(unittest.TestCase): def test_construct_init_bindings(self): """ This is issue https://gi...
from rdflib import Graph, URIRef, Literal, BNode from rdflib.plugins.sparql import prepareQuery from rdflib.compare import isomorphic import unittest class TestConstructInitBindings(unittest.TestCase): def test_construct_init_bindings(self): """ This is issue https://github.com/RDFLib/rdflib/issu...
Fix error handling to show error messages We removed this during a refactor, but it means we get very generic messages in the UI instead of the actual error string.
"""Helpers for capturing requests exceptions.""" from functools import wraps from requests import RequestException, exceptions from via.exceptions import BadURL, UnhandledException, UpstreamServiceError REQUESTS_BAD_URL = ( exceptions.MissingSchema, exceptions.InvalidSchema, exceptions.InvalidURL, e...
"""Helpers for capturing requests exceptions.""" from functools import wraps from requests import RequestException, exceptions from via.exceptions import BadURL, UnhandledException, UpstreamServiceError REQUESTS_BAD_URL = ( exceptions.MissingSchema, exceptions.InvalidSchema, exceptions.InvalidURL, e...
Sort inheritance map written to file
package net.md_5.specialsource; import com.google.common.base.Joiner; import java.io.File; import java.io.PrintWriter; import java.util.*; public class InheritanceMap { private final Map<String, ArrayList<String>> inheritanceMap = new HashMap<String, ArrayList<String>>(); public void generate(List<IInherit...
package net.md_5.specialsource; import com.google.common.base.Joiner; import java.io.File; import java.io.PrintWriter; import java.util.*; public class InheritanceMap { private final Map<String, ArrayList<String>> inheritanceMap = new HashMap<String, ArrayList<String>>(); public void generate(List<IInherit...
Fix closure for team filteR
<?php namespace App\Nova\Filters; use App\Team; use Illuminate\Http\Request; use Laravel\Nova\Filters\Filter; class UserTeam extends Filter { /** * The filter's component. * * @var string */ public $component = 'select-filter'; /** * Apply the filter to the given query. * ...
<?php namespace App\Nova\Filters; use App\Team; use Illuminate\Http\Request; use Laravel\Nova\Filters\Filter; class UserTeam extends Filter { /** * The filter's component. * * @var string */ public $component = 'select-filter'; /** * Apply the filter to the given query. * ...
Fix delete free response subclass response deletion on rotation bug
package org.adaptlab.chpir.android.survey.QuestionFragments; import org.adaptlab.chpir.android.survey.QuestionFragment; import org.adaptlab.chpir.android.survey.R; import android.text.Editable; import android.text.TextWatcher; import android.view.ViewGroup; import android.widget.EditText; public class FreeResponseQu...
package org.adaptlab.chpir.android.survey.QuestionFragments; import org.adaptlab.chpir.android.survey.QuestionFragment; import org.adaptlab.chpir.android.survey.R; import android.text.Editable; import android.text.TextWatcher; import android.view.ViewGroup; import android.widget.EditText; public class FreeResponseQu...
Fix unescaped content in training progress description templatetag This template tag was using content from entry notes directly. In cases of some users this messed up the display of label in the templates.
from django import template from django.template.defaultfilters import escape from django.utils.safestring import mark_safe from workshops.models import TrainingProgress register = template.Library() @register.simple_tag def progress_label(progress): assert isinstance(progress, TrainingProgress) if progres...
from django import template from django.utils.safestring import mark_safe from workshops.models import TrainingProgress register = template.Library() @register.simple_tag def progress_label(progress): assert isinstance(progress, TrainingProgress) if progress.discarded: additional_label = 'default' ...
Fix class names in strings
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Flarum\Notification; use Flarum\Event\ConfigureNotificationTypes; use Flarum\Foundatio...
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Flarum\Notification; use Flarum\Event\ConfigureNotificationTypes; use Flarum\Foundatio...
Add classname prop to render
import React from 'react'; import cx from 'classnames'; import Col from './Col'; import Icon from './Icon'; class Navbar extends React.Component { constructor(props) { super(props); this.renderSideNav = this.renderSideNav.bind(this); } componentDidMount() { if ($ !== undefined) { $('.button-co...
import React from 'react'; import cx from 'classnames'; import Col from './Col'; import Icon from './Icon'; class Navbar extends React.Component { constructor(props) { super(props); this.renderSideNav = this.renderSideNav.bind(this); } componentDidMount() { if ($ !== undefined) { $('.button-co...
Test blank keys are not allowed.
from document import Document import unittest class TestDocument(unittest.TestCase): def _get_document(self): spec = { "author": "John Humphreys", "content": { "title": "How to make cookies", "text": "First start by pre-heating the oven..." ...
from document import Document import unittest class TestDocument(unittest.TestCase): def _get_document(self): spec = { "author": "John Humphreys", "content": { "title": "How to make cookies", "text": "First start by pre-heating the oven..." ...
BAP-15687: Test and merge - fixed failed builds
<?php namespace Oro\Bundle\DataAuditBundle\EventListener; use Oro\Bundle\DataAuditBundle\Provider\AuditConfigProvider; use Oro\Bundle\EntityBundle\Event\EntityStructureOptionsEvent; use Oro\Bundle\EntityBundle\Model\EntityStructure; class EntityStructureOptionsListener { const OPTION_NAME = 'auditable'; /**...
<?php namespace Oro\Bundle\DataAuditBundle\EventListener; use Oro\Bundle\DataAuditBundle\Provider\AuditConfigProvider; use Oro\Bundle\EntityBundle\Event\EntityStructureOptionsEvent; use Oro\Bundle\EntityBundle\Model\EntityStructure; class EntityStructureOptionsListener { const OPTION_NAME = 'auditable'...
Revert thumbnail URL change as it costs too much bandwidth for 52Poké
<?php /** * Lazyload class */ class Lazyload { public static function LinkerMakeExternalImage(&$url, &$alt, &$img) { global $wgRequest; if (defined('MW_API') && $wgRequest->getVal('action') === 'parse') return true; $url = preg_replace('/^(http|https):/', '', $url); $img = '<span ...
<?php /** * Lazyload class */ class Lazyload { public static function LinkerMakeExternalImage(&$url, &$alt, &$img) { global $wgRequest; if (defined('MW_API') && $wgRequest->getVal('action') === 'parse') return true; $url = preg_replace('/^(http|https):/', '', $url); $img = '<span ...
Add Framework :: Pelican :: Plugins classifer for PyPI
#!/usr/bin/env python import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='pelican-extended-sitemap', description='sitemap generator plugin for pelican', # @see http://semver.org/ version='1.2.3', author='...
#!/usr/bin/env python import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='pelican-extended-sitemap', description='sitemap generator plugin for pelican', # @see http://semver.org/ version='1.2.3', author='...
Add 'image' to the attrs for VersionDetails
from core.models import ApplicationVersion as ImageVersion from rest_framework import serializers from api.v2.serializers.summaries import ( LicenseSummarySerializer, UserSummarySerializer, IdentitySummarySerializer, ImageSummarySerializer, ImageVersionSummarySerializer) from api.v2.serializers.fiel...
from core.models import ApplicationVersion as ImageVersion from rest_framework import serializers from api.v2.serializers.summaries import ( LicenseSummarySerializer, UserSummarySerializer, IdentitySummarySerializer, ImageVersionSummarySerializer) from api.v2.serializers.fields import ProviderMachineRel...
Remove _getRequestSID function and simplified the if statement in _checkAuthentication()
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class MY_Controller extends CI_Controller { public function __construct() { parent::__construct(); // save whole request to data property $_POST = (array)json_decode(file_get_contents('php://input')); } /** ...
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class MY_Controller extends CI_Controller { public function __construct() { parent::__construct(); // save whole request to data property $_POST = (array)json_decode(file_get_contents('php://input')); } /** ...
Use let instead of var. Fix indentation
'use strict' const mongoose = require('mongoose'); const users = JSON.parse(require('fs').readFileSync(__dirname + '/users.json')); const domains = JSON.parse(require('fs').readFileSync(__dirname + '/domains.json')); if (mongoose.connection.readyState === 0) { mongoose.connect('mongodb://localhost/test'); } let domai...
'use strict' const mongoose = require('mongoose'); const users = JSON.parse(require('fs').readFileSync(__dirname + '/users.json')); const domains = JSON.parse(require('fs').readFileSync(__dirname + '/domains.json')); if (mongoose.connection.readyState === 0) { mongoose.connect('mongodb://localhost/test'); } let domai...
Revert "Allow Django Evolution to install along with Django >= 1.7." This reverts commit 28b280bb04f806f614f6f2cd25ce779b551fef9e. This was committed to the wrong branch.
#!/usr/bin/env python # # Setup script for Django Evolution from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from setuptools.command.test import test from django_evolution import get_package_version, VERSION def run_tests(*args): import os os.system('tests/ru...
#!/usr/bin/env python # # Setup script for Django Evolution from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from setuptools.command.test import test from django_evolution import get_package_version, VERSION def run_tests(*args): import os os.system('tests/ru...
Fix output error in make migration command.
<?php namespace Yarak\Commands; use Yarak\Config\Config; use Yarak\Migrations\MigrationCreator; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class MakeMigra...
<?php namespace Yarak\Commands; use Yarak\Config\Config; use Yarak\Migrations\MigrationCreator; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class MakeMigra...
Use correct GitHub header name when checking requests
'use strict'; const childProcess = require('child-process-promise'); const express = require('express'); const path = require('path'); const fs = require('fs'); const configPath = path.resolve(process.cwd(), process.argv.slice().pop()); const config = JSON.parse(fs.readFileSync(configPath, 'utf8')); const app = expre...
'use strict'; const childProcess = require('child-process-promise'); const express = require('express'); const path = require('path'); const fs = require('fs'); const configPath = path.resolve(process.cwd(), process.argv.slice().pop()); const config = JSON.parse(fs.readFileSync(configPath, 'utf8')); const app = expre...
Revert the removal of an unused import (in [14175]) that was referenced in documentation. Thanks for noticing, clong. git-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@14359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInli...
from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInline from django.contrib.admin.sites import AdminSite, site def autodiscover(): """ Auto-discover INSTALLED_APPS admin.py modules and fail silently when not present. T...
Add Logs + API Server Key Android notification
var gcm = require('node-gcm'); exports.sendNotification = function(db, title, messageNotif) { db.serialize(function() { db.all("SELECT notification_id from notification_client", function(err, results){ if(err) { console.log('Error while getting notifications clients : ' + err); ...
var gcm = require('node-gcm'); exports.sendNotification = function(db, title, messageNotif) { db.serialize(function() { db.all("SELECT notification_id from notification_client", function(err, results){ if(err) { // TODO log error return; } ...
Make code compatible with PHP < 8
<?php declare(strict_types = 1); namespace Rebing\GraphQL\Tests\Unit\Console; use Rebing\GraphQL\Console\SchemaConfigMakeCommand; use Rebing\GraphQL\Tests\Support\Traits\MakeCommandAssertionTrait; use Rebing\GraphQL\Tests\TestCase; class SchemaConfigMakeCommandTest extends TestCase { use MakeCommandAssertionTrai...
<?php declare(strict_types = 1); namespace Rebing\GraphQL\Tests\Unit\Console; use Rebing\GraphQL\Console\SchemaConfigMakeCommand; use Rebing\GraphQL\Tests\Support\Traits\MakeCommandAssertionTrait; use Rebing\GraphQL\Tests\TestCase; class SchemaConfigMakeCommandTest extends TestCase { use MakeCommandAssertionTrai...
Make the usermode +i check for WHO slightly neater.
from txircd.modbase import Mode class InvisibleMode(Mode): def namesListEntry(self, recipient, channel, user, representation): if channel.name not in recipient.channels and "i" in user.mode: return "" return representation def checkWhoVisible(self, user, targetUser, filters, fi...
from txircd.modbase import Mode class InvisibleMode(Mode): def namesListEntry(self, recipient, channel, user, representation): if channel.name not in recipient.channels and "i" in user.mode: return "" return representation def checkWhoVisible(self, user, targetUser, filters, fi...
Fix for python 2.6 support
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import division, absolute_import, with_statement, print_function, unicode_literals try: import m...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import division, absolute_import, with_statement, print_function, unicode_literals try: import m...
Remove reference to "job" from ThreadPool
import queue import threading from multiprocessing import Queue class ThreadPool(): def __init__(self, processes=20): self.processes = processes self.threads = [Thread() for _ in range(0, processes)] self.mp_queue = Queue() def yield_dead_threads(self): for thread in self.thr...
import queue import threading from multiprocessing import Queue class ThreadPool(): def __init__(self, processes=20): self.processes = processes self.threads = [Thread() for _ in range(0, processes)] self.mp_queue = Queue() def yield_dead_threads(self): for thread in self.thr...
Remove usage of unused package in npmalerets.js
'use strict'; var github = require('./github'); var npm = require('./npm'); var db = require('./db'); var email = require('./email'); var _ = require('underscore'); var cache = {}; var yesterday = new Date(); yesterday.setDate(yesterday.getDate() - 1); npm.getLatestPackages(yesterday, function(error, packages) { ...
'use strict'; var github = require('./github'); var npm = require('./npm'); var db = require('./db'); var email = require('./email'); var semver = require('semver'); var _ = require('underscore'); var cache = {}; var yesterday = new Date(); yesterday.setDate(yesterday.getDate() - 1); npm.getLatestPackages(yesterd...
Remove check for network roaming
package org.mozilla.mozstumbler; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.util.Log; final class NetworkUtils { private static final String LOGTAG = NetworkUtils.class.getName(); private NetworkUtils() { } @SuppressWarnings...
package org.mozilla.mozstumbler; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.util.Log; final class NetworkUtils { private static final String LOGTAG = NetworkUtils.class.getName(); private NetworkUtils() { } @SuppressWarnings...
Fix location of URL definition
"use strict"; const RequestResults = require("../constants/RequestResults"); const Utils = require("../utils/Utils"); let _token = null; let _requester = null; module.exports = { initialize: function(token, requester) { Utils.assertValidToken(token); Utils.assertValidRequester(requester); ...
"use strict"; const RequestResults = require("../constants/RequestResults"); const Utils = require("../utils/Utils"); let _token = null; let _requester = null; module.exports = { initialize: function(token, requester) { Utils.assertValidToken(token); Utils.assertValidRequester(requester); ...
Add lang, enviro in request
# -*- coding: utf-8 -*- import logging from icebergsdk.mixins.request_mixin import IcebergRequestBase logger = logging.getLogger('icebergsdk.frontmodules') class FrontModules(IcebergRequestBase): cache_key = "icebergsdk:frontmodule:data" cache_expire = 60*60 # one hour def __init__(self, *args, **kwargs...
# -*- coding: utf-8 -*- import logging from icebergsdk.mixins.request_mixin import IcebergRequestBase logger = logging.getLogger('icebergsdk.frontmodules') class FrontModules(IcebergRequestBase): cache_key = "icebergsdk:frontmodule:data" cache_expire = 60*60 # one hour def __init__(self, *args, **kwargs...
Fix indentation and es6 support
window.c.AdminNotificationHistory = ((m, h, _, models) => { return { controller: (args) => { const notifications = m.prop([]), getNotifications = (user) => { let notification = models.notification; notification.getPageWithToken(m.postgrest....
window.c.AdminNotificationHistory = ((m, h, _, models) => { return { controller: (args) => { const notifications = m.prop([]), getNotifications = (user) => { let notification = models.notification; notification.getPageWithToken(m.postgrest....
Increase to version 0.3.11 due to TG-dev requiring it for ming support
from setuptools import setup, find_packages import os version = '0.3.11' here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'README.txt')).read() CHANGES = open(os.path.join(here, 'docs/HISTORY.txt')).read() except IOError: README = CHANGES = '' setup(name='tgext.admin...
from setuptools import setup, find_packages import os version = '0.3.10' here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'README.txt')).read() CHANGES = open(os.path.join(here, 'docs/HISTORY.txt')).read() except IOError: README = CHANGES = '' setup(name='tgext.admin...
Add docs and update constructor signature
<?php namespace OpenDominion; use Illuminate\Foundation\Application as LaravelApplication; class Application extends LaravelApplication { protected $appPath; /** * Create a new OpenDominion application instance. * * @param string|null $basePath */ public function __construct($basePat...
<?php namespace OpenDominion; use Illuminate\Foundation\Application as LaravelApplication; class Application extends LaravelApplication { protected $appPath; public function __construct($basePath) { parent::__construct($basePath); $this->appPath = ($this->basePath() . DIRECTORY_SEPARATO...
Make test command clean up asynchornously
package ru.vyarus.dropwizard.guice.test; import io.dropwizard.Application; import io.dropwizard.Configuration; import io.dropwizard.cli.EnvironmentCommand; import io.dropwizard.setup.Environment; import net.sourceforge.argparse4j.inf.Namespace; import org.eclipse.jetty.util.component.ContainerLifeCycle; /** * Lightw...
package ru.vyarus.dropwizard.guice.test; import io.dropwizard.Application; import io.dropwizard.Configuration; import io.dropwizard.cli.EnvironmentCommand; import io.dropwizard.setup.Environment; import net.sourceforge.argparse4j.inf.Namespace; import org.eclipse.jetty.util.component.ContainerLifeCycle; /** * Lightw...
Change event listener on input
$(document).ready(function(){ $('.popup__toggle').on('click', popup); $('.filter-drawer__toggle').on('click', openFilterDrawer); $('.create-drawer__toggle').on('click', openCreateDrawer); function popup() { $('#popup').toggleClass("popup--open"); } function openFilterDrawer() { $...
$(document).ready(function(){ $('.popup__toggle').on('click', popup); $('.filter-drawer__toggle').on('click', openFilterDrawer); $('.create-drawer__toggle').on('click', openCreateDrawer); function popup() { $('#popup').toggleClass("popup--open"); } function openFilterDrawer() { $...
Remove webfont from 503 page
<!DOCTYPE html> <html> <head> <title>Be right back.</title> <style> html, body { height: 100%; } body { margin: 0; padding: 0; width: 100%; color: #B0BEC5; display: t...
<!DOCTYPE html> <html> <head> <title>Be right back.</title> <link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"> <style> html, body { height: 100%; } body { margin: 0; ...
Exclude tests directory from install
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='fabtools', version='0.1', description='Tools for writing awesome Fabric files', author='Ronan Amicel', a...
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='fabtools', version='0.1', description='Tools for writing awesome Fabric files', author='Ronan Amicel', a...
Add some options for prototype handler.
(function ($) { var methods = { init: function(options) { var settings = $.extend({ 'prototypePrefix': false, 'prototypeElementPrefix': '<hr />', 'containerSelector': false, }, options); return this.each(function() { ...
(function ($) { var methods = { init: function(options) { return this.each(function() { show($(this), false); $(this).change(function() { show($(this), true); }); function show(element, replace) { ...
Revert "fixed deleting repositories doenst always work" This reverts commit 81be538dfc24b1088959c9ae4e6d7aad31667897. The loop was ignored. See PR #54
'use strict'; /** * @ngdoc function * @name docker-registry-frontend.controller:DeleteRepositoryController * @description * # DeleteRepositoryController * Controller of the docker-registry-frontend */ angular.module('delete-repository-controller', ['registry-services']) .controller('DeleteRepositoryController'...
'use strict'; /** * @ngdoc function * @name docker-registry-frontend.controller:DeleteRepositoryController * @description * # DeleteRepositoryController * Controller of the docker-registry-frontend */ angular.module('delete-repository-controller', ['registry-services']) .controller('DeleteRepositoryController'...
Hide the Contract details when the selected point changes
angular.module("yds").controller("TrafficCountsController", ["$scope", "$timeout", "DashboardService", function ($scope, $timeout, DashboardService) { var scope = $scope; scope.galwayProjectId = "http://linkedeconomy.org/resource/Contract/AwardNotice/2013208591/5795646"; scope.lang = "en"; ...
angular.module("yds").controller("TrafficCountsController", ["$scope", "$timeout", "DashboardService", function ($scope, $timeout, DashboardService) { var scope = $scope; scope.galwayProjectId = "http://linkedeconomy.org/resource/Contract/AwardNotice/2013208591/5795646"; scope.lang = "en"; ...
Allow more dummy calls to ID Broker.
<?php namespace Sil\SilAuth\tests\fakes; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; use Psr\Log\LoggerInterface; use Sil\SilAuth\auth\Authenticator; use Sil\Idp\IdBroker\Client\IdBrokerClient; use Sil\SilAuth\auth\IdBroker; abstract class FakeIdBroker extends IdBroker { public function __con...
<?php namespace Sil\SilAuth\tests\fakes; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; use Psr\Log\LoggerInterface; use Sil\Idp\IdBroker\Client\IdBrokerClient; use Sil\SilAuth\auth\IdBroker; abstract class FakeIdBroker extends IdBroker { public function __construct( string $baseUri, ...
Hide the Invite button in topics in secured categories
/** This view is used for rendering the buttons at the footer of the topic @class TopicFooterButtonsView @extends Discourse.ContainerView @namespace Discourse @module Discourse **/ Discourse.TopicFooterButtonsView = Discourse.ContainerView.extend({ elementId: 'topic-footer-buttons', topicBinding: 'contro...
/** This view is used for rendering the buttons at the footer of the topic @class TopicFooterButtonsView @extends Discourse.ContainerView @namespace Discourse @module Discourse **/ Discourse.TopicFooterButtonsView = Discourse.ContainerView.extend({ elementId: 'topic-footer-buttons', topicBinding: 'contro...
Move variable assignment into function.
$(document).ready(function() { var locationPathName = location.pathname != '/' ? location.pathname : '/ruby/ruby/releases'; $(".top-nav a[href='" + locationPathName + "']").addClass('current'); $(".result-types-form input[type=radio]").change(function(value) { var $spinner = $(".spinner"); var xhr; ...
$(document).ready(function() { var locationPathName = location.pathname != '/' ? location.pathname : '/ruby/ruby/releases'; $(".top-nav a[href='" + locationPathName + "']").addClass('current'); var $spinner = $(".spinner"); var xhr; $(".result-types-form input[type=radio]").change(function(value) { // h...
Update contribution comment for collate
package seedu.bulletjournal.logic.parser; /** * Provides variations of commands Note: hard-coded for v0.2, will implement nlp * for future versions * @@author A0127826Y */ public class FlexibleCommand { private String commandFromUser = ""; private String[] commandGroups = new String[] { "add a adds create...
package seedu.bulletjournal.logic.parser; /** * Provides variations of commands Note: hard-coded for v0.2, will implement nlp * for future versions * @author A0127826Y */ public class FlexibleCommand { private String commandFromUser = ""; private String[] commandGroups = new String[] { "add a adds create ...
Add errorhandling for testforblock parser.
<?php namespace gries\MControl\Server\Command\ResponseParser; class TestForBlockParser implements ResponseParserInterface { /** * Get the Server response * * @param $response * * @return mixed Response could be a string or an array */ public function getResponse($response) {...
<?php namespace gries\MControl\Server\Command\ResponseParser; class TestForBlockParser implements ResponseParserInterface { /** * Get the Server response * * @param $response * * @return mixed Response could be a string or an array */ public function getResponse($response) {...
Add notice about the license of the translation in the footer
<?php namespace Kenjis\TranslationTools\Modifier; use Kenjis\TranslationTools\Document; use Kenjis\TranslationTools\File; class AddCopyright { protected $targetLineRegExp; protected $copyright; public function __construct() { $this->targetLineRegExp = '!&copy; Copyright 2014 - 20\d\d, Britis...
<?php namespace Kenjis\TranslationTools\Modifier; use Kenjis\TranslationTools\Document; use Kenjis\TranslationTools\File; class AddCopyright { protected $targetLineRegExp; protected $copyright; public function __construct() { $this->targetLineRegExp = '!&copy; Copyright 2014 - 20\d\d, Britis...
Fix bug with exit button for single asset view.
@extends('layouts.main') @section ('breadcrumb') <a href="{{ url()->previous() }}"> <button type="button" class="btn round-btn pull-right c-yellow"> <i class="fa fa-times fa-lg" aria-hidden="true"></i> </button> </a> {!! Breadcrumbs::render('dynamic', $asset) !!} @endsection @s...
@extends('layouts.main') @section ('breadcrumb') <a href="{{ redirect()->back() }}"> <button type="button" class="btn round-btn pull-right c-yellow"> <i class="fa fa-times fa-lg" aria-hidden="true"></i> </button> </a> {!! Breadcrumbs::render('dynamic', $asset) !!} @endsection @...
Correct shebang to use /usr/bin/env node. /bin/env is not the usual location for the shebang line. Instead use /usr/bin/env.
#!/usr/bin/env node 'use strict'; var agent = require('superagent'); var program = require('commander'); var semver = require('semver'); var name, version; program .version(require('./package.json').version) .arguments('<name> <version>') .action(function (name_, version_) { name = name_; ...
#!/bin/env node 'use strict'; var agent = require('superagent'); var program = require('commander'); var semver = require('semver'); var name, version; program .version(require('./package.json').version) .arguments('<name> <version>') .action(function (name_, version_) { name = name_; ve...
Access individual middleware through aggregating module
/* * Copyright (c) 2015-2017 Steven Soloff * * This is free software: you can redistribute it and/or modify it under the * terms of the MIT License (https://opensource.org/licenses/MIT). * This software comes with ABSOLUTELY NO WARRANTY. */ 'use strict' const middleware = require('../../../src/server/middleware...
/* * Copyright (c) 2015-2017 Steven Soloff * * This is free software: you can redistribute it and/or modify it under the * terms of the MIT License (https://opensource.org/licenses/MIT). * This software comes with ABSOLUTELY NO WARRANTY. */ 'use strict' const correlationId = require('../../../src/server/middlew...
Fix broken tiles (dev bug only).
package com.carpentersblocks.entity.item; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import com.carpentersblocks.util.protection.IProtected; import com.carpentersblocks.util.protection.ProtectedObject; ...
package com.carpentersblocks.entity.item; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import com.carpentersblocks.util.protection.IProtected; import com.carpentersblocks.util.protection.ProtectedObject; ...
Fix missing testSchema in package
#!/usr/bin/env python # -*- coding: utf-8 -*- import uuid from pip.req import parse_requirements from setuptools import setup, find_packages requirements = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs = [str(ir.req) for ir in requirements] readme = open('README.rst').read() setup(name='nuts', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import uuid from pip.req import parse_requirements from setuptools import setup, find_packages requirements = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs = [str(ir.req) for ir in requirements] readme = open('README.rst').read() setup(name='nuts', ...
Fix type: NoneType --> bool
# coding: utf-8 import logging import psutil from subprocess import PIPE class FfmpegProcess(object): def __init__(self): self._cmdline = None self._process = None self._paused = False def run(self): if not self._cmdline: logging.debug('cmdline is not yet defined')...
# coding: utf-8 import logging import psutil from subprocess import PIPE class FfmpegProcess(object): def __init__(self): self._cmdline = None self._process = None self._paused = False def run(self): if not self._cmdline: logging.debug('cmdline is not yet defined')...
Use urn from certificate to create username
''' Created on Aug 12, 2010 @author: jnaous ''' import logging import traceback from django.contrib.auth.backends import RemoteUserBackend from sfa.trust.gid import GID from expedient_geni.utils import get_user_urn, urn_to_username from geni.util.urn_util import URN logger = logging.getLogger("expedient_geni.backends...
''' Created on Aug 12, 2010 @author: jnaous ''' import logging import re from django.contrib.auth.backends import RemoteUserBackend from django.conf import settings from expedient.common.permissions.shortcuts import give_permission_to from django.contrib.auth.models import User logger = logging.getLogger("expedient_g...
Fix up detecting if Bundler is installed
import path from 'path'; import {statNoException} from '../promise-array'; import BuildDiscoverBase from '../build-discover-base'; import {findActualExecutable} from 'spawn-rx'; const d = require('debug')('surf:build-discover-npm'); export default class DangerBuildDiscoverer extends BuildDiscoverBase { constructor(...
import path from 'path'; import {statNoException} from '../promise-array'; import BuildDiscoverBase from '../build-discover-base'; import {findActualExecutable} from 'spawn-rx'; const d = require('debug')('surf:build-discover-npm'); export default class DangerBuildDiscoverer extends BuildDiscoverBase { constructor(...
Fix epom to not use encoded adm
package com.xrtb.exchanges; import java.io.InputStream; import com.xrtb.pojo.BidRequest; /** * A class to handle Epom ad exchange * @author Ben M. Faul * */ public class Epom extends BidRequest { public Epom() { super(); parseSpecial(); } /** ...
package com.xrtb.exchanges; import java.io.InputStream; import com.xrtb.pojo.BidRequest; /** * A class to handle Epom ad exchange * @author Ben M. Faul * */ public class Epom extends BidRequest { public Epom() { super(); parseSpecial(); } /** ...
Add organizer_name and organizer to guarded since they're generated, not actually columns
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Event extends Model { use SoftDeletes; protected $dates = [ 'created_at', 'updated_at', 'start_time', 'end_time' ]; /** * The attributes that are...
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Event extends Model { use SoftDeletes; protected $dates = [ 'created_at', 'updated_at', 'start_time', 'end_time' ]; /** * The attributes that are...
Make ExternalProgramService use async process from tornado
from tornado.process import Subprocess from tornado import gen from subprocess import PIPE from delivery.models.execution import ExecutionResult, Execution class ExternalProgramService(object): """ A service for running external programs """ @staticmethod def run(cmd): """ Run...
import subprocess import logging from delivery.models.execution import ExecutionResult, Execution log = logging.getLogger(__name__) class ExternalProgramService(object): """ A service for running external programs """ @staticmethod def run(cmd): """ Run a process and do not wai...
Create Database driver with configured Table name
<?php namespace IonutMilica\LaravelSettings; use IonutMilica\LaravelSettings\Drivers\Database; use IonutMilica\LaravelSettings\Drivers\Json; use IonutMilica\LaravelSettings\Drivers\Memory; use Illuminate\Support\Manager; class DriversManager extends Manager { /** * Get the default driver name. * * ...
<?php namespace IonutMilica\LaravelSettings; use IonutMilica\LaravelSettings\Drivers\Database; use IonutMilica\LaravelSettings\Drivers\Json; use IonutMilica\LaravelSettings\Drivers\Memory; use Illuminate\Support\Manager; class DriversManager extends Manager { /** * Get the default driver name. * * ...
Make readonly attributes to boolean methods
function Entry(key, ttlInMilliSeconds, cache) { if (!key) throw new Error('invalid cache key'); if (!ttlInMilliSeconds) throw new Error('invalid TTL'); if (!cache) throw new Error('invalid storage'); this.key = key; this.ttlInMilliSeconds = ttlInMilliSeconds; this.cache = cache; this.data =...
function Entry(key, ttlInMilliSeconds, cache) { if (!key) throw new Error('invalid cache key'); if (!ttlInMilliSeconds) throw new Error('invalid TTL'); if (!cache) throw new Error('invalid storage'); this.key = key; this.ttlInMilliSeconds = ttlInMilliSeconds; this.cache = cache; this.data =...
Fix log_error so it now catches exceptions * This got accidentally disabled
from .. util import class_name, log class LogErrors: """ Wraps a function call to catch and report exceptions. """ def __init__(self, function, max_errors=-1): """ :param function: the function to wrap :param int max_errors: if ``max_errors`` is non-zero, then only the ...
from .. util import class_name, log class LogErrors: """ Wraps a function call to catch and report exceptions. """ def __init__(self, function, max_errors=-1): """ :param function: the function to wrap :param int max_errors: if ``max_errors`` is non-zero, then only the ...
[async-command] Fix service definition to apply the timeout addArgument add only one argument at a time to the construtor, right now the timeout configured by the user is never applied and it's always the default (60) value, this fixes it.
<?php namespace Enqueue\AsyncCommand\DependencyInjection; use Enqueue\AsyncCommand\Commands; use Enqueue\AsyncCommand\RunCommandProcessor; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; class AsyncCommandExtension extends Extension { pub...
<?php namespace Enqueue\AsyncCommand\DependencyInjection; use Enqueue\AsyncCommand\Commands; use Enqueue\AsyncCommand\RunCommandProcessor; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; class AsyncCommandExtension extends Extension { pub...
Improve output messages for backup:monitor command
<?php namespace Spatie\Backup\Commands; use Spatie\Backup\Events\HealthyBackupWasFound; use Spatie\Backup\Events\UnhealthyBackupWasFound; use Spatie\Backup\Tasks\Monitor\BackupDestinationStatusFactory; class MonitorCommand extends BaseCommand { /** @var string */ protected $signature = 'backup:monitor'; ...
<?php namespace Spatie\Backup\Commands; use Spatie\Backup\Events\HealthyBackupWasFound; use Spatie\Backup\Events\UnhealthyBackupWasFound; use Spatie\Backup\Tasks\Monitor\BackupDestinationStatusFactory; class MonitorCommand extends BaseCommand { /** @var string */ protected $signature = 'backup:monitor'; ...
Allow the free SMS fragment limit to be 0 This updates the schema so that the free allowance has a minimum value of 0 instead of 1.
from datetime import datetime create_or_update_free_sms_fragment_limit_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "description": "POST annual billing schema", "type": "object", "title": "Create", "properties": { "free_sms_fragment_limit": {"type": "integer", "minimum":...
from datetime import datetime create_or_update_free_sms_fragment_limit_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "description": "POST annual billing schema", "type": "object", "title": "Create", "properties": { "free_sms_fragment_limit": {"type": "integer", "minimum":...
Replace try..except with get_policy_option call
from vint.ast.node_type import NodeType from vint.linting.level import Level from vint.linting.policy.abstract_policy import AbstractPolicy from vint.linting.policy_registry import register_policy from vint.ast.plugin.scope_plugin import ExplicityOfScopeVisibility @register_policy class ProhibitImplicitScopeVariable(...
from vint.ast.node_type import NodeType from vint.linting.level import Level from vint.linting.policy.abstract_policy import AbstractPolicy from vint.linting.policy_registry import register_policy from vint.ast.plugin.scope_plugin import ExplicityOfScopeVisibility @register_policy class ProhibitImplicitScopeVariable(...
Fix feate manage news category
<?php namespace App\Http\Controllers\Admin; use Illuminate\Support\Facades\Input; use App\Http\Controllers\Controller; class NewsCategoryController extends Controller { public function index() { $newscategories = \App\NewsCategory::All(); return view('admin/newscategory/index')->with('news...
<?php namespace App\Http\Controllers\Admin; use Illuminate\Support\Facades\Input; use App\Http\Controllers\Controller; class NewsCategoryController extends Controller { public function index() { $newscategories = \App\NewsCategory::All(); return view('admin/newscategory/index')->with('news...
[fix] Add fix for "no ca" case.
'use strict'; var fs = require('fs'), path = require('path'); /* * function readSsl (options, callback) * Reads the SSL certificate information in the * specified options: * * options.root * options.cert * options.key * options.ca */ module.exports = function (options, callback) { var read = {}; fun...
'use strict'; var fs = require('fs'), path = require('path'); /* * function readSsl (options, callback) * Reads the SSL certificate information in the * specified options: * * options.root * options.cert * options.key * options.ca */ module.exports = function (options, callback) { var read = {}; fun...
Update feed tests to use a person object when creating LoggedAction Otherwise the notification signal attached to LoggedAction for the alerts throws an error as it expects a Person to exist
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django_webtest import WebTest from popolo.models import Person from .auth import TestUserMixin from ..models import LoggedAction class TestFeeds(TestUserMixin, WebTest): def setUp(self): self.person1 = Person.objects.create( ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django_webtest import WebTest from .auth import TestUserMixin from ..models import LoggedAction class TestFeeds(TestUserMixin, WebTest): def setUp(self): self.action1 = LoggedAction.objects.create( user=self.user, ...
Add version and version_info to exported public API
import re import sys from collections import namedtuple from .connection import connect, Connection from .cursor import Cursor from .pool import create_pool, Pool __all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool', 'version', 'version_info') __version__ = '0.3.0' version = __version__ +...
import re import sys from collections import namedtuple from .connection import connect, Connection from .cursor import Cursor from .pool import create_pool, Pool __all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool') __version__ = '0.3.0' version = __version__ + ' , Python ' + sys.version VersionI...
Make urinorm tests runnable on their own
import os import unittest import openid.urinorm class UrinormTest(unittest.TestCase): def __init__(self, desc, case, expected): unittest.TestCase.__init__(self) self.desc = desc self.case = case self.expected = expected def shortDescription(self): return self.desc ...
import os import unittest import openid.urinorm class UrinormTest(unittest.TestCase): def __init__(self, desc, case, expected): unittest.TestCase.__init__(self) self.desc = desc self.case = case self.expected = expected def shortDescription(self): return self.desc ...
Check for and reject null event listeners.
/** * Copyright 2013 Google 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 agreed to ...
/** * Copyright 2013 Google 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 agreed to ...
Add order by start date
<?php namespace Project\AppBundle\Entity; use Doctrine\ORM\EntityRepository; /** * LessonRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class LessonRepository extends EntityRepository { /** * Find the today lesson * * @return Le...
<?php namespace Project\AppBundle\Entity; use Doctrine\ORM\EntityRepository; /** * LessonRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class LessonRepository extends EntityRepository { /** * Find the today lesson * * @return Le...
Remove "text-fill" class requirement from text elements for automatic resizing. [IQSLDSH-382]
/*global angular*/ (function () { 'use strict'; // member attribute = member in slide to watch for changes // min-font-size attribute = minimum font size in pixels // max-font-size attribute = maximum font size in pixels // Directive must be used on the parent of an element with the .text-fill clas...
/*global angular*/ (function () { 'use strict'; // member attribute = member in slide to watch for changes // min-font-size attribute = minimum font size in pixels // max-font-size attribute = maximum font size in pixels // Directive must be used on the parent of an element with the .text-fill clas...
Use PhutilProxyException to disambiguate work queue failures Summary: Fixes T2569. This is the other common exception source which is ambiguous. List the task ID explicitly to make debugging easier. Test Plan: {F51268} Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2569 Differential Revision:...
<?php final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon { public function run() { $sleep = 0; do { $tasks = id(new PhabricatorWorkerLeaseQuery()) ->setLimit(1) ->execute(); if ($tasks) { foreach ($tasks as $task) { $id = $task->getID(); ...
<?php final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon { public function run() { $sleep = 0; do { $tasks = id(new PhabricatorWorkerLeaseQuery()) ->setLimit(1) ->execute(); if ($tasks) { foreach ($tasks as $task) { $id = $task->getID(); ...
Modify attributes for dynamic columns Refs SH-64
# -*- 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 __future__ import unicode_literals from django.db.models import Count ...
# -*- 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 __future__ import unicode_literals from django.db.models import Count ...
Set Access-Control-Allow-Credentials for all responses In order to inform the browser to set the Cookie header on requests, this header must be set otherwise the session is reset on every request.
from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' 'of SERRANO_COR...
from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' 'of SERRANO_COR...
Raise hard error when API key is invalid
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.app import raven from sentry.models imp...
Add connect() description in RexsterClient tests
var should = require('should'); var grex = require('../index.js'); var _ = require("lodash"); var RexsterClient = require('../src/rexsterclient.js'); var defaultOptions = { 'host': 'localhost', 'port': 8182, 'graph': 'tinkergraph' }; describe.only('RexsterClient', function() { describe('connect()', func...
var should = require('should'); var grex = require('../index.js'); var _ = require("lodash"); var RexsterClient = require('../src/rexsterclient.js'); var defaultOptions = { 'host': 'localhost', 'port': 8182, 'graph': 'tinkergraph' }; describe('RexsterClient', function() { describe('when passing no param...
Hide load more button if no stories
import React from 'react'; import { ListView, RefreshControl, View } from 'react-native'; import Footer from './Footer'; import Story from './Story'; const renderSeparator = (sectionID, rowID, adjacentRowHighlighted) => <View key={`${sectionID}-${rowID}`} style={{ height: adjacentR...
import React from 'react'; import { ListView, RefreshControl, View } from 'react-native'; import Footer from './Footer'; import Story from './Story'; const renderSeparator = (sectionID, rowID, adjacentRowHighlighted) => <View key={`${sectionID}-${rowID}`} style={{ height: adjacentR...
Use shortname instead of alias Fixes #106
<?= '<?php' ?> /** * An helper file for Laravel 4, to provide autocomplete information to your IDE * Generated for Laravel <?= $version ?> on <?= date("Y-m-d") ?>. * * @author Barry vd. Heuvel <barryvdh@gmail.com> * @see https://github.com/barryvdh/laravel-ide-helper */ <?php foreach($namespaces as $n...
<?= '<?php' ?> /** * An helper file for Laravel 4, to provide autocomplete information to your IDE * Generated for Laravel <?= $version ?> on <?= date("Y-m-d") ?>. * * @author Barry vd. Heuvel <barryvdh@gmail.com> * @see https://github.com/barryvdh/laravel-ide-helper */ <?php foreach($namespaces as $n...
Check once every 15 minutes
from celery.schedules import crontab from celery.task import periodic_task from django.utils.timezone import now from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant import logging from bluebottle.events.models import Event logger = logging.getLogger('bluebottle') @periodic...
from celery.schedules import crontab from celery.task import periodic_task from django.utils.timezone import now from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant import logging from bluebottle.events.models import Event logger = logging.getLogger('bluebottle') @periodic...
Update sample Python report module for ReportModule interface API change
from java.lang import System from org.sleuthkit.autopsy.casemodule import Case from org.sleuthkit.datamodel import SleuthkitCase from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter class SampleGeneralReportModule(GeneralReportModuleAdapter): def getName(self): return "Sample Report Module"...
from java.lang import System from org.sleuthkit.autopsy.casemodule import Case from org.sleuthkit.datamodel import SleuthkitCase from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter class SampleGeneralReportModule(GeneralReportModuleAdapter): def getName(self): return "Sample Report Module"...
Add unit support for spacers git-svn-id: 305ad3fa995f01f9ce4b4f46c2a806ba00a97020@779 3777fadb-0f44-0410-9e7f-9d8fa6171d72
# -*- coding: utf-8 -*- # See LICENSE.txt for licensing terms #$HeadURL$ #$LastChangedDate$ #$LastChangedRevision$ import shlex from reportlab.platypus import Spacer from flowables import * from styles import adjustUnits def parseRaw(data): """Parse and process a simple DSL to handle creation of f...
# -*- coding: utf-8 -*- # See LICENSE.txt for licensing terms #$HeadURL$ #$LastChangedDate$ #$LastChangedRevision$ import shlex from reportlab.platypus import Spacer from flowables import * def parseRaw(data): """Parse and process a simple DSL to handle creation of flowables. Supported (ca...
Update generate resource command signature
<?php namespace Nwidart\Modules\Commands; use Illuminate\Console\Command; class GenerateResource extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'module:make:resource {resource : The singular name...
<?php namespace Nwidart\Modules\Commands; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputArgument; class GenerateResource extends Command { /** * The command name. * * @var string */ protected $name = 'module:make:resource'; /** * The command descri...
Update name of vagrant module Changed to python-vagrant to get python setup.py to work
#!/usr/bin/env python from setuptools import setup setup( name = 'nepho', version = '0.2.0', url = 'http://github.com/huit/nepho', description = 'Simplified cloud orchestration tool for constructing virtual data centers', packages = ['nepho', 'nepho.aws'], author ...
#!/usr/bin/env python from setuptools import setup setup( name = 'nepho', version = '0.2.0', url = 'http://github.com/huit/nepho', description = 'Simplified cloud orchestration tool for constructing virtual data centers', packages = ['nepho', 'nepho.aws'], author ...
Use correct m2m join table name in LatestCommentsFeed --HG-- extra : convert_revision : svn%3Abcc190cf-cafb-0310-a4f2-bffc1f526a37/django/trunk%409089
from django.conf import settings from django.contrib.syndication.feeds import Feed from django.contrib.sites.models import Site from django.contrib import comments class LatestCommentFeed(Feed): """Feed of latest comments on the current site.""" def title(self): if not hasattr(self, '_site'): ...
from django.conf import settings from django.contrib.syndication.feeds import Feed from django.contrib.sites.models import Site from django.contrib import comments class LatestCommentFeed(Feed): """Feed of latest comments on the current site.""" def title(self): if not hasattr(self, '_site'): ...
Use more verbose progress output.
<?php namespace Aurora\Console\Commands; use Aurora\Services\Fastly; use Aurora\Resources\Redirect; use Illuminate\Console\Command; class FastlyImportCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'fastly:import {pa...
<?php namespace Aurora\Console\Commands; use Aurora\Services\Fastly; use Aurora\Resources\Redirect; use Illuminate\Console\Command; class FastlyImportCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'fastly:import {pa...
Add support for forum thread view
// ==UserScript== // @name Slickdeals Don't Track Me! // @version 1.1 // @description Replaces outgoing Slickdeals tracking links with direct links. // @match http://slickdeals.net/f/* // @namespace https://github.com/gg/slickdeals-dont-track-me // @author Gregg Gajic <https://github.com/gg> // @licen...
// ==UserScript== // @name Slickdeals Don't Track Me! // @version 1.0 // @description Replaces outgoing Slickdeals tracking links with direct links. // @match http://slickdeals.net/f/* // @namespace https://github.com/gg/slickdeals-dont-track-me // @author Gregg Gajic <https://github.com/gg> // @licen...
Use create instead of instance and save
from urllib import urlencode from datetime import datetime from django.http import HttpResponseForbidden from django.contrib.auth.models import AnonymousUser from django.utils.timezone import now from api.models import AuthAPIKey, AuthAPILog class APIKeyAuthentication(object): """ Validats a request by API key ...
from urllib import urlencode from datetime import datetime from django.http import HttpResponseForbidden from django.contrib.auth.models import AnonymousUser from django.utils.timezone import now from api.models import AuthAPIKey, AuthAPILog class APIKeyAuthentication(object): """ Validats a request by API key ...
Set `replaced` also for children array Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
'use strict'; function Node(source) { var _this = this; this._parent = null; this.getSource = function () { return source; }; this.adopt = function (nodeOrNodes) { if (nodeOrNodes instanceof Array) { for (var i in nodeOrNodes) { nodeOrNodes[i]._parent = _this; ...
'use strict'; function Node(source) { var _this = this; this._parent = null; this.getSource = function () { return source; }; this.adopt = function (nodeOrNodes) { if (nodeOrNodes instanceof Array) { for (var i in nodeOrNodes) { nodeOrNodes[i]._parent = _this; ...
Fix a few Sphinx typos * `.. note:` -> `.. note::` to prevent the `note` from being interpreted as a comment, which wouldn't show up when the docs are rendered. * Double backticks for the code bits. * Correct typo ("atribute" -> "attribute"). * Sphinx doesn't like characters immediately after the backticks, so add ...
"""PRAW exception classes. Includes two main exceptions: :class:`.APIException` for when something goes wrong on the server side, and :class:`.ClientException` when something goes wrong on the client side. Both of these classes extend :class:`.PRAWException`. """ class PRAWException(Exception): """The base PRAW...
"""PRAW exception classes. Includes two main exceptions: :class:`.APIException` for when something goes wrong on the server side, and :class:`.ClientException` when something goes wrong on the client side. Both of these classes extend :class:`.PRAWException`. """ class PRAWException(Exception): """The base PRAW...
JsMinify: Hide output textarea by default
DDH.js_minify = DDH.js_minify || {}; "use strict"; DDH.js_minify.build = function(ops) { var shown = false; return { onShow: function() { // make sure this function is run only once, the first time // the IA is shown otherwise things will get initialized more than once ...
DDH.js_minify = DDH.js_minify || {}; "use strict"; DDH.js_minify.build = function(ops) { var shown = false; return { onShow: function() { // make sure this function is run only once, the first time // the IA is shown otherwise things will get initialized more than once ...
Add attributes for drag and drop
function generate_board_page(that, board_id){ /* Generate the board page */ // Gets the node of board page var bp_node = that.nodeById('board_page'); // Make a serverCall to gets lists and cards related // to the board. var result = genro.serverCall( 'get_lists_cards', {board_i...
function generate_board_page(that, board_id){ /* Generate the board page */ // Gets the node of board page var bp_node = that.nodeById('board_page'); // Make a serverCall to gets lists and cards related // to the board. var result = genro.serverCall( 'get_lists_cards', {board_i...
Move logout to the last position
(function() { 'use strict'; angular.module('app.states') .run(appRun); /** @ngInject */ function appRun(routerHelper, navigationHelper) { routerHelper.configureStates(getStates()); navigationHelper.navItems(navItems()); navigationHelper.sidebarItems(sidebarItems()); } function getStates()...
(function() { 'use strict'; angular.module('app.states') .run(appRun); /** @ngInject */ function appRun(routerHelper, navigationHelper) { routerHelper.configureStates(getStates()); navigationHelper.navItems(navItems()); navigationHelper.sidebarItems(sidebarItems()); } function getStates()...
Move Pillow to the last version
try: from setuptools import setup kw = {'entry_points': """[console_scripts]\nglue = glue:main\n""", 'zip_safe': False} except ImportError: from distutils.core import setup kw = {'scripts': ['glue.py']} setup( name='glue', version='0.2.6.1', url='http://github.com/jorgeb...
try: from setuptools import setup kw = {'entry_points': """[console_scripts]\nglue = glue:main\n""", 'zip_safe': False} except ImportError: from distutils.core import setup kw = {'scripts': ['glue.py']} setup( name='glue', version='0.2.6.1', url='http://github.com/jorgeb...
Allow listing players if dead
package me.rkfg.xmpp.bot.plugins.game.command; import static me.rkfg.xmpp.bot.plugins.game.misc.Utils.*; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Optional; import java.util.stream.IntStream; import java.util.stream.Stream; import me.rkfg.xmpp.bot.plugins.game.IPla...
package me.rkfg.xmpp.bot.plugins.game.command; import static me.rkfg.xmpp.bot.plugins.game.misc.Utils.*; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Optional; import java.util.stream.IntStream; import java.util.stream.Stream; import me.rkfg.xmpp.bot.plugins.game.IPla...
Add register and IO addresses
import re from pygments.lexer import RegexLexer, include from pygments.token import * class HackAsmLexer(RegexLexer): name = 'Hack Assembler' aliases = ['hack_asm'] filenames = ['*.asm'] identifier = r'[a-zA-Z$._?][a-zA-Z0-9$._?]*' flags = re.IGNORECASE | re.MULTILINE tokens = { 'root...
import re from pygments.lexer import RegexLexer, include from pygments.token import * class HackAsmLexer(RegexLexer): name = 'Hack Assembler' aliases = ['hack_asm'] filenames = ['*.asm'] identifier = r'[a-zA-Z$._?][a-zA-Z0-9$._?]*' flags = re.IGNORECASE | re.MULTILINE tokens = { 'root...
Adjust coverage values to match existing setup
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'], options: { jshintrc: '.jshintrc', } }, ...
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'], options: { jshintrc: '.jshintrc', } }, ...
Drop Python 2 support in split_level utility function
from collections.abc import Iterable def is_expanded(request, key): """ Examines request object to return boolean of whether passed field is expanded. """ expand = request.query_params.get("expand", "") expand_fields = [] for e in expand.split(","): expand_fields.extend([e for e i...
try: # Python 3 from collections.abc import Iterable string_types = (str,) except ImportError: # Python 2 from collections import Iterable string_types = (str, unicode) def is_expanded(request, key): """ Examines request object to return boolean of whether passed field is expanded....
Make sure executing lettuce still results in something sane
from lettuce import before, world, after from splinter.browser import Browser from salad.logger import logger @before.all def setup_master_browser(): try: browser = world.drivers[0] remote_url = world.remote_url except AttributeError, IndexError: browser = 'firefox' remote_url ...
from lettuce import before, world, after from splinter.browser import Browser from salad.logger import logger @before.all def setup_master_browser(): world.master_browser = setup_browser(world.drivers[0], world.remote_url) world.browser = world.master_browser def setup_browser(browser, url=None): logger...
Allow inactive sessions to last 14 days instead of 1 day
import datetime from db import session import model class UserInfo: def __init__(self, user=None, token=None): self.id = user.id if user else None self.role = user.role if user else None self.token = token self.user = user def is_logged_in(self): return self.id is no...
import datetime from db import session import model class UserInfo: def __init__(self, user=None, token=None): self.id = user.id if user else None self.role = user.role if user else None self.token = token self.user = user def is_logged_in(self): return self.id is no...
Store current working directory before import
# # This program provides a simple command line to query population statistics. # Author: Tay Joc Cing # Date: 20 Mar 2015 # import sys import os sys.path.append(os.getcwd() + "/classes") from country import Country from datamanager import DataManager from dispatcher import CommandDispatcher from constants import * ...
# # This program provides a simple command line to query population statistics. # Author: Tay Joc Cing # Date: 20 Mar 2015 # import sys import os from country import Country from datamanager import DataManager from dispatcher import CommandDispatcher from constants import * sys.path.append(os.getcwd() + "/classes") ...
Fix in admin meta tags
<!DOCTYPE html> <html lang="{{ app()->getLocale() }}"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="csrf-token" content...
<!DOCTYPE html> <html lang="{{ app()->getLocale() }}"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="csrf-token" content="{{ csrf_token() }}"> <title>{{__('...