text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
FIX (revisions): Fix revision history link
'use strict'; angular.module('gisto.service.githubUrlBuilder', [], function ($provide) { $provide.factory('githubUrlBuilderService', function (ghAPI, $filter, $rootScope, $routeParams) { var githubFileNameFilter = $filter('githubFileName'); var publicGithubUrl = 'https://gist.github.com/'; ...
'use strict'; angular.module('gisto.service.githubUrlBuilder', [], function ($provide) { $provide.factory('githubUrlBuilderService', function (ghAPI, $filter, $rootScope) { var githubFileNameFilter = $filter('githubFileName'); var publicGithubUrl = 'https://gist.github.com/'; var baseUrl =...
Handle enter key on tenant switch.
(function ($) { var _accountService = abp.services.app.account; var _$form = $('form[name=TenantChangeForm]'); function switchToSelectedTenant () { var tenancyName = _$form.find('input[name=TenancyName]').val(); if (!tenancyName) { abp.multiTenancy.setTenantIdCookie(null); ...
(function ($) { var _accountService = abp.services.app.account; var _$form = $('form[name=TenantChangeForm]'); _$form.closest('div.modal-content').find(".save-button").click(function (e) { e.preventDefault(); var tenancyName = _$form.find('input[name=TenancyName]').val(); if (!t...
Make return character an attribute
import time from netmiko.base_connection import BaseConnection class NetscalerSSH(BaseConnection): """ Netscaler SSH class. """ def session_preparation(self): """Prepare the session after the connection has been established.""" # 0 will defer to the global delay factor delay_factor ...
import time from netmiko.base_connection import BaseConnection class NetscalerSSH(BaseConnection): """ Netscaler SSH class. """ def session_preparation(self): """Prepare the session after the connection has been established.""" # 0 will defer to the global delay factor delay_factor ...
Mark class abstract as it contains abstract methods
<?php use Symfony\Component\HttpKernel\Kernel; use Doctrine\Common\Annotations\AnnotationRegistry; abstract class Kwf_SymfonyKernel extends Kernel { public function __construct() { if (Kwf_Exception::isDebug()) { $environment = 'dev'; $debug = true; //Debug::enable()...
<?php use Symfony\Component\HttpKernel\Kernel; use Doctrine\Common\Annotations\AnnotationRegistry; class Kwf_SymfonyKernel extends Kernel { public function __construct() { if (Kwf_Exception::isDebug()) { $environment = 'dev'; $debug = true; //Debug::enable(); ...
Fix OpenFlow packets getting stuffed with \0 bytes.
package eu.netide.lib.netip; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.projectfloodlight.openflow.protocol.OFMessage; /** * Class representing a message of type OPENFLOW. * Note that this only serves as a convenience class - if the MessageType is manipulat...
package eu.netide.lib.netip; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.projectfloodlight.openflow.protocol.OFMessage; /** * Class representing a message of type OPENFLOW. * Note that this only serves as a convenience class - if the MessageType is manipulat...
Change ncmbClassName,apiPath to class constants.
<?php namespace Ncmb; /** * Role - Representation of an access Role. */ class Role extends Object { const NCMB_CLASS_NAME = 'role'; const API_PATH = 'roles'; /** * Create a Role object with a given name and ACL. * * @param string $name * @param \Ncmb\Acl|null $acl * * @ret...
<?php namespace Ncmb; /** * Role - Representation of an access Role. */ class Role extends Object { public static $ncmbClassName = 'role'; public static $apiPath = 'roles'; /** * Create a Role object with a given name and ACL. * * @param string $name * @param \Ncmb\Acl|null $acl ...
Throw exception if the config.path is not valid
<?php /* * This file is part of the Cilex framework. * * (c) Mike van Riel <mike.vanriel@naenius.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Cilex\Provider; use Cilex\Application; use Cilex\ServiceProviderInte...
<?php /* * This file is part of the Cilex framework. * * (c) Mike van Riel <mike.vanriel@naenius.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Cilex\Provider; use Cilex\Application; use Cilex\ServiceProviderInte...
Fix shadow for wide screens.
from asciimatics.renderers import FigletText, Fire from asciimatics.scene import Scene from asciimatics.screen import Screen from asciimatics.effects import Print from asciimatics.exceptions import ResizeScreenError from pyfiglet import Figlet import sys def demo(screen): scenes = [] text = Figlet(font="bann...
from asciimatics.renderers import FigletText, Fire from asciimatics.scene import Scene from asciimatics.screen import Screen from asciimatics.effects import Print from asciimatics.exceptions import ResizeScreenError from pyfiglet import Figlet import sys def demo(screen): scenes = [] effects = [ Prin...
Move main code to function because of pylint warning 'Invalid constant name'
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group GROUP. Ori...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group GROUP. Ori...
Make Grunt copy bullet.js into example js libs dir
module.exports = function (grunt) { 'use strict'; var jsSrcFile = 'src/bullet.js'; var jsDistDir = 'dist/'; var jsExampleLibsDir = 'example/js/libs/'; var testDir = 'test/spec/'; grunt.initConfig({ watch : { js: { files: [ jsSrcFile, ...
module.exports = function (grunt) { 'use strict'; var jsSrcFile = 'src/bullet.js'; var jsDistDir = 'dist/'; var testDir = 'test/spec/'; grunt.initConfig({ watch : { js: { files: [ jsSrcFile, testDir + '**/*.js' ...
Increase timeout for slow test
from doajtest.helpers import DoajTestCase from portality.core import app from portality.tasks import sitemap from portality.background import BackgroundApi import time from portality.store import StoreFactory class TestSitemap(DoajTestCase): store_impl = None @classmethod def setUpClass(cls) -> None: ...
from doajtest.helpers import DoajTestCase from portality.core import app from portality.tasks import sitemap from portality.background import BackgroundApi import os, shutil, time from portality.lib import paths from portality.store import StoreFactory class TestSitemap(DoajTestCase): store_impl = None @clas...
Add Options class Add field filters lists Start proper model field introspection
from django.db.models.fields import NOT_PROVIDED from django.utils.six import with_metaclass from . import filters from .fields import Field from .views import DataView # Map of ModelField name -> list of filters FIELD_FILTERS = { 'DateField': [filters.DateFilter], 'TimeField': [filters.TimeFilter], 'Da...
from .fields import Field from .views import DataView from django.utils.six import with_metaclass class MetaView(type): def __new__(mcs, name, bases, attrs): meta = attrs.get('Meta', None) try: model = meta.model except AttributeError: if name != 'ModelDataView'...
Reset error message when dialog re-opened.
// // nav-controller.js // Contains the controller for the nav-bar. // (function () { 'use strict'; angular.module('movieFinder.controllers') .controller('NavCtrl', function ($scope, $modal, user) { var _this = this; var signInModal; this.error = {...
// // nav-controller.js // Contains the controller for the nav-bar. // (function () { 'use strict'; angular.module('movieFinder.controllers') .controller('NavCtrl', function ($scope, $modal, user) { var _this = this; var signInModal; this.error = {...
Fix a test class name
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function import responses import simplesqlite from click.testing import CliRunner from sqlitebiter._enum import ExitCode from sqlitebiter.sqlitebiter import cmd from .common import print_traceback ...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function import responses import simplesqlite from click.testing import CliRunner from sqlitebiter._enum import ExitCode from sqlitebiter.sqlitebiter import cmd from .common import print_traceback ...
Add removeTestResults to the signout button
import React from "react"; import { Link } from "react-router-dom"; import fetchContainer from "../../containers/fetch-container"; import "./Controls.css"; const handleSignOut = (props) => { localStorage.removeItem('user'); props.removeTestsFromStore(); props.removeTestResultsFromStore(); props.removeUserFromS...
import React from "react"; import { Link } from "react-router-dom"; import fetchContainer from "../../containers/fetch-container"; import "./Controls.css"; const handleSignOut = (props) => { localStorage.removeItem('user'); props.removeTestsFromStore(); props.removeUserFromStore(); } const Controls = (props) =>...
Fix default of grouping option for AAT
#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--gr...
#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--gr...
Include the status code in the string, and nicer messages
package org.intermine.webservice.server; /* * Copyright (C) 2002-2011 FlyMine * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. See the LICENSE file for more * information or http://www.gnu.org/copyleft/l...
package org.intermine.webservice.server; /* * Copyright (C) 2002-2011 FlyMine * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. See the LICENSE file for more * information or http://www.gnu.org/copyleft/l...
Update workshops as well as talks
from django.core.management.base import BaseCommand, CommandError from events.models import Event class Command(BaseCommand): help = "Copies talk title and descriptions from the application." def add_arguments(self, parser): parser.add_argument('event_id', type=int) def handle(self, *args, **op...
from django.core.management.base import BaseCommand, CommandError from events.models import Event class Command(BaseCommand): help = "Copies talk title and descriptions from the application." def add_arguments(self, parser): parser.add_argument('event_id', type=int) def handle(self, *args, **op...
tests: Update run_test.py to fix coverage
#!/usr/bin/env python3 import os import tempfile from distutils.sysconfig import get_python_lib from coalib.tests.TestHelper import TestHelper if __name__ == '__main__': parser = TestHelper.create_argparser(description="Runs coalas tests.") parser.add_argument("-b", "--ignore-bear-te...
#!/usr/bin/env python3 import os import tempfile from distutils.sysconfig import get_python_lib from coalib.tests.TestHelper import TestHelper if __name__ == '__main__': parser = TestHelper.create_argparser(description="Runs coalas tests.") parser.add_argument("-b", "--ignore-bear-te...
Add logging message when plugin fails to render custom panels
import logging import sys import traceback from django.conf import settings from django.views.debug import ExceptionReporter from error_report.models import Error from plugin.registry import registry logger = logging.getLogger('inventree') class InvenTreePluginViewMixin: """ Custom view mixin which adds ...
import sys import traceback from django.conf import settings from django.views.debug import ExceptionReporter from error_report.models import Error from plugin.registry import registry class InvenTreePluginViewMixin: """ Custom view mixin which adds context data to the view, based on loaded plugins. ...
Replace keyword delete with doDelete for method name.
define(['jquery', 'backbone', 'tiddlerFormView', 'hbt!Tiddler'], function ($, Backbone, TiddlerFormView, template) { return Backbone.View.extend({ events: { 'click .edit-button': 'edit', 'click .delete-button': 'doDelete' }, render: funct...
define(['jquery', 'backbone', 'tiddlerFormView', 'hbt!Tiddler'], function ($, Backbone, TiddlerFormView, template) { return Backbone.View.extend({ events: { 'click .edit-button': 'edit', 'click .delete-button': 'delete' }, render: functio...
Check for ajax errors before checking if term is created
import $ from 'jquery'; class Taxonomy { /** * Initialize Papi taxonomy class. */ static init() { new Taxonomy().binds(); } /** * Bind elements with functions. */ binds() { $('#submit').on('click', this.addNewTerm.bind(this)); } /** * Redirect if a new term is added and redirect...
import $ from 'jquery'; class Taxonomy { /** * Initialize Papi taxonomy class. */ static init() { new Taxonomy().binds(); } /** * Bind elements with functions. */ binds() { $('#submit').on('click', this.addNewTerm.bind(this)); } /** * Redirect if a new term is added and redirect...
Fix link to PDF Confirm Report Steps to reproduce: # Open a family in Family View. # Activate Verify Info button. # Activate PDF Report button. What happens: A new tab opens in the browser with a 404 error. The path contains "churchcrmReports/ConfirmReport.php". What is expected: A PDF file is downloaded. T...
$(document).ready(function () { $("#pledge-payment-table").DataTable(window.CRM.plugin.dataTable); $("#onlineVerify").click(function () { $.ajax({ type: 'POST', url: window.CRM.root + '/api/families/' + window.CRM.currentFamily + '/verify' }) .done(function(data, textStatus, xhr) { ...
$(document).ready(function () { $("#pledge-payment-table").DataTable(window.CRM.plugin.dataTable); $("#onlineVerify").click(function () { $.ajax({ type: 'POST', url: window.CRM.root + '/api/families/' + window.CRM.currentFamily + '/verify' }) .done(function(data, textStatus, xhr) { ...
Replace star inport with explicit ones
package com.novoda.downloadmanager; import android.support.annotation.WorkerThread; import java.util.List; import static com.novoda.downloadmanager.DownloadBatchStatus.Status.DELETING; import static com.novoda.downloadmanager.DownloadBatchStatus.Status.DELETED; import static com.novoda.downloadmanager.DownloadBatchS...
package com.novoda.downloadmanager; import android.support.annotation.WorkerThread; import java.util.List; import static com.novoda.downloadmanager.DownloadBatchStatus.Status.*; final class DownloadBatchSizeCalculator { private DownloadBatchSizeCalculator() { // non instantiable } @WorkerThrea...
examples: Add name to position-offset shader
FamousFramework.scene('famous-tests:webgl:custom-shader:vertex', { behaviors: { '$camera': { 'set-depth': 1000 }, '.sphere': { 'size': [200, 200], 'align': [0.5, 0.5], 'origin': [0.5, 0.5], 'mount-point': [0.5, 0.5], 'ba...
FamousFramework.scene('famous-tests:webgl:custom-shader:vertex', { behaviors: { '$camera': { 'set-depth': 1000 }, '.sphere': { 'size': [200, 200], 'align': [0.5, 0.5], 'origin': [0.5, 0.5], 'mount-point': [0.5, 0.5], 'ba...
Add explicit reasoning for session sniff From https://vip.wordpress.com/documentation/code-review-what-we-look-for/#session_start-and-other-session-related-functions, linked in #75
<?php /** * WordPress_Sniffs_VIP_SessionVariableUsageSniff * * Discourages the use of the session variable. * Creating a session writes a file to the server and is unreliable in a multi-server environment. * * @category PHP * @package PHP_CodeSniffer * @author Shady Sharaf <shady@x-team.com> * @link htt...
<?php /** * WordPress_Sniffs_VIP_SessionVariableUsageSniff * * Discourages the use of the session variable * * @category PHP * @package PHP_CodeSniffer * @author Shady Sharaf <shady@x-team.com> * @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/75 */ class WordPress_...
Remove hard coded realm and assume any is fine
import urllib2 from urlparse import urljoin from gocd.api import Pipeline class Server(object): def __init__(self, host, user=None, password=None): self.host = host self.user = user self.password = password if self.user and self.password: self._add_basic_auth() ...
import urllib2 from urlparse import urljoin from gocd.api import Pipeline class Server(object): def __init__(self, host, user=None, password=None): self.host = host self.user = user self.password = password if self.user and self.password: self._add_basic_auth() ...
Remove unittest and mock for now
from django.test import TestCase from datetime import datetime, timedelta from notifications.models import District, DistrictExceptions, Municipality class DistrictTestCase(TestCase): def setUp(self): today = datetime.now() m = Municipality.objects.create(state="ME", zipcode="04421", ...
import mock import unittest from django.test import TestCase from datetime import datetime, timedelta from notifications.models import District, DistrictExceptions, Municipality class DistrictTestCase(TestCase): def setUp(self): today = datetime.now() m = Municipality.objects.create(state="ME", z...
Use DOMContendLoaded event instead of load event to verify opening compose window definitely
/* 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/. */ (function (aGlobal) { var tbBug766495 = { init: function() { window.removeEventListener('DOMContentLo...
/* 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/. */ (function (aGlobal) { var tbBug766495 = { init: function() { window.removeEventListener('load', this,...
Update the home slider, add auto play
var LightSliderHomeInit = function() { // // Init // this.init(); }; LightSliderHomeInit.prototype.init = function() { var that = this; $('[data-slider-home]').lightSlider({ item: 1, slideMargin: 0, pager: false, loop: true, auto: true, pauseO...
var LightSliderHomeInit = function() { // // Init // this.init(); }; LightSliderHomeInit.prototype.init = function() { var that = this; $('[data-slider-home]').lightSlider({ item: 1, slideMargin: 0, pager: false, loop: true, onAfterSlide: function(sli...
Use server-side collname in event payloads
'use strict'; const { getReason } = require('../../error'); const { MODEL_TYPES } = require('../../constants'); const { DEFAULT_FORMAT } = require('../../formats'); const { normalizeCompress } = require('../../compress'); // Builds requestinfo from request mInput const buildRequestinfo = function ({ requestid, ti...
'use strict'; const { getReason } = require('../../error'); const { MODEL_TYPES } = require('../../constants'); const { DEFAULT_FORMAT } = require('../../formats'); const { normalizeCompress } = require('../../compress'); // Builds requestinfo from request mInput const buildRequestinfo = function ({ requestid, ti...
Use local variable for clipboard created by ClipboardJS instead of ref
import React from 'react'; import ClipboardJS from 'clipboard'; import 'balloon-css/balloon.css'; export default class CopyButton extends React.PureComponent { constructor(props) { super(props); this.copyBtnRef = React.createRef(); } static defaultProps = { content: '', }; state = { tooltipA...
import React from 'react'; import ClipboardJS from 'clipboard'; import 'balloon-css/balloon.css'; export default class CopyButton extends React.PureComponent { constructor(props) { super(props); this.copyBtnRef = React.createRef(); this.clipboardRef = React.createRef(); } static defaultProps = { ...
Fix double include of jQuery on chart pages
<?php namespace DrupalReleaseDate\Controllers; use Silex\Application; use Symfony\Component\HttpFoundation\Request; class Charts { public function samples(Application $app, Request $request) { return $app['twig']->render( 'charts/samples.twig', array( 'scripts'...
<?php namespace DrupalReleaseDate\Controllers; use Silex\Application; use Symfony\Component\HttpFoundation\Request; class Charts { public function samples(Application $app, Request $request) { return $app['twig']->render( 'charts/samples.twig', array( 'scripts'...
Add pgp to notification channels
/* @flow */ import engine from '../engine' import {notifyCtlSetNotificationsRpc} from '../constants/types/flow-types' type NotificationChannels = { chat?: true, favorites?: true, kbfs?: true, keyfamily?: true, paperkeys?: true, pgp?: true, service?: true, session?: true, tracking?: true, users?: t...
/* @flow */ import engine from '../engine' import {notifyCtlSetNotificationsRpc} from '../constants/types/flow-types' type NotificationChannels = { session?: true, users?: true, kbfs?: true, tracking?: true, favorites?: true, paperkeys?: true, keyfamily?: true, service?: true, chat?: true, } let ch...
Change trove classifier to show project is now stable
#!/usr/bin/env python try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_f: README = readme_f.read() with open('tests/requirements.txt') as test_requirements_f: TEST_REQUIREMENTS = test_requirements_f.readlines() setup( name=...
#!/usr/bin/env python try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_f: README = readme_f.read() with open('tests/requirements.txt') as test_requirements_f: TEST_REQUIREMENTS = test_requirements_f.readlines() setup( name=...
Use padding instead of margin for x-axis. The overflow: hidden; property on the wrapper isn't taking margin into account for the x-axis. By using padding instead, the x-axis overflow is correctly hidden.
import React from 'react' import PropTypes from 'prop-types' import Component from 'hyper/component' import decorate from 'hyper/decorate' class HyperLine extends Component { static propTypes() { return { plugins: PropTypes.array.isRequired } } styles() { return { line: { display...
import React from 'react' import PropTypes from 'prop-types' import Component from 'hyper/component' import decorate from 'hyper/decorate' class HyperLine extends Component { static propTypes() { return { plugins: PropTypes.array.isRequired } } styles() { return { line: { display...
Replace upsert=True with conflict='replace' in tests Review 1804 by @gchpaco Related to #2733
# This is a (hopefully temporary) shim that uses the rdb protocol to # implement part of the memcache API import contextlib import rdb_workload_common @contextlib.contextmanager def make_memcache_connection(opts): with rdb_workload_common.make_table_and_connection(opts) as (table, conn): yield MemcacheRdb...
# This is a (hopefully temporary) shim that uses the rdb protocol to # implement part of the memcache API import contextlib import rdb_workload_common @contextlib.contextmanager def make_memcache_connection(opts): with rdb_workload_common.make_table_and_connection(opts) as (table, conn): yield MemcacheRdb...
Fix race condition in test @bug W-3269340@ @rev tbliss@
({ setStatus: function(cmp, status) { cmp.set("v.status", status); this.log(cmp, "\nStatus update: " + status); }, log: function(cmp, log) { var l = cmp.get("v.log"); l += log + "\n"; cmp.set("v.log", l); }, clearActionAndDefStorage: function(cmp) { ...
({ setStatus: function(cmp, status) { cmp.set("v.status", status); this.log(cmp, "\nStatus update: " + status); }, log: function(cmp, log) { var l = cmp.get("v.log"); l += log + "\n"; cmp.set("v.log", l); }, clearActionAndDefStorage: function(cmp) { ...
Fix detect Git-LFS in tests
import email from os.path import dirname, join from django.utils import six from django_mailbox.models import Mailbox from feder.letters.signals import MessageParser class MessageMixin(object): def setUp(self): self.mailbox = Mailbox.objects.create(from_email='from@example.com') super(MessageMix...
import email from os.path import dirname, join from django.utils import six from django_mailbox.models import Mailbox from feder.letters.signals import MessageParser class MessageMixin(object): def setUp(self): self.mailbox = Mailbox.objects.create(from_email='from@example.com') super(MessageMix...
Add pln to box edit form, make username and password optional.
<?php namespace LOCKSSOMatic\CrudBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class BoxType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options...
<?php namespace LOCKSSOMatic\CrudBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class BoxType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options...
Update target count to consider users who subded to `all`
from django.shortcuts import render, redirect from django.views.generic import View from django.core.urlresolvers import reverse from django.contrib import messages from .models import Email from .forms import EmailAdminForm from nightreads.user_manager.models import Subscription class SendEmailAdminView(View): ...
from django.shortcuts import render, redirect from django.views.generic import View from django.core.urlresolvers import reverse from django.contrib import messages from .models import Email from .forms import EmailAdminForm from nightreads.user_manager.models import Subscription class SendEmailAdminView(View): ...
Fix test fails by loading Chart.js on runtime
import React, { PropTypes } from "react"; import { getLabelDisplay } from "./stat"; export default class StatsChart extends React.Component { componentDidMount() { const Chart = require("chart.js"); const ctx = this.canvasElement.getContext("2d"); this.chart = new Chart(ctx, { type: "line", d...
import React, { PropTypes } from "react"; import Chart from "chart.js"; import { getLabelDisplay } from "./stat"; export default class StatsChart extends React.Component { componentDidMount() { const ctx = this.canvasElement.getContext("2d"); this.chart = new Chart(ctx, { type: "line", data: this...
Add custom validation to ScoreGroup schema
import _ from 'lodash'; import * as schema from '../../../lib/schema/schema'; export const textQuestion = { question: schema.string({isRequired: true}), isRequired: schema.bool(), text: schema.shape({ isMultiline: schema.bool(), maxChars: schema.integer({max: 100}), maxWords: schema.integer({ v...
import * as schema from '../../../lib/schema/schema'; export const textQuestion = { question: schema.string({isRequired: true}), isRequired: schema.bool(), text: schema.shape({ isMultiline: schema.bool(), maxChars: schema.integer({max: 100}), maxWords: schema.integer({ validate: function valida...
Update AceQLManager form to new L&L
/* * This file is part of AceQL HTTP. * AceQL HTTP: SQL Over HTTP * Copyright (C) 2021, KawanSoft SAS * (http://www.kawansoft.com). All rights reserved. * * AceQL HT...
/* * This file is part of AceQL HTTP. * AceQL HTTP: SQL Over HTTP * Copyright (C) 2021, KawanSoft SAS * (http://www.kawansoft.com). All rights reserved. * * AceQL HT...
Make `samples/04_markdown_parse` Python 2+3 compatible
#!/usr/bin/env python import os.path import subprocess import sys from ebooklib import epub # This is just a basic example which can easily break in real world. if __name__ == '__main__': # read epub book = epub.read_epub(sys.argv[1]) # get base filename from the epub base_name = os.path.basename(os...
#!/usr/bin/env python import sys import subprocess import os import os.path from ebooklib import epub # This is just a basic example which can easily break in real world. if __name__ == '__main__': # read epub book = epub.read_epub(sys.argv[1]) # get base filename from the epub base_name = os.path....
Convert punctuation to pure ASCII Curly quotes, en-dashes etc. can be produced by pandoc's --smart option.
function trim(value) { return value.replace(/^\s+|\s+$/g, ""); } function asciify(str) { return str.replace(/[\u2018\u2019]/g, "'") .replace(/[\u201c\u201d]/g, '"') .replace(/\u2013/g, "--") .replace(/\u2014/g, "---") .replace(/\u2026/g, "..."); } (funct...
(function () { 'use strict'; document.addEventListener('DOMContentLoaded', function () { var instructions = document.querySelector('#instructions'); var paste_bin = document.querySelector('#paste-bin'); var output = document.querySelector('#output'); var output_wrapper = documen...
:wrench: Check for isFetching with .some
import React, { Component, PropTypes } from 'react'; import fetchData from '../../actions/fetchData'; import Toast from '../../components/Toast'; import Modals from '../Modals'; import types from '../../utils/types'; import SocketEvents from '../../utils/socketEvents'; import './Main.scss'; import MainNav from '../Mai...
import React, { Component, PropTypes } from 'react'; import fetchData from '../../actions/fetchData'; import Toast from '../../components/Toast'; import Modals from '../Modals'; import types from '../../utils/types'; import SocketEvents from '../../utils/socketEvents'; import './Main.scss'; import MainNav from '../Mai...
9623: Apply search when dismissing any popover
import React from 'react'; import PropTypes from 'prop-types'; import Button from 'react-bootstrap/Button'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; import { getButtonHintString } from '../utils'; import FilterPopover from '../FilterPopover/component'; class FilterOverlayTrigger extends React.Comp...
import React from 'react'; import PropTypes from 'prop-types'; import Button from 'react-bootstrap/Button'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; import { getButtonHintString } from '../utils'; import FilterPopover from '../FilterPopover/component'; class FilterOverlayTrigger extends React.Comp...
Replace 'basestring' by 'str' for Python 3 compatibility
import time import functools import redis class Redis(redis.Redis): class RedisSession(object): def __init__(self, redis, prefix=''): self.prefix = prefix self.redis = redis def start(self, prefix): self.prefix = prefix + ':' if prefix else '' def _...
import time import functools import redis class Redis(redis.Redis): class RedisSession(object): def __init__(self, redis, prefix=''): self.prefix = prefix self.redis = redis def start(self, prefix): self.prefix = prefix + ':' if prefix else '' def _...
Fix bug: Show Opbeat response code if error is returned
var util = require('util'); var http = require('http'); function HTTPTransport() { // Opbeat currently doesn't support HTTP this.defaultPort = 80; this.transport = http; } HTTPTransport.prototype.send = function(client, message, headers) { var options = { hostname: client.dsn.host, path...
var util = require('util'); var http = require('http'); function HTTPTransport() { // Opbeat currently doesn't support HTTP this.defaultPort = 80; this.transport = http; } HTTPTransport.prototype.send = function(client, message, headers) { var options = { hostname: client.dsn.host, path...
Upgrade method getController to accept params additional from route
<?php namespace JS\Test; use Zend\Mvc\MvcEvent; use Zend\Mvc\Router\Http\TreeRouteStack; use Zend\Mvc\Router\Console\RouteMatch; use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; abstract class JSTestControllerCase extends AbstractHttpControllerTestCase { use JSZendFunctionsTrait; public sta...
<?php namespace JS\Test; use Zend\Mvc\MvcEvent; use Zend\Mvc\Router\Http\TreeRouteStack; use Zend\Mvc\Router\Console\RouteMatch; use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; abstract class JSTestControllerCase extends AbstractHttpControllerTestCase { use JSZendFunctionsTrait; public sta...
Fix for logging incorrect region information when using instance role for authentication.
""" Handles connections to AWS """ import logging import sys from boto import ec2 from boto.utils import get_instance_metadata logger = logging.getLogger(__name__) def connect_to_ec2(region='us-east-1', access_key=None, secret_key=None): """ Connect to AWS ec2 :type region: str :param region: AWS regio...
""" Handles connections to AWS """ import logging import sys from boto import ec2 from boto.utils import get_instance_metadata logger = logging.getLogger(__name__) def connect_to_ec2(region='us-east-1', access_key=None, secret_key=None): """ Connect to AWS ec2 :type region: str :param region: AWS regio...
Set icon before calling show() to avoid warning.
import trayjenkins from PySide import QtGui from pyjenkins.Event import Event from trayjenkins.status.interfaces import IView class TrayIconView(IView): def __init__(self, parentWidget, delayInSecons): """ @type parentWidget: QtGui.QWidget """ self._statusRefreshEvent= Event() ...
import trayjenkins from PySide import QtGui from pyjenkins.Event import Event from trayjenkins.status.interfaces import IView class TrayIconView(IView): def __init__(self, parentWidget, delayInSecons): """ @type parentWidget: QtGui.QWidget """ self._statusRefreshEvent= Event() ...
Fix bugs occuring when no response is given.
import json import threading import socket import SocketServer from orderbook import asks, bids class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): def handle(self): try: while True: data = self.request.recv(1024) response = '' if...
import json import threading import socket import SocketServer from orderbook import asks, bids class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): def handle(self): try: while True: data = self.request.recv(1024) if data: res...
Use string constant from metrics-proxy to avoid duplication.
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.admin.monitoring; import ai.vespa.metricsproxy.core.VespaMetrics; import com.google.common.collect.ImmutableList; import static com.yahoo.vespa.model.admin.monitoring.Ne...
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.admin.monitoring; import com.google.common.collect.ImmutableList; import static com.yahoo.vespa.model.admin.monitoring.NetworkMetrics.networkMetricSet; import static com...
Remove round of multiplication result for get_geometric_mean and bug fix get edge weight
from itertools import combinations class ClusterUtility(object): @staticmethod def get_geometric_mean(weights): multiplication = 1 for weight in weights: multiplication = multiplication * weight gmean = 0.0 if multiplication > 0.0: k = float(len(weights...
from itertools import combinations class ClusterUtility(object): @staticmethod def get_geometric_mean(weights): multiplication = 1 for weight in weights: multiplication = multiplication * weight gmean = 0.0 multiplication = round(multiplication, 5) if multi...
Check if the 2nd param is process.argv and work well
(function() { var HashArg = {}; HashArg.get = function(argdefs, argv) { var args = {}; if(!argv || argv === process.argv) { argv = []; for(var i = 2; i < process.argv.length; i++) { argv.push(process.argv[i]); } } if(typeof(argd...
(function() { var HashArg = {}; HashArg.get = function(argdefs, argv) { var args = {}; if(!argv) { argv = []; for(var i = 2; i < process.argv.length; i++) { argv.push(process.argv[i]); } } if(typeof(argdefs) === 'string') { ...
Fix Missing Extension from package
try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('README.rst').read() requirements = { "package": [ "PyYAML", ], "test": [ "nose", "mock", "pytest", "pytest-mock", "pytest-pudb", ], "setup":...
try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('README.rst').read() requirements = { "package": [ "PyYAML", ], "test": [ "nose", "mock", "pytest", "pytest-mock", "pytest-pudb", ], "setup":...
Add more field to search
module.exports = function (models) { const { Photo, User } = models; return { searchPhotos(pattern) { var regex = new RegExp(pattern, 'i'); return new Promise((resolve, reject) => { Photo.find({ $or: [{ ...
module.exports = function (models) { const { Photo, User } = models; return { searchPhotos(pattern) { return new Promise((resolve, reject) => { Photo.find({ 'title': new RegExp(pattern, 'i') }, ...
Remove optional options from api call
import React, { Component } from "react"; import { injectGlobal } from "styled-components"; import Api from "./api"; import StoryList from "./containers/StoryList"; // eslint-disable-next-line no-unused-expressions injectGlobal` @font-face { font-family: 'Verdana, Geneva, sans-serif' } body { margin: 0; } `; cl...
import React, { Component } from "react"; import { injectGlobal } from "styled-components"; import Api from "./api"; import StoryList from "./containers/StoryList"; // eslint-disable-next-line no-unused-expressions injectGlobal` @font-face { font-family: 'Verdana, Geneva, sans-serif' } body { margin: 0; } `; cl...
Update renamed method (irrep -> decompose)
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles the "Unicode" unit format. """ from __future__ import absolute_import, division, print_function, unicode_literals from . import console class Unicode(console.Console): """ Output-only format for to display pre...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles the "Unicode" unit format. """ from __future__ import absolute_import, division, print_function, unicode_literals from . import console class Unicode(console.Console): """ Output-only format for to display pre...
:green_heart: Fix tests relying on fs spies
'use strict'; const fs = require('fs'); const GetEmail = require('../../lib/install/get-email'); describe('GetEmail', () => { let step; beforeEach(() => { step = new GetEmail(); }); describe('.start()', () => { afterEach(() => { fs.readFileSync.andCallThrough(); }); describe('when the...
'use strict'; const fs = require('fs'); const GetEmail = require('../../lib/install/get-email'); describe('GetEmail', () => { let step; beforeEach(() => { step = new GetEmail(); }); describe('.start()', () => { describe('when the user has a .gitconfig file', () => { beforeEach(() => { ...
Clear pasted URL textbox after submitting.
function(context) { var app = $$(this).app; var url = $("#pasted_url").val(); if (url.length > 0) { idPos = url.indexOf("id="); if (idPos > -1) { url = url.substr(idPos + 3); } lastSlash = url.lastIndexOf("/"); if (lastSlash > -1) { url = url.substr(lastSlash + 1); } ampPos...
function(context) { var app = $$(this).app; var url = $("#pasted_url").val(); if (url.length > 0) { idPos = url.indexOf("id="); if (idPos > -1) { url = url.substr(idPos + 3); } lastSlash = url.lastIndexOf("/"); if (lastSlash > -1) { url = url.substr(lastSlash + 1); } ampPos...
Simplify how we draw the world: operations are not additive operations anymore
(function () { "use strict"; angular .module("PLMApp") .factory("World", World); function World() { var World = function (world) { this.type = world.type; this.operations = []; this.currentState = -1; this.steps = []; this.width = world.width; this.height = worl...
(function () { "use strict"; angular .module("PLMApp") .factory("World", World); function World() { var World = function (world) { this.type = world.type; this.operations = []; this.currentState = -1; this.steps = []; this.width = world.width; this.height = worl...
Add a --target argument and make trailling arguments context dependant
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- from __future__ import print_function from __future__ import unicode_literals import argparse DEFAULT_CONFIG_FILE = '~/.config/xmrc' def _new_argument_parser(): parser = argparse.ArgumentParser( description='Build the appropriate make command' ) ...
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- from __future__ import print_function from __future__ import unicode_literals import argparse DEFAULT_CONFIG_FILE = '~/.config/xmrc' def _new_argument_parser(): parser = argparse.ArgumentParser( description='Build the appropriate make command' ) ...
Comment out failing check. See GH-199.
import attr import pytest from eli5.base_utils import attrs def test_attrs_with_default(): @attrs class WithDefault(object): def __init__(self, x, y=1): self.x = x self.y = y x_attr, y_attr = attr.fields(WithDefault) assert x_attr.name == 'x' assert y_attr.name =...
import attr import pytest from eli5.base_utils import attrs def test_attrs_with_default(): @attrs class WithDefault(object): def __init__(self, x, y=1): self.x = x self.y = y x_attr, y_attr = attr.fields(WithDefault) assert x_attr.name == 'x' assert y_attr.name =...
Use the configured storage/ path
<?php /** * Brings Twig to Laravel. * * @author Rob Crowe <hello@vivalacrowe.com> * @license MIT */ namespace TwigBridge\Console; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; /** * Remove compiled Twig templates. */ class CleanCommand extends Command { /** * The console comm...
<?php /** * Brings Twig to Laravel. * * @author Rob Crowe <hello@vivalacrowe.com> * @license MIT */ namespace TwigBridge\Console; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; /** * Remove compiled Twig templates. */ class CleanCommand extends Command { /** * The console comm...
Debug statement used the wrong variable.
''' Return data to a Cassandra ColumFamily Here's an example Keyspace/ColumnFamily setup that works with this returner:: create keyspace salt; use salt; create column family returns with key_validation_class='UTF8Type' and comparator='UTF8Type' and default_validation_class='UTF8Type'; ''...
''' Return data to a Cassandra ColumFamily Here's an example Keyspace/ColumnFamily setup that works with this returner:: create keyspace salt; use salt; create column family returns with key_validation_class='UTF8Type' and comparator='UTF8Type' and default_validation_class='UTF8Type'; ''...
Fix a bug when you try to add a geo tag to an object that does not have already one
from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from geotagging.models import Point def add_edit_point(request, cont...
from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.contenttypes.models import ContentType from geotagging.models import Point def add_edit_point(request, content_type_id, object_id, template=Non...
Correct game.tick() implementation and pass failing test
package net.gpdev.gameoflife; public class GameOfLife { private final int xDim; private final int yDim; private Grid current; private Grid next; public GameOfLife(int xDim, int yDim) { this.xDim = xDim; this.yDim = yDim; current = new Grid(xDim, yDim); next = new G...
package net.gpdev.gameoflife; public class GameOfLife { private final int xDim; private final int yDim; private Grid current; private Grid next; public GameOfLife(int xDim, int yDim) { this.xDim = xDim; this.yDim = yDim; current = new Grid(xDim, yDim); next = new G...
Add fields `archived` and `description` See #9
/** * Show model * @module models/Show */ /** * Show model - create and export the database model for shows * including all assosiations and classmethods assiciated with this model. * @memberof module:models/Post * @param {Object} sequelize description * @param {Object} DataTypes description */ export default funct...
/** * Show model * @module models/Show */ /** * Show model - create and export the database model for shows * including all assosiations and classmethods assiciated with this model. * @memberof module:models/Post * @param {Object} sequelize description * @param {Object} DataTypes description */ export default funct...
Make sure to return null for anonymous users
package io.quarkus.resteasy.runtime.standalone; import java.security.Principal; import javax.ws.rs.core.SecurityContext; import io.quarkus.security.identity.CurrentIdentityAssociation; import io.quarkus.security.identity.SecurityIdentity; import io.quarkus.vertx.http.runtime.security.QuarkusHttpUser; import io.vertx...
package io.quarkus.resteasy.runtime.standalone; import java.security.Principal; import javax.ws.rs.core.SecurityContext; import io.quarkus.security.identity.CurrentIdentityAssociation; import io.quarkus.security.identity.SecurityIdentity; import io.quarkus.vertx.http.runtime.security.QuarkusHttpUser; import io.vertx...
Add check to ensure second argument is an integer
<?php namespace DMS\Bundle\TwigExtensionBundle\Twig\Date; /** * Adds support for Padding a String in Twig */ class PadStringExtension extends \Twig_Extension { /** * Name of Extension * * @return string */ public function getName() { return 'PadStringExtension'; } /**...
<?php namespace DMS\Bundle\TwigExtensionBundle\Twig\Date; /** * Adds support for Padding a String in Twig */ class PadStringExtension extends \Twig_Extension { /** * Name of Extension * * @return string */ public function getName() { return 'PadStringExtension'; } /**...
Fix user image disaplay on navbar
<div class="f collapse" id="navbar-collapse-main"> <ul class="nav navbar-nav st"> <li> <a href="#">Profile</a> </li> <li> <a data-toggle="modal" href="index.html#msgModal">Messages</a> </li> </ul> <ul class="nav navbar-nav oh ald st"> <li> ...
<div class="f collapse" id="navbar-collapse-main"> <ul class="nav navbar-nav st"> <li> <a href="#">Profile</a> </li> <li> <a data-toggle="modal" href="index.html#msgModal">Messages</a> </li> </ul> <ul class="nav navbar-nav oh ald st"> <li> ...
Bring back the post button.
Hummingbird.PostCommentComponent = Ember.Component.extend({ classNames: ["status-update-panel"], didInsertElement: function() { var self = this; this.$(".status-form").focus(function() { self.$(".status-form").autosize({append: "\n"}); self.$(".panel-footer").slideDown(200); }); this.$(...
Hummingbird.PostCommentComponent = Ember.Component.extend({ classNames: ["status-update-panel"], didInsertElement: function() { this.$(".status-form").focus(function() { self.$(".status-form").autosize({append: "\n"}); self.$(".panel-footer").slideDown(200); }); this.$(".status-form").blur(...
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:...
Update TreeTime dep link now that the py3 branch is merged
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywo...
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywo...
Check if it is None before continuing
from discord.ext import commands from .utils import checks import asyncio import discord import web.wsgi from django.utils import timezone from django.db import models from django.utils import timezone from gaming.models import DiscordUser, Game, GameUser, Server, Role, GameSearch, Channel class GamingTasks: def...
from discord.ext import commands from .utils import checks import asyncio import discord import web.wsgi from django.utils import timezone from django.db import models from django.utils import timezone from gaming.models import DiscordUser, Game, GameUser, Server, Role, GameSearch, Channel class GamingTasks: def...
Use proper index in indexer.
<?php namespace Gielfeldt\TransactionalPHP; /** * Class Indexer * * @package Gielfeldt\TransactionalPHP */ class Indexer { /** * @var int[] */ protected $index = []; /** * @var Connection */ protected $connection; /** * Indexer constructor. * * @param Conne...
<?php namespace Gielfeldt\TransactionalPHP; /** * Class Indexer * * @package Gielfeldt\TransactionalPHP */ class Indexer { /** * @var int[] */ protected $index = []; /** * @var Connection */ protected $connection; /** * Indexer constructor. * * @param Conne...
Fix the bug people unable to recommend an article.
'use strict'; // TODO(mkhatib): Write tests. angular.module('webClientApp') .directive('recommendButton', ['$rootScope', 'ArticleRecommendation', function ($rootScope, ArticleRecommendation) { var getUserRecommendation = function(article, recommendations) { if ($rootScope.currentUser) { for (var ...
'use strict'; // TODO(mkhatib): Write tests. angular.module('webClientApp') .directive('recommendButton', ['ArticleRecommendation', function (ArticleRecommendation) { var getUserRecommendation = function(article, recommendations) { for (var i=0; i < recommendations.length ; i++) { if (article.id ...
Move cursor left on function completion.
'use babel'; import {filter} from 'fuzzaldrin'; import commands from './commands'; import variables from './variables'; export const selector = '.source.cmake'; export const disableForSelector = '.source.cmake .comment'; export const inclusionPriority = 1; function existy(value) { return value != null; } functi...
'use babel'; import {filter} from 'fuzzaldrin'; import commands from './commands'; import variables from './variables'; export const selector = '.source.cmake'; export const disableForSelector = '.source.cmake .comment'; export const inclusionPriority = 1; function existy(value) { return value != null; } functi...
Allow only one simultaneous command.
$(document).ready(function () { $.each($(".lightcontrol-btn"), function() { $(this).data("original-color", $(this).css("background-color")); $(this).data("original-classes", $(this).children().attr("class")); $(this).on("click", function () { var main_elem = $(this); if (main_elem.data("runni...
$(document).ready(function () { $.each($(".lightcontrol-btn"), function() { $(this).data("original-color", $(this).css("background-color")); $(this).on("click", function () { var main_elem = $(this); var original_classes = main_elem.children().attr("class"); var command = main_elem.dat...
Convert Non-strict to strict equality checking Convert non-strict equality checking, using `==`, to the strict version, using `===`.
var command = { command: "console", description: "Run a console with contract abstractions and commands available", builder: {}, help: { usage: "truffle console [--network <name>] [--verbose-rpc]", options: [ { option: "--network <name>", description: "Specify the net...
var command = { command: "console", description: "Run a console with contract abstractions and commands available", builder: {}, help: { usage: "truffle console [--network <name>] [--verbose-rpc]", options: [ { option: "--network <name>", description: "Specify the net...
Make server respond with the list of dishes
var db = require('./db'); var bluebird = require('bluebird'); //promise library, will have to think more about it var helpers = require('./helpers.js') module.exports = { '/': { get: function (req, res) { res.redirect('/explore'); }, post: function (req, res) { } }, explore: { get: f...
var db = require('./db'); var bluebird = require('bluebird'); //promise library, will have to think more about it var helpers = require('./helpers.js') module.exports = { '/': { get: function (req, res) { res.redirect('/pictures'); }, post: function (req, res) { } }, pictures: { get:...
Add on_delete args to CMS plugin migration for Django 2 support
# -*- coding: utf-8 -*- from __future__ import unicode_literals import cms from django.db import migrations, models from pkg_resources import parse_version as V # Django CMS 3.3.1 is oldest release where the change affects. # Refs https://github.com/divio/django-cms/commit/871a164 if V(cms.__version__) >= V('3.3.1'):...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import cms from django.db import migrations, models from pkg_resources import parse_version as V # Django CMS 3.3.1 is oldest release where the change affects. # Refs https://github.com/divio/django-cms/commit/871a164 if V(cms.__version__) >= V('3.3.1'):...
Make color easier to read
import pygame class Graphic: car_color = (255, 50, 50) car_width = 3 road_color = (255, 255, 255) road_width = 6 draw_methods = { 'Car': 'draw_car', 'Road': 'draw_road', } def __init__(self, surface): self.surface = surface def draw(self, obj): object_...
import pygame class Graphic: car_color = (255, 50, 50) car_width = 3 road_color = (255, 255, 255) road_width = 6 draw_methods = { 'Car': 'draw_car', 'Road': 'draw_road', } def __init__(self, surface): self.surface = surface def draw(self, obj): object_...
Add ability to convert JS interpolater to an array This is used when writing interpolator values to the python server
class Interpolator { constructor() { this.data = []; } addIndexValue(index, value) { this.data.push({index: index, value: value}); // make sure items are in ascdending order by index //this.data.sort((a, b) => a.index - b.index); } valueAtIndex(target_index) { ...
class Interpolator { constructor() { this.data = []; } addIndexValue(index, value) { this.data.push({index: index, value: value}); // make sure items are in ascdending order by index //this.data.sort((a, b) => a.index - b.index); } valueAtIndex(target_index) { ...
Add requests to the requirements
#!/usr/bin/env python import os import sys from setuptools import setup if "publish" in sys.argv[-1]: os.system("python setup.py sdist upload -r pypi") sys.exit() elif "testpublish" in sys.argv[-1]: os.system("python setup.py sdist upload -r pypitest") sys.exit() # Load the __version__ variable withou...
#!/usr/bin/env python import os import sys from setuptools import setup if "publish" in sys.argv[-1]: os.system("python setup.py sdist upload -r pypi") sys.exit() elif "testpublish" in sys.argv[-1]: os.system("python setup.py sdist upload -r pypitest") sys.exit() # Load the __version__ variable withou...
Remove unused module namespace from require config.
(function () { 'use strict'; // Initialise RequireJS module loader require.config({ urlArgs: 'm=' + (new Date()).getTime(), baseUrl: '/app/', paths: { // RequireJS extensions text: '../lib/text/text', // Vendor libraries knockout: '.....
(function () { 'use strict'; // Initialise RequireJS module loader require.config({ urlArgs: 'm=' + (new Date()).getTime(), baseUrl: '/app/', paths: { // RequireJS extensions text: '../lib/text/text', // Vendor libraries knockout: '.....
Allow clicking anywhere in row to toggle checkbox
<table class="table table-striped"> <tbody> @foreach($lanGames as $lanGame) @can('view', $lanGame) @php if (Auth::user()) { $voted = $lanGame->votes->where('user_id',Auth::user()->id)->count(); } else { $voted = false; ...
<table class="table table-striped"> <tbody> @foreach($lanGames as $lanGame) @can('view', $lanGame) @php if (Auth::user()) { $voted = $lanGame->votes->where('user_id',Auth::user()->id)->count(); } else { $voted = false; ...
Add redirect_uri as config parameter
VK = {}; VK.requestCredential = function (options, credentialRequestCompleteCallback) { if (!credentialRequestCompleteCallback && typeof options === 'function') { credentialRequestCompleteCallback = options; options = {}; } var config = ServiceConfiguration.configurations.findOne({service...
VK = {}; VK.requestCredential = function (options, credentialRequestCompleteCallback) { if (!credentialRequestCompleteCallback && typeof options === 'function') { credentialRequestCompleteCallback = options; options = {}; } var config = ServiceConfiguration.configurations.findOne({service...
Revert "Fix merging engine/template vars" This reverts commit 5e734479094e270bc3abb7d6ebf752fad95576b0.
<?php namespace Colorium\Templating; class Templater implements Contract\TemplaterInterface { /** @var string */ public $directory; /** @var string */ public $suffix = '.php'; /** @var array */ public $vars = []; /** @var array */ public $helpers = []; /** * Create new en...
<?php namespace Colorium\Templating; class Templater implements Contract\TemplaterInterface { /** @var string */ public $directory; /** @var string */ public $suffix = '.php'; /** @var array */ public $vars = []; /** @var array */ public $helpers = []; /** * Create new en...
Use correct keys for measurement & label
import React, { Component } from 'react'; import Chart from 'chart.js'; class ChartComponent extends Component { componentDidMount() { this.renderChart(this.props.measurement.measurements); } componentWillUpdate(nextProps) { if (nextProps.measurement.createdAt !== this.props.measurement.createdAt) { ...
import React, { Component } from 'react'; import Chart from 'chart.js'; class ChartComponent extends Component { componentDidMount() { this.renderChart(this.props.measurement.measurements); } componentWillUpdate(nextProps) { if (nextProps.measurement.createdAt !== this.props.measurement.createdAt) { ...
Remove extension conflict between Twig and Smarty
<?php namespace Brendt\Stitcher\Template\Smarty; use \Smarty; use Brendt\Stitcher\Template\TemplateEngine; use Symfony\Component\Finder\SplFileInfo; /** * The Smarty template engine. */ class SmartyEngine extends Smarty implements TemplateEngine { public function __construct($templateDir = './src', $cacheDir =...
<?php namespace Brendt\Stitcher\Template\Smarty; use \Smarty; use Brendt\Stitcher\Template\TemplateEngine; use Symfony\Component\Finder\SplFileInfo; /** * The Smarty template engine. */ class SmartyEngine extends Smarty implements TemplateEngine { public function __construct($templateDir = './src', $cacheDir =...
Include channel list in connection
from sockjs.tornado import SockJSConnection from ..pubsub_providers.redis_pubsub_provider import RedisPubSubProvider from .. import route_handler import json pub_sub = RedisPubSubProvider() class ConnectionMixin(object): def to_json(self, data): if isinstance(data, dict): return data ...
from sockjs.tornado import SockJSConnection from ..pubsub_providers.redis_pubsub_provider import RedisPubSubProvider from .. import route_handler import json pub_sub = RedisPubSubProvider() class ConnectionMixin(object): def to_json(self, data): if isinstance(data, dict): return data ...
Exclude addon-test-support from eslint node files This PR adds `addon-test-support` folder to excluded files from eslint override for node files. Fixes #7652
module.exports = { root: true, parserOptions: { ecmaVersion: 2017, sourceType: 'module' }, plugins: [ 'ember' ], extends: [ 'eslint:recommended', 'plugin:ember/recommended' ], env: { browser: true }, rules: { }, overrides: [ // node files { files: [<% if (bl...
module.exports = { root: true, parserOptions: { ecmaVersion: 2017, sourceType: 'module' }, plugins: [ 'ember' ], extends: [ 'eslint:recommended', 'plugin:ember/recommended' ], env: { browser: true }, rules: { }, overrides: [ // node files { files: [<% if (bl...
Fix how we check for Windows in platform_libname.
# -*- coding: utf-8 -*- import ctypes import ctypes.util import os import sys def find_libc(): if sys.platform == 'win32': return ctypes.util.find_msvcrt() else: return ctypes.util.find_library('c') def load_library(name): lname = platform_libname(name) sdirs = platform_libdirs() ...
# -*- coding: utf-8 -*- import ctypes import ctypes.util import os import sys def find_libc(): if sys.platform == 'win32': return ctypes.util.find_msvcrt() else: return ctypes.util.find_library('c') def load_library(name): lname = platform_libname(name) sdirs = platform_libdirs() ...
Make cleanup command less verbose
# coding=utf-8 from django.core.management.base import BaseCommand from registration.models import RegistrationProfile class Command(BaseCommand): help = 'Cleanup expired registrations' OPT_SIMULATE = 'dry-run' def add_arguments(self, parser): parser.add_argument(''.join(['--', self.OPT_SIMULAT...
# coding=utf-8 from django.core.management.base import BaseCommand from registration.models import RegistrationProfile class Command(BaseCommand): help = 'Cleanup expired registrations' OPT_SIMULATE = 'dry-run' def add_arguments(self, parser): parser.add_argument(''.join(['--', self.OPT_SIMULAT...
Add lsst-dd-rtd-theme as explicit dependency This is needed since lsst-dd-rtd-theme is configured via the ddconfig module. I'm pinning the theme version to 0.1 so that documenteer's version effectively controls the version of the theme as well.
from setuptools import setup, find_packages import os packagename = 'documenteer' description = 'Tools for LSST DM documentation projects' author = 'Jonathan Sick' author_email = 'jsick@lsst.org' license = 'MIT' url = 'https://github.com/lsst-sqre/documenteer' version = '0.1.7' def read(filename): full_filename...
from setuptools import setup, find_packages import os packagename = 'documenteer' description = 'Tools for LSST DM documentation projects' author = 'Jonathan Sick' author_email = 'jsick@lsst.org' license = 'MIT' url = 'https://github.com/lsst-sqre/documenteer' version = '0.1.7' def read(filename): full_filename...
Make exception message builder a nicer function It is used by clients in other modules.
""" Very basic implementation of an event loop ========================================== The eventloop is a singleton to schedule and run events. Exports ------- - ``EventLoop``: the basic eventloop """ import queue import sys import threading import time import traceback from .singleton import Singleton def ...
""" Very basic implementation of an event loop ========================================== The eventloop is a singleton to schedule and run events. Exports ------- - ``EventLoop``: the basic eventloop """ import queue import sys import threading import time import traceback from .singleton import Singleton def ...