text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Move import statements into the transform function | // requirish
// Copyright 2014 Enrico Stara 'enrico.stara@gmail.com'
// Released under the MIT License
// https://github.com/enricostara/require-mainify
// The require('...') regular expression
var requireRegExp = /require\s*\(\s*(["'])(.*?)\1\s*\)\s*/g;
// The transform function
module.exports = funct... | // requirish
// Copyright 2014 Enrico Stara 'enrico.stara@gmail.com'
// Released under the MIT License
// https://github.com/enricostara/require-mainify
// Import dependencies
var path = require('path');
var through = require('through2');
var resolve = require('resolve');
// The require('...') regular... |
Refactor email task variable names | from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max_retries=3)
def... | from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max_retries=3)
def... |
Add a submitted value to the form | app.controller('LoginCtrl', ['$scope', '$log', '$route', 'User',
function($scope, $log, $route, User) {
$scope.loginForm = {};
$scope.errors = {};
$scope.login = function() {
$log.debug('Setting all the form fields to $dirty...');
angular.forEach($scope.form, functi... | app.controller('LoginCtrl', ['$scope', '$log', '$route', 'User',
function($scope, $log, $route, User) {
$scope.loginForm = {};
$scope.errors = {};
$scope.login = function() {
$log.debug('Setting all the form fields to $dirty...');
angular.forEach($scope.form, functi... |
Revert to dto in one-string requests. | package com.royalrangers.controller;
import com.royalrangers.dto.ResponseResult;
import com.royalrangers.dto.user.EmailDto;
import com.royalrangers.service.SubscribeService;
import com.royalrangers.utils.ResponseBuilder;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springfra... | package com.royalrangers.controller;
import com.royalrangers.dto.ResponseResult;
import com.royalrangers.dto.user.EmailDto;
import com.royalrangers.service.SubscribeService;
import com.royalrangers.utils.ResponseBuilder;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springfra... |
Use 30s timeout in waitfor function in case things happen slower than they should | /**
* @fileoverview Run the bootstrap service
*/
var port = 3020,
system = require('system'),
page = require('webpage').create(),
serverObj = require('./server').create(port),
util = require('./util'),
module = system.args[1],
config = system.args[2];
if (!module) {
console.error('missin... | /**
* @fileoverview Run the bootstrap service
*/
var port = 3020,
system = require('system'),
page = require('webpage').create(),
serverObj = require('./server').create(port),
util = require('./util'),
module = system.args[1],
config = system.args[2];
if (!module) {
console.error('missin... |
Tweak to make sorting work when two objects have same name. | package com.quollwriter.data.comparators;
import java.util.*;
import com.quollwriter.data.*;
public class ChapterItemSorter implements Comparator<ChapterItem>
{
public int compare (ChapterItem o1,
ChapterItem o2)
{
/*
if (o1.getKey () == null)
{
... | package com.quollwriter.data.comparators;
import java.util.*;
import com.quollwriter.data.*;
public class ChapterItemSorter implements Comparator<ChapterItem>
{
public int compare (ChapterItem o1,
ChapterItem o2)
{
/*
if (o1.getKey () == null)
{
... |
Fix declaration in case block | import makeDebug from 'debug';
import fp from 'mostly-func';
import { getItems } from 'feathers-hooks-common';
const debug = makeDebug('mostly:feathers-mongoose:hooks:cache');
const defaultOptions = {
idField: 'id',
};
export default function (cacheMap, opts) {
opts = Object.assign({}, defaultOptions, opts);
... | import makeDebug from 'debug';
import fp from 'mostly-func';
import { getItems } from 'feathers-hooks-common';
const debug = makeDebug('mostly:feathers-mongoose:hooks:cache');
const defaultOptions = {
idField: 'id',
};
export default function (cacheMap, opts) {
opts = Object.assign({}, defaultOptions, opts);
... |
[libdotify] Fix path creation/git detection bugs | import os
import shlex
import logging
import subprocess
import contextlib
@contextlib.contextmanager
def cd(newdir):
prevdir = os.getcwd()
os.chdir(os.path.expanduser(newdir))
try:
yield
finally:
os.chdir(prevdir)
def execute(cmd):
args = shlex.split(cmd)
p = subprocess.Popen(a... | import os
import shlex
import logging
import subprocess
import contextlib
@contextlib.contextmanager
def cd(newdir):
prevdir = os.getcwd()
os.chdir(os.path.expanduser(newdir))
try:
yield
finally:
os.chdir(prevdir)
def execute(cmd):
args = shlex.split(cmd)
p = subprocess.Popen(a... |
Sort import statements in another file | from ..auth_provider import KnowledgeAuthProvider
from ..models import User
from flask import (
redirect,
render_template,
request,
url_for,
)
from ldap3 import Server, Connection, ALL
class LdapAuthProvider(KnowledgeAuthProvider):
_registry_keys = ['ldap']
def init(self):
if not sel... | from flask import request, render_template, redirect, url_for
from ldap3 import Server, Connection, ALL
from ldap3.core.exceptions import LDAPSocketOpenError
from ..models import User
from ..auth_provider import KnowledgeAuthProvider
class LdapAuthProvider(KnowledgeAuthProvider):
_registry_keys = ['ldap']
d... |
Fix a bug of undefinded variable | <?php
namespace Vinala\Kernel\Process;
use Vinala\Kernel\Filesystem\File;
/**
* Model class.
*/
class Model extends Process
{
public static function create($class, $table, $rt = null)
{
$class = ucfirst($class);
$file = $class;
$root = is_null($rt) ? Process::root : $rt;
... | <?php
namespace Vinala\Kernel\Process;
use Vinala\Kernel\Filesystem\File;
/**
* Model class.
*/
class Model extends Process
{
public static function create($class, $table, $rt = null)
{
$class = ucfirst($class);
$file = $class;
$root = is_null($rt) ? Process::root : $rt;
... |
FIX Late static binding in config property for max age | <?php
/**
* Abstract controller for actions that provide an API endpoint.
*/
abstract class ApiController extends Controller
{
/**
* Given a result payload, format as a JSON response and return
*
* @param array $data
* @return SS_HTTPResponse
*/
protected function formatResponse(arra... | <?php
/**
* Abstract controller for actions that provide an API endpoint.
*/
abstract class ApiController extends Controller
{
/**
* Given a result payload, format as a JSON response and return
*
* @param array $data
* @return SS_HTTPResponse
*/
protected function formatResponse(arra... |
Add missing dependency on Pillow | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
'pyzmq',
'docopt',
'virtualenv',
'requests',
'Pillow',
]
setup(
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
'pyzmq',
'docopt',
'virtualenv',
'requests'
]
setup(
name='tingbot... |
Fix database backends analyzer: 'postgresql' backend has been deprecated in 1.2 | import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
if node.s ... | import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
if node.s ... |
Add unit test to determine if the classes ExamineExe and ExamineSnap will work properly.
Fixed a bug `assert len(record) == 1` in 'test_not_exception' method in class `TestExamineExe`. | from contextlib import contextmanager
import pytest
from pyroSAR._dev_config import ExamineExe
from pyroSAR.snap.auxil import ExamineSnap
@contextmanager
def not_raises(ExpectedException):
try:
yield
except ExpectedException:
raise AssertionError(
"Did raise exception {0} when i... | import pytest
from contextlib import contextmanager
from pyroSAR._dev_config import ExamineExe
from pyroSAR.snap.auxil import ExamineSnap
@contextmanager
def not_raises(ExpectedException):
try:
yield
except ExpectedException:
raise AssertionError(
"Did raise exception {0} when it s... |
Add tracking category when uploading with a Campaign
Change-Id: I0790fc499c0b4960590f03222a1738cc72d7b173 | package org.wikimedia.commons.campaigns;
import android.net.Uri;
import org.wikimedia.commons.contributions.Contribution;
import java.util.ArrayList;
import java.util.Date;
public class CampaignContribution extends Contribution {
private Campaign campaign;
private ArrayList<String> fieldValues;
public... | package org.wikimedia.commons.campaigns;
import android.net.Uri;
import org.wikimedia.commons.contributions.Contribution;
import java.util.ArrayList;
import java.util.Date;
public class CampaignContribution extends Contribution {
private Campaign campaign;
private ArrayList<String> fieldValues;
public... |
[Admin] Improve the shipment ship form | (function($) {
$.fn.extend({
requireConfirmation: function() {
return this.each(function() {
return $(this).on('click', function(event) {
event.preventDefault();
var actionButton = $(this);
if (actionButton.is('a')) {
$('#confirmation-button').attr('href',... | (function($) {
$.fn.extend({
requireConfirmation: function() {
return this.each(function() {
return $(this).on('click', function(event) {
event.preventDefault();
var actionButton = $(this);
if (actionButton.is('a')) {
$('#confirmation-button').attr('href',... |
Resolve session from container, not from request. | <?php
namespace FluxBB\Auth;
use FluxBB\Core;
use Illuminate\Auth\EloquentUserProvider;
use Illuminate\Auth\Guard;
use Illuminate\Support\ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register(... | <?php
namespace FluxBB\Auth;
use FluxBB\Core;
use Illuminate\Auth\EloquentUserProvider;
use Illuminate\Auth\Guard;
use Illuminate\Support\ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register(... |
Reduce scope of method (used in tests only). | package no.deichman.services.utils;
import no.deichman.services.repository.Repository;
import no.deichman.services.uridefaults.BaseURI;
import org.apache.commons.lang3.RandomStringUtils;
public class UniqueURI {
public static final int NO_OF_DIGITS = 12;
private String getRandom() {
return RandomStr... | package no.deichman.services.utils;
import no.deichman.services.repository.Repository;
import no.deichman.services.uridefaults.BaseURI;
import org.apache.commons.lang3.RandomStringUtils;
public class UniqueURI {
public static final int NO_OF_DIGITS = 12;
private String getRandom() {
return RandomStr... |
Test if `__distarray__()['buffer']` returns a buffer. | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... |
Improve destroy method to actually catch calls / read of destroy objects properties / methods | (function(exports) {
// Dependencies -----------------------------------------------------------
var Class = require('./Class').Class,
is = require('./is').is;
// Implementation ---------------------------------------------------------
var Base = Class(function(id) {
if (id !== undef... | (function(exports) {
// Dependencies -----------------------------------------------------------
var Class = require('./Class').Class,
is = require('./is').is;
// Implementation ---------------------------------------------------------
var Base = Class(function(id) {
if (id !== undef... |
Use the docstring as the CLI description. | #!/usr/bin/env python
# pylint: disable=import-error
"""A CLI tool for generating files from Jinja2 templates and environment
variables."""
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
) # pylint: disable=duplicate-code
from os import environ
from sys import st... | #!/usr/bin/env python
# pylint: disable=import-error
"""Generate files from Jinja2 templates and environment variables."""
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
) # pylint: disable=duplicate-code
from os import environ
from sys import stdin, stdout
impor... |
Update unit tests to work with compact hash format added in d192cc4 | <?php
class HashPathExtensionTest extends PHPUnit_Framework_TestCase
{
public function testHashFile()
{
$hashPath = new HashPathExtension();
$this->assertEquals(
'L32cPgz9Rj8qwwSRHsr8A',
$hashPath->HashFile(
__DIR__ . '/test.txt',
false... | <?php
class HashPathExtensionTest extends PHPUnit_Framework_TestCase
{
public function testHashFile()
{
$hashPath = new HashPathExtension();
$this->assertEquals(
'2f7d9c3e0cfd47e8fcab0c12447b2bf0',
$hashPath->HashFile(
__DIR__ . '/test.txt',
... |
Include luhn package update version 1.0.1 |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Luhn Algorithm Validator -- long description
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='luhn_algorithm_val... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Luhn Algorithm Validator -- long description
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='luhn_algorithm_val... |
Add paste and pymongo dependencies | #!/usr/bin/python
from setuptools import setup, find_packages
EXTRAS_REQUIRES = dict(
web=[
'bottle>=0.11',
'paste>=1.7.5.1',
],
mongo=[
'pymongo>=2.3',
],
test=[
'pytest>=2.2.4',
'mock>=0.8.0',
],
dev=[
'ipython>=0.13',
],
)
... | #!/usr/bin/python
from setuptools import setup, find_packages
EXTRAS_REQUIRES = dict(
web=[
'bottle>=0.11',
],
test=[
'pytest>=2.2.4',
'mock>=0.8.0',
],
dev=[
'ipython>=0.13',
],
)
# Tests always depend on all other requirements, except dev
for k... |
Fix up the 2FA login form | @extends('layout.clean')
@section('content')
<div class="login">
<div class="col-xs-12 col-xs-offset-0 col-sm-6 col-sm-offset-3 col-md-4 col-md-offset-4 text-center">
<div class="welcome-logo">
<img class="logo" height="50" src="{{ url('img/cachet-logo.svg') }}" alt="Cachet">
... | @extends('layout.clean')
@section('content')
<div class="login">
<div class="col-xs-12 col-xs-offset-0 col-sm-6 col-sm-offset-3 col-md-4 col-md-offset-4 text-center">
<div class="welcome-logo">
<img class="logo" height="50" src="{{ url('img/cachet-logo.svg') }}" alt="Cachet">
... |
Remove logging statment used for debugging. | package foam.lib.json;
import foam.lib.parse.*;
public class FObjectParser extends ProxyParser {
public FObjectParser() {
super(new Seq1(7,
new Whitespace(),
new Literal("{"),
new Whitespace(),
new KeyParser("class"),
... | package foam.lib.json;
import foam.lib.parse.*;
public class FObjectParser extends ProxyParser {
public FObjectParser() {
super(new Seq1(7,
new Whitespace(),
new Literal("{"),
new Whitespace(),
new KeyParser("class"),
... |
Use js `equal value and equal type` when comparing meetingId | // @flow
import { Meeting } from '../actions/ActionTypes';
import { createSelector } from 'reselect';
import createEntityReducer from 'app/utils/createEntityReducer';
export default createEntityReducer({
key: 'meetings',
types: {
fetch: Meeting.FETCH,
mutate: Meeting.CREATE
},
mutate(state, action) {
... | // @flow
import { Meeting } from '../actions/ActionTypes';
import { createSelector } from 'reselect';
import createEntityReducer from 'app/utils/createEntityReducer';
export default createEntityReducer({
key: 'meetings',
types: {
fetch: Meeting.FETCH,
mutate: Meeting.CREATE
},
mutate(state, action) {
... |
jf-vscroll: Use one time watch, instead of timeout to init element height init | export function jfVScrollElement($compile) {
return {
restrict: 'E',
scope: {
data: '=',
template: '=',
variable: '=',
index: '=',
vscroll: '='
},
template: '<div class="compile-placeholder"></div>',
controller: jfVS... | export function jfVScrollElement($compile) {
return {
restrict: 'E',
scope: {
data: '=',
template: '=',
variable: '=',
index: '=',
vscroll: '='
},
template: '<div class="compile-placeholder"></div>',
controller: jfVS... |
Use protocol-agnostic URL for webapp
issue: #1 | (function() {
"use strict";
var xkcdUrl = "http://xkcd.com";
var appUrl = "//xkcd-imgs.herokuapp.com/";
var btns = document.getElementsByClassName("xkcd-refresh");
var divs = document.getElementsByClassName("xkcd-img");
var imgUrl;
var imgTitle;
function xkcdGet() {
/**
* Retrieving a URL to a... | (function() {
"use strict";
var xkcdUrl = "http://xkcd.com";
var appUrl = "http://xkcd-imgs.herokuapp.com/";
var btns = document.getElementsByClassName("xkcd-refresh");
var divs = document.getElementsByClassName("xkcd-img");
var imgUrl;
var imgTitle;
function xkcdGet() {
/**
* Retrieving a URL... |
Load tld files completely async | 'use babel';
import fs from 'fs';
import readInTld from '../readInTld';
import {add as addToRegistry} from '../registry';
export function register() {
const userHome = process.env[process.platform === 'win32' ? 'USERPROFILE' : 'HOME'];
const tldSources = atom.config.get('autocomplete-jsp.tldSources');
/... | 'use babel';
import fs from 'fs';
import readInTld from '../readInTld';
import {add as addToRegistry} from '../registry';
export function register() {
const userHome = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
let tldPathes = [];
// TODO: refresh on config change
atom.con... |
Add parameter to allow for output xml flag | package org.eobjects.build;
import java.io.File;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Parameter;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
publ... | package org.eobjects.build;
import java.io.File;
import org.apache.maven.plugin.MojoFailureException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
public abstract class AbstractDotnetTestMojo extends Abstra... |
Change type check in encode to ctype_digit() for greater compatibility | <?php
namespace Bijective;
/**
* @author Brian Freytag <brian@idltg.in>
*/
class BijectiveTranslator implements BijectiveInterface
{
/** @var string */
private $alphabet;
/**
* @param $alphabet
*/
public function __construct($alphabet)
{
$this->alphabet = $alphabet;
}
... | <?php
namespace Bijective;
/**
* @author Brian Freytag <brian@idltg.in>
*/
class BijectiveTranslator implements BijectiveInterface
{
/** @var string */
private $alphabet;
/**
* @param $alphabet
*/
public function __construct($alphabet)
{
$this->alphabet = $alphabet;
}
... |
Increase code coverage on FrequencyTransformer | <?php
namespace Recurrence\tests\units\RruleTransformer;
require_once __DIR__.'/../../../../src/Recurrence/RruleTransformer/FreqTransformer.php';
use atoum;
/**
* Class FreqTransformer
* @package Recurrence\tests\units\RruleTransformer
*/
class FreqTransformer extends atoum
{
/**
* Failed : Missing freq... | <?php
namespace Recurrence\tests\units\RruleTransformer;
require_once __DIR__.'/../../../../src/Recurrence/RruleTransformer/FreqTransformer.php';
use atoum;
/**
* Class FreqTransformer
* @package Recurrence\tests\units\RruleTransformer
*/
class FreqTransformer extends atoum
{
/**
* Failed : Missing freq... |
Put new lines here and there | const path = require('path');
const should = require('should');
const pluginsLoader = require('../../lib/plugins');
// Caching fixture plugin, but redefining its properties for testing plugin load.
const pluginName = 'express-gateway-plugin-test';
const pluginDirectory = path.join(__dirname, '../fixtures', pluginName... | const path = require('path');
const should = require('should');
const pluginsLoader = require('../../lib/plugins');
// Caching fixture plugin, but redefining its properties for testing plugin load.
const pluginName = 'express-gateway-plugin-test';
const pluginDirectory = path.join(__dirname, '../fixtures', pluginName... |
Fix typo that raises KeyError in taskboard | # -*- coding: utf-8 -*-
from django.db.models.loading import get_model
from django.shortcuts import get_object_or_404
from rest_framework.response import Response
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from taiga.base import exceptions as exc
from .serializers impo... | # -*- coding: utf-8 -*-
from django.db.models.loading import get_model
from django.shortcuts import get_object_or_404
from rest_framework.response import Response
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from taiga.base import exceptions as exc
from .serializers impo... |
Use arrow functions and replace deprecated ListView with a FlatList | 'use strict';
import React, {Component} from 'react';
import {
AppRegistry,
FlatList,
StyleSheet,
View,
} from 'react-native';
class CollectionView extends Component {
groupItems = (items, itemsPerRow) => {
let itemsGroups = [];
let group = [];
items.forEach(function (item) {
if (group.le... | 'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
View,
StyleSheet,
ListView,
} from 'react-native';
class CollectionView extends Component {
groupItems = function(items, itemsPerRow) {
var itemsGroups = [];
var group = [];
items.forEach(function(item) {
... |
Exclude Endpoints with a <format> parameter | from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from django.utils.module_loading import import_string
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
... | from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from django.utils.module_loading import import_string
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
... |
Move Blink call into post-update event, not pre-update. | <?php
namespace Northstar\Providers;
use Northstar\Models\User;
use DoSomething\Gateway\Blink;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
User... | <?php
namespace Northstar\Providers;
use Northstar\Models\User;
use DoSomething\Gateway\Blink;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
User... |
Change migration to fallback to old country | from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(self, *args, **o... | from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(self, *args, **o... |
Fix button class on upload modal
no issue
- this makes sure that the cancel button on the upload modal gets the
correct class | import ModalDialog from 'ghost/components/gh-modal-dialog';
import upload from 'ghost/assets/lib/uploader';
var UploadModal = ModalDialog.extend({
layoutName: 'components/gh-modal-dialog',
didInsertElement: function () {
this._super();
upload.call(this.$('.js-drop-zone'), {fileStorage: this.ge... | import ModalDialog from 'ghost/components/gh-modal-dialog';
import upload from 'ghost/assets/lib/uploader';
var UploadModal = ModalDialog.extend({
layoutName: 'components/gh-modal-dialog',
didInsertElement: function () {
this._super();
upload.call(this.$('.js-drop-zone'), {fileStorage: this.ge... |
Refactor migration script to handle case where Postgres is being used but psycopg2 isn't installed | from __future__ import unicode_literals
from django import VERSION
from django.db import migrations, models
can_use_arrayfield = False
chapters_field = models.Field() # Dummy field
if VERSION >= (1, 8):
try:
from django.contrib.postgres.fields import ArrayField
chapters_field = ArrayField(base_fi... | from __future__ import unicode_literals
from django import VERSION
from django.db import migrations, models
if VERSION >= (1, 8):
from django.contrib.postgres.fields import ArrayField
chapters_field = ArrayField(base_field=models.CharField(max_length=100), default=list, size=None)
else:
chapters_field = mo... |
Set user circle at home | package components;
import com.badlogic.ashley.core.Component;
import dataObjects.Profile;
import javafx.scene.shape.Circle;
import utils.Constants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
/**
* Created by Thagus on 19/10/16.
*/
public class ProfileComponent implements Compon... | package components;
import com.badlogic.ashley.core.Component;
import dataObjects.Profile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
/**
* Created by Thagus on 19/10/16.
*/
public class ProfileComponent implements Component{
public CityBlockComponent home, work;
public ... |
Make test more resilient to countries already existing in test database | <?php
use App\Models\Country;
class UsersControllerTest extends TestCase
{
/**
* Checks whether an OK status is returned when the
* profile order update request is valid.
*/
public function testStore()
{
config()->set('osu.user.allow_registration', true);
$this
... | <?php
use App\Models\Country;
class UsersControllerTest extends TestCase
{
/**
* Checks whether an OK status is returned when the
* profile order update request is valid.
*/
public function testStore()
{
config()->set('osu.user.allow_registration', true);
$this
... |
Fix url to keywords; fix cmd line usage | #!/usr/bin/env python
from __future__ import print_function
import json
import os
import sys
import requests
import scraperwiki
def main(argv=None):
if argv is None:
argv = sys.argv
arg = argv[1:]
if len(arg) > 0:
# Developers can supply URL as an argument...
keywords = arg[0]
... | #!/usr/bin/env python
from __future__ import print_function
import json
import os
import sys
import requests
import scraperwiki
def main(argv=None):
if argv is None:
argv = sys.argv
arg = argv[1:]
if len(arg) > 0:
# Developers can supply URL as an argument...
url = arg[0]
el... |
Throw an exception if the test importer cannot handle an import. | package io.bit3.jsass;
import io.bit3.jsass.importer.Import;
import io.bit3.jsass.importer.Importer;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collection;
import java.util.LinkedList;
public class ... | package io.bit3.jsass;
import io.bit3.jsass.importer.Import;
import io.bit3.jsass.importer.Importer;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collection;
import java.util.LinkedList;
public class ... |
Call au lieu de Popen pour synchroniser | # -*- coding: utf-8 -*-
# traitement global des fichiers wav
import os,numpy,octaveIO,string,subprocess
def createDataFiles():
if not os.path.exists('data'):
os.makedirs('data')
print "Please add some data, I don't work for free"
else:
res = []
for root, dirs, files in os.walk... | # -*- coding: utf-8 -*-
# traitement global des fichiers wav
import os,numpy,octaveIO,string,subprocess
def createDataFiles():
if not os.path.exists('data'):
os.makedirs('data')
print "Please add some data, I don't work for free"
else:
res = []
for root, dirs, files in os.walk... |
Handle args in the review helper. | #!/usr/bin/python
import argparse
import json
import utils
def component_reviews(component, reviewer=None):
cmd = ('ssh review.openstack.org gerrit query --format json '
'--current-patch-set project:%s status:open '
'limit:10000'
% component)
if reviewer:
cmd += ' re... | #!/usr/bin/python
import json
import utils
def component_reviews(component, reviewer=None):
cmd = ('ssh review.openstack.org gerrit query --format json '
'--current-patch-set project:%s status:open '
'limit:10000'
% component)
if reviewer:
cmd += ' reviewer:%s' % rev... |
Fix linting rule for switch-case indentation | module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"plugins": ["eslint-plugin-jsdoc", "eslint-plugin-markdown"],
"parserOptions": {
"ecmaVersion": 2018
},
... | module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"plugins": ["eslint-plugin-jsdoc", "eslint-plugin-markdown"],
"parserOptions": {
"ecmaVersion": 2018
},
... |
Use colors and quality attributes on manual image fetching | angular
.module('ngVibrant')
.directive('vibrant', vibrant);
function vibrant($vibrant) {
var directive = {
restrict: 'AE',
scope: {
model: '=ngModel', //Model
url: '@?',
swatch: '@?',
quality: '@?',
colors: '@?'
},
... | angular
.module('ngVibrant')
.directive('vibrant', vibrant);
function vibrant($vibrant) {
var directive = {
restrict: 'AE',
scope: {
model: '=ngModel', //Model
url: '@?',
swatch: '@?',
quality: '@?',
colors: '@?'
},
... |
Make sure that the channel creation and storage works
Signed-off-by: Rohan Jain <f3a935f2cb7c3d75d1446a19169b923809d6e623@gmail.com> | import json
from tornado import testing
from qotr.server import make_application
from qotr.channels import Channels
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
Channels.reset()
... | import json
from tornado import testing, httpserver
from qotr.server import make_application
from qotr.channels import Channels
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
Channels.r... |
Add concat step to default grunt task | /// <binding BeforeBuild='bower, concat' ProjectOpened='bower:install' />
/*
This file in the main entry point for defining grunt tasks and using grunt plugins.
Click here to learn more. http://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409
*/
module.exports = function (grunt) {
grunt.initConfig({
bower... | /// <binding BeforeBuild='bower, concat' ProjectOpened='bower:install' />
/*
This file in the main entry point for defining grunt tasks and using grunt plugins.
Click here to learn more. http://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409
*/
module.exports = function (grunt) {
grunt.initConfig({
bower... |
Move survey action celery task import to method scope. | from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class SendSurveyAction(ConversationAction):
action_name = 'send_survey'
action_display_name = 'Send Survey'
needs_confirmation = True
needs_group = True
needs_running = True
def check_disa... | from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
from go.apps.surveys.tasks import export_vxpolls_data
class SendSurveyAction(ConversationAction):
action_name = 'send_survey'
action_display_name = 'Send Survey'
needs_confirmation = True
needs_gro... |
Use new snarl plugin feature instead of emulating / waiting. | module.exports = {
'{USER:NEW}': function(message, cb) {
var self = this;
if (!self.config || !self.config.welcome) return;
var user = message.user;
self.__rpc('im.open', {
user: user.id
}, function(err, response) {
if (!response || !response.channel || !response.channel.id) {
... | module.exports = {
'{USER}': function(user, cb) {
var self = this;
if (!self.config || !self.config.welcome) return;
// simulate a real user delay
setTimeout(function() {
var knownUser = ~Object.keys(self.userMap).indexOf(user.id);
if (!knownUser) {
self.__rpc('im.open', {
... |
Improve error message when encountering missing type builders | import PropTypes from 'proptypes'
export default {
any: {
options: {
of: PropTypes.array.isRequired
},
parse(options, typeBuilders, schema) {
const containsTypes = options.of.map(typeDef => {
const typeBuilder = typeBuilders[typeDef.type]
if (!typeBuilder) {
throw ne... | import PropTypes from 'proptypes'
export default {
any: {
options: {
of: PropTypes.array.isRequired
},
parse(options, typeBuilders, schema) {
const containsTypes = options.of.map(typeDef => {
const typeBuilder = typeBuilders[typeDef.type]
if (!typeBuilder) {
throw ne... |
Move lexer whitespace check first | <?php
namespace Igorw\Ilias;
class Lexer
{
private $whitespace = [' ', "\t", "\r", "\n"];
private $nonAtom = ['(', ')', ' ', "\t", "\r", "\n"];
public function tokenize($code)
{
$tokens = [];
for ($i = 0, $length = strlen($code); $i < $length; $i++) {
$char = $code[$i];
... | <?php
namespace Igorw\Ilias;
class Lexer
{
private $whitespace = [' ', "\t", "\r", "\n"];
private $nonAtom = ['(', ')', ' ', "\t", "\r", "\n"];
public function tokenize($code)
{
$tokens = [];
for ($i = 0, $length = strlen($code); $i < $length; $i++) {
$char = $code[$i];
... |
Add more test for svg | var cheerio = require('cheerio');
var mock = require('./mock');
var AssetsInliner = require('../lib/output/assets-inliner');
describe('Assets Inliner Output', function() {
describe('SVG', function() {
var output;
before(function() {
var SVG = '<svg xmlns="http://www.w3.org/2000/svg" ... | var cheerio = require('cheerio');
var mock = require('./mock');
var AssetsInliner = require('../lib/output/assets-inliner');
describe('Assets Inliner Output', function() {
describe('SVG', function() {
var output;
before(function() {
return mock.outputDefaultBook(AssetsInliner, {
... |
Add undefined instead of nan if only one number | inlist_module.directive('gdOnevarResults', function() { return {
require:'^ngController', //input_list_ctrl
templateUrl:'app/views/onevar_results_table.html',
link: function(scope,elem,attrs,ctrl) {
scope.$watch('inctrl.stats', function(stats) {
document.getElementById('onevar_results_ma... | inlist_module.directive('gdOnevarResults', function() { return {
require:'^ngController', //input_list_ctrl
templateUrl:'app/views/onevar_results_table.html',
link: function(scope,elem,attrs,ctrl) {
scope.$watch('inctrl.stats', function(stats) {
document.getElementById('onevar_results_ma... |
Use attribute object from state | 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 = {
... | import React from 'react';
import ClipboardJS from 'clipboard';
import 'balloon-css/balloon.css';
import levelNames from "../constants/levelNames";
export default class CopyButton extends React.PureComponent {
constructor(props) {
super(props);
this.copyBtnRef = React.createRef();
this.clipboardRef = Rea... |
8: Create documentation of DataSource Settings
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8 | ######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-08
... | ######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-08
... |
Add process_id into the $state.go statements. Have chooseExistingProcess make a REST call to get the list of processes. | (function (module) {
module.controller('ProjectHomeController', ProjectHomeController);
ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state", "Restangular"];
function ProjectHomeController(project, mcmodal, templates, $state, Restangular) {
var ctrl = this;
ctrl.pro... | (function (module) {
module.controller('ProjectHomeController', ProjectHomeController);
ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state"];
function ProjectHomeController(project, mcmodal, templates, $state) {
var ctrl = this;
ctrl.project = project;
ctrl... |
Throw an uncaught exception if all docs failed | <?php
namespace App;
use Exception;
use ScoutEngines\Elasticsearch\ElasticsearchEngine as BaseEngine;
class ElasticsearchEngine extends BaseEngine
{
/**
* Update the given model in the index.
*
* @param Collection $models
* @return void
*/
public function update($models)
{
... | <?php
namespace App;
use Exception;
use ScoutEngines\Elasticsearch\ElasticsearchEngine as BaseEngine;
class ElasticsearchEngine extends BaseEngine
{
/**
* Update the given model in the index.
*
* @param Collection $models
* @return void
*/
public function update($models)
{
... |
Use BleCommunicationWin on CI tests | import logging
import re
import sys
import os
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win') or os.environ.get('CI') == 'True':
# Use BleCommunicationWi... | import logging
import re
import sys
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win'):
from ruuvitag_sensor.ble_communication import BleCommunicationWin
... |
Stop button always visible when clock is running | $(function(){
var yourSound = new Audio('notification.ogg');
yourSound.loop = true;
$('.start button').click(function(ev){
$('.start').toggleClass('hidden');
$('.stop').toggleClass('hidden');
$(".example").TimeCircles({
"animation": "ticks",
"count_past_zero":... | $(function(){
var yourSound = new Audio('notification.ogg');
yourSound.loop = true;
$('.start button').click(function(ev){
$('.start').toggleClass('hidden');
$(".example").TimeCircles({
"animation": "ticks",
"count_past_zero": false,
"circle_bg_color": "#f... |
Change expected result array which should be returned by the projects webservice. The test is still failing | <?php
namespace fennecweb;
class ProjectsTest extends \PHPUnit_Framework_TestCase
{
const NICKNAME = 'listingProjectsTestUser';
const USERID = 'listingProjectsTestUser';
const PROVIDER = 'listingProjectsTestUser';
public function testExecute()
{
//Test for error returned by user is not lo... | <?php
namespace fennecweb;
class ProjectsTest extends \PHPUnit_Framework_TestCase
{
const NICKNAME = 'listingProjectsTestUser';
const USERID = 'listingProjectsTestUser';
const PROVIDER = 'listingProjectsTestUser';
public function testExecute()
{
//Test for error returned by user is not lo... |
Refactor init method with _blocks attribute | """A template for describing a Dakota experiment."""
import os
import importlib
class Experiment(object):
"""Describe parameters to create an input file for a Dakota experiment."""
def __init__(self,
environment='environment',
method='vector_parameter_study',
... | """A template for describing a Dakota experiment."""
import os
import importlib
import inspect
blocks = ['environment', 'method', 'variables', 'interface', 'responses']
class Experiment(object):
"""Describe parameters to create an input file for a Dakota experiment."""
def __init__(self,
... |
Add test to cover container collisions | (function() {
var defur = require('../../../src/defur');
var assert = require('chai').assert;
suite('defur:', function() {
var services = null;
setup(function() {
services = {};
});
test('`defur` is a function', function() {
assert.isFunction(defur... | (function() {
var defur = require('../../../src/defur');
var assert = require('chai').assert;
suite('defur:', function() {
var services = null;
setup(function() {
services = {};
});
test('`defur` is a function', function() {
assert.isFunction(defur... |
Use date as formatting type
Date is a formatting type instead of a real one. This seems to work. | 'use strict';
module.exports = {
'required': [
'sender',
'receiver',
'items',
'due',
'paymentDays'
],
'properties': {
'id': require('../id'),
'invoiceId': {
'type': 'number',
'description': 'Unique invoice id generated interna... | 'use strict';
module.exports = {
'required': [
'sender',
'receiver',
'items',
'due',
'paymentDays'
],
'properties': {
'id': require('../id'),
'invoiceId': {
'type': 'number',
'description': 'Unique invoice id generated interna... |
[api] Update user session profile when self updating | package io.openex.config;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import io.openex.database.model.User;
import org.sprin... | package io.openex.config;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import io.openex.database.model.User;
import org.sprin... |
Test that output is being passed to load method | <?php
class CM_Provision_LoaderTest extends CMTest_TestCase {
public function testLoad() {
$serviceManager = new CM_Service_Manager();
$outputStream = new CM_OutputStream_Null();
$script = $this->mockObject('CM_Provision_Script_Abstract');
$loadMethod = $script->mockMethod('load')... | <?php
class CM_Provision_LoaderTest extends CMTest_TestCase {
public function testLoad() {
$serviceManager = new CM_Service_Manager();
$script = $this->mockObject('CM_Provision_Script_Abstract');
$loadMethod = $script->mockMethod('load')->set(function (CM_Service_Manager $manager) use ($s... |
Remove return types for now | <?php namespace Lecturize\Taxonomies\Traits;
use Lecturize\Taxonomies\Models\Taxonomy;
use Lecturize\Taxonomies\Models\Term;
/**
* Class ModelFinder
* @package Lecturize\Taxonomies\Traits
*/
trait ModelFinder
{
/**
* Find term by slug.
*
* @param string $slug
* @return Term
*/
pu... | <?php namespace Lecturize\Taxonomies\Traits;
use Lecturize\Taxonomies\Models\Taxonomy;
use Lecturize\Taxonomies\Models\Term;
/**
* Class ModelFinder
* @package Lecturize\Taxonomies\Traits
*/
trait ModelFinder
{
/**
* Find term by slug.
*
* @param string $slug
* @return Term
*/
pu... |
Set sample times to every 5 minutes.
Show the time of a timeout. | """
Logs key data from a Fronius inverter to a CSV file for later analysis.
peter.marks@pobox.com
"""
import requests
import json
import datetime
import time
# Set this to the IP address of your inverter
host = "192.168.0.112"
# number of seconds between samples, set to zero to run once and exit
sample_seconds = 60 *... | """
Logs key data from a Fronius inverter to a CSV file for later analysis.
peter.marks@pobox.com
"""
import requests
import json
import datetime
import time
# Set this to the IP address of your inverter
host = "192.168.0.112"
sample_seconds = 60 # how many seconds between samples, set to zero to run once and exit
... |
Fix data log fixture foreign keys | from django.core.management.base import BaseCommand
from django.core import serializers
from data_log import models
import json
class Command(BaseCommand):
help = 'Create Data Log Report fixtures'
def handle(self, *args, **kwargs):
self.stdout.write(self.style.HTTP_INFO('Creating fixtures for Data L... | from django.core.management.base import BaseCommand
from django.core import serializers
from data_log import models
import json
class Command(BaseCommand):
help = 'Create Data Log Report fixtures'
def handle(self, *args, **kwargs):
self.stdout.write(self.style.HTTP_INFO('Creating fixtures for Data L... |
Add gridImageId to continueReading fragments | import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import { getFragment } from 'meteor/vulcan:core';
export const withContinueReading = component => {
// FIXME: For some unclear reason, using a ...fragment in the 'sequence' part
// of this query doesn't work (leads to a 400 Bad Request), so thi... | import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import { getFragment } from 'meteor/vulcan:core';
export const withContinueReading = component => {
// FIXME: For some unclear reason, using a ...fragment in the 'sequence' part
// of this query doesn't work (leads to a 400 Bad Request), so thi... |
Allow additional response states (queued, downloading, processing) | import Ember from 'ember';
export default Ember.Route.extend({
createFeedFromGtfsService: Ember.inject.service('create-feed-from-gtfs'),
beforeModel: function(transition) {
var controller = this;
var feedModel = this.get('createFeedFromGtfsService').feedModel;
var url = feedModel.get('url');
var ad... | import Ember from 'ember';
export default Ember.Route.extend({
createFeedFromGtfsService: Ember.inject.service('create-feed-from-gtfs'),
beforeModel: function(transition) {
var controller = this;
var feedModel = this.get('createFeedFromGtfsService').feedModel;
var url = feedModel.get('url');
var ad... |
Make sure the auth middleware returns
Thus not breaking the chain of middleware return values | import { REHYDRATE } from 'redux-persist/constants'
import {
refreshAuthenticationToken,
scheduleAuthRefresh,
} from '../actions/authentication'
import { AUTHENTICATION } from '../constants/action_types'
const toMilliseconds = seconds => seconds * 1000
// Get a timeout value about 100ms before a given date,
// or... | import { REHYDRATE } from 'redux-persist/constants'
import {
refreshAuthenticationToken,
scheduleAuthRefresh,
} from '../actions/authentication'
import { AUTHENTICATION } from '../constants/action_types'
const toMilliseconds = seconds => seconds * 1000
// Get a timeout value about 100ms before a given date,
// or... |
Fix layer model serialize method to use new organization | cinema.models.LayerModel = Backbone.Model.extend({
constructor: function (defaults, options) {
Backbone.Model.call(this, {}, options);
if (typeof defaults === 'string') {
this.setFromString(defaults);
} else if (defaults) {
this.set('state', defaults);
}
... | cinema.models.LayerModel = Backbone.Model.extend({
constructor: function (defaults, options) {
Backbone.Model.call(this, {}, options);
if (typeof defaults === 'string') {
this.setFromString(defaults);
} else if (defaults) {
this.set('state', defaults);
}
... |
Include attach method in DummyOperation | from hoomd.triggers import Trigger
from hoomd.meta import _Operation, _TriggeredOperation
class DummySimulation:
def __init__(self):
self.state = DummyState()
self.operations = DummyOperations()
self._cpp_sys = DummySystem()
class DummySystem:
def __init__(self):
self.dummy_l... | from hoomd.triggers import Trigger
from hoomd.meta import _Operation, _TriggeredOperation
class DummySimulation:
def __init__(self):
self.state = DummyState()
self.operations = DummyOperations()
self._cpp_sys = DummySystem()
class DummySystem:
def __init__(self):
self.dummy_l... |
Remove userReadinfo and evenSchedule objects. | var base = require('./base.js');
exports.assemble = {
addSchedule:
function (parameters, response) {
var userEventEntry = {
availability: JSON.stringify(parameters.availability),
Users_id: parameters.usersid,
Events_id: parameters.eventsid
... | var base = require('./base.js');
exports.assemble = {
addSchedule:
function (parameters, response) {
var userEventEntry = {
availability: JSON.stringify(parameters.availability),
Users_id: parameters.usersid,
Events_id: parameters.eventsid
... |
Fix filenames of DisableLoadBalancerForAgents and EnableLoadBalancerForAgents | /*******************************************************************************
* Copyright (C) 2012 eBay 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/lic... | /*******************************************************************************
* Copyright (C) 2012 eBay 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/lic... |
Fix unit test assertion for number of pre-included apps | window = {};
var assert = require('assert');
var model = require('../../lib/model')({
memory: true,
noConnect: true
});
describe('Model', function () {
describe('interface', function () {
it('should expose expected objects', function () {
assert.equal(typeof model.history, 'object');
... | window = {};
var assert = require('assert');
var model = require('../../lib/model')({
memory: true,
noConnect: true
});
describe('Model', function () {
describe('interface', function () {
it('should expose expected objects', function () {
assert.equal(typeof model.history, 'object');
... |
Add div.clearfix to ensure links work in phone mode | <?php
/**
* Default template for displaying post content
*
* @package ZnWP Bootstrap Theme
*/
global $znwp_theme;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="post-title">
<?php if (is_single()): ?>
<?php the_title(); ?>
... | <?php
/**
* Default template for displaying post content
*
* @package ZnWP Bootstrap Theme
*/
global $znwp_theme;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="post-title">
<?php if (is_single()): ?>
<?php the_title(); ?>
... |
Fix typo in folders service description | <?php
namespace GrooveHQ\Service;
class MailboxesDescription extends BasicServiceDescription
{
protected function getServiceDescription()
{
return [
'operations' => [
'mailboxes' => [
'summary' => 'Listing mailboxes',
'httpMethod' =>... | <?php
namespace GrooveHQ\Service;
class MailboxesDescription extends BasicServiceDescription
{
protected function getServiceDescription()
{
return [
'operations' => [
'mailboxes' => [
'summary' => 'Listing mailboxes',
'httpMethod' =>... |
Add getCommand handler for strings | package com.avairebot.orion.commands;
import net.dv8tion.jda.core.entities.Message;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CommandHandler {
private static final Map<List<String>, CommandContainer> commands = new HashMap<>();
public s... | package com.avairebot.orion.commands;
import net.dv8tion.jda.core.entities.Message;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CommandHandler {
private static final Map<List<String>, CommandContainer> commands = new HashMap<>();
public s... |
Allow user to remove sample people | Meteor.methods({
addSearchSamplePeople: function() {
var first_names = [
"Ada",
"Grace",
"Marie",
"Carl",
"Nikola",
"Claude",
"Peter",
"Stefan",
"Stephen",
"Lisa",
"Christian",
"Barack"
];
var last_names = [
"Lovelace",
... | Meteor.methods({
addSearchSamplePeople: function() {
var first_names = [
"Ada",
"Grace",
"Marie",
"Carl",
"Nikola",
"Claude",
"Peter",
"Stefan",
"Stephen",
"Lisa",
"Christian",
"Barack"
];
var last_names = [
"Lovelace",
... |
Allow TypeParameters to 'grap' attr from param_dict | from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getattr__(self, attr):
try:
return getattr(self.param_dic... | from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem_... |
Select the chunk content on edit. | (function($) {
$(document).ready(function(){
$('.edit_chunk').on(
'click',
'a',
function() {
var key = $(this).parent().data('key');
var chunk = $(this).parent();
chunk.empty();
$.get('/chunks/edit/' + key + ... | (function($) {
$(document).ready(function(){
$('.edit_chunk').on(
'click',
'a',
function() {
var key = $(this).parent().data('key');
var chunk = $(this).parent();
chunk.empty();
$.get('/chunks/edit/' + key + ... |
Add `key` to payment type selection list | // @flow
import React, { Component } from 'react';
import { FormattedMessage } from 'react-intl';
import PaymentMethodWrapper from '../ExpressDonation/PaymentMethodWrapper';
export default class PaymentTypeSelection extends Component {
props: {
disabled?: boolean;
currentPaymentType?: string;
onChange: (... | // @flow
import React, { Component } from 'react';
import { FormattedMessage } from 'react-intl';
import PaymentMethodWrapper from '../ExpressDonation/PaymentMethodWrapper';
export default class PaymentTypeSelection extends Component {
props: {
disabled?: boolean;
currentPaymentType?: string;
onChange: (... |
Add vcrpy to testing-related dependencies | from codecs import open as codecs_open
from setuptools import setup, find_packages
import sentinelsat
# Get the long description from the relevant file
with codecs_open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(name='sentinelsat',
version=sentinelsat.__version__,
descr... | from codecs import open as codecs_open
from setuptools import setup, find_packages
import sentinelsat
# Get the long description from the relevant file
with codecs_open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(name='sentinelsat',
version=sentinelsat.__version__,
descr... |
refactor: Set expense to two decimals before saving it to db | import Ember from 'ember';
// import $ from 'jquery';
export default Ember.Component.extend({
expense: {
sum: '',
category: '',
name: ''
},
currency: '£',
expenseCategories: [
'Charity',
'Clothing',
'Education',
'Events',
'Food',
'Gifts',
'Healthcare',
'Household',
... | import Ember from 'ember';
// import $ from 'jquery';
export default Ember.Component.extend({
expense: {
sum: '',
category: '',
name: ''
},
currency: '£',
expenseCategories: [
'Charity',
'Clothing',
'Education',
'Events',
'Food',
'Gifts',
'Healthcare',
'Household',
... |
Fix Verify endpoint doesn't use user tranformer
Close https://github.com/NamelessMC/Nameless/issues/2714 | <?php
/**
* @param int $id The NamelessMC user's ID
* @param string $code The NamelessMC user's reset code, used to verify they own the account
*
* @return string JSON Array
*/
class VerifyEndpoint extends KeyAuthEndpoint {
public function __construct() {
$this->_route = 'users/{user}/verify';
... | <?php
/**
* @param int $id The NamelessMC user's ID
* @param string $code The NamelessMC user's reset code, used to verify they own the account
*
* @return string JSON Array
*/
class VerifyEndpoint extends KeyAuthEndpoint {
public function __construct() {
$this->_route = 'verify';
$this->_mod... |
Set JWT expiration date to 30 days | var authRouter = require('express').Router();
var jwt = require('jwt-simple');
var auth = require('../lib/auth');
var User = require('../../db/models/User');
var Promise = require('bluebird');
var bcrypt = require('bcryptjs');
bcrypt.compare = Promise.promisify(bcrypt.compare);
authRouter.post('/login', function(req,... | var authRouter = require('express').Router();
var jwt = require('jwt-simple');
var auth = require('../lib/auth');
var User = require('../../db/models/User');
var Promise = require('bluebird');
var bcrypt = require('bcryptjs');
bcrypt.compare = Promise.promisify(bcrypt.compare);
authRouter.post('/login', function(req,... |
Add social events to spring evals 😿 | from flask import Blueprint
from flask import render_template
from flask import request
spring_evals_bp = Blueprint('spring_evals_bp', __name__)
@spring_evals_bp.route('/spring_evals/')
def display_spring_evals():
# get user data
user_name = request.headers.get('x-webauth-user')
members = [
... | from flask import Blueprint
from flask import render_template
from flask import request
spring_evals_bp = Blueprint('spring_evals_bp', __name__)
@spring_evals_bp.route('/spring_evals/')
def display_spring_evals():
# get user data
user_name = request.headers.get('x-webauth-user')
members = [
... |
Add support for title next to logo in navbar | <?php defined('C5_EXECUTE') or die("Access Denied.");
?>
<?php
$c = Page::getCurrentPage();
?>
<?php if (is_object($f)): ?>
<?php
if ($maxWidth > 0 || $maxHeight > 0) {
$im = Core::make('helper/image');
$thumb = $im->getThumbnail(
$f,
$maxWidth,
$maxHeight
... | <?php defined('C5_EXECUTE') or die("Access Denied.");
?>
<?php
$c = Page::getCurrentPage();
?>
<?php if (is_object($f)): ?>
<?php
if ($maxWidth > 0 || $maxHeight > 0) {
$im = Core::make('helper/image');
$thumb = $im->getThumbnail(
$f,
$maxWidth,
$maxHeight
... |
Correct the function name for better legibility | import React from 'react';
import Dropdown from '../../../src/Dropdown/Dropdown.js';
class DropdownExample extends React.Component {
onItemSelection(item) {
console.log(item);
}
render() {
var items = [{
id: 'a',
html: <span>Item A</span>,
selectedHtml: <span>Item A</span>
},
... | import React from 'react';
import Dropdown from '../../../src/Dropdown/Dropdown.js';
class DropdownExample extends React.Component {
handleItemSelection(item) {
console.log(item);
}
render() {
var items = [{
id: 'a',
html: <span>Item A</span>,
selectedHtml: <span>Item A</span>
},... |
Rename Index view to Home | "use strict";
module.exports = function(imports) {
let express = imports.modules.express;
let Promise = imports.modules.Promise;
let fs = require("fs"); // TODO: put this into initImports
let util = imports.util;
let handler = util.handler;
let Team = imports.models.Team;
let router = ex... | "use strict";
module.exports = function(imports) {
let express = imports.modules.express;
let Promise = imports.modules.Promise;
let fs = require("fs"); // TODO: put this into initImports
let util = imports.util;
let handler = util.handler;
let Team = imports.models.Team;
let router = ex... |
Support gateway initialisation of the custom site name.
Also remove references to the unused (and unnecessary?) CompletePurchaseRequest. | <?php
namespace Omnipay\Gate2shop;
use Omnipay\Common\AbstractGateway;
use Omnipay\Gate2shop\Message\PurchaseRequest;
/**
* Gate2shop Gateway
*
* @link
*/
class Gateway extends AbstractGateway
{
public function getName()
{
return 'Gate2shop';
}
public function getDefaultParameters()
... | <?php
namespace Omnipay\Gate2shop;
use Omnipay\Common\AbstractGateway;
use Omnipay\Gate2shop\Message\PurchaseRequest;
use Omnipay\Gate2shop\Message\CompletePurchaseRequest;
/**
* Gate2shop Gateway
*
* @link
*/
class Gateway extends AbstractGateway
{
public function getName()
{
return 'Gate2shop';... |
Fix field key in saturn | <?php
namespace App\Sharp;
use App\User;
use Code16\Sharp\Form\Layout\FormLayoutColumn;
use Code16\Sharp\Show\Fields\SharpShowTextField;
use Code16\Sharp\Show\Layout\ShowLayoutSection;
use Code16\Sharp\Show\SharpSingleShow;
class AccountSharpShow extends SharpSingleShow
{
function buildShowFields()
{
... | <?php
namespace App\Sharp;
use App\User;
use Code16\Sharp\Form\Layout\FormLayoutColumn;
use Code16\Sharp\Show\Fields\SharpShowTextField;
use Code16\Sharp\Show\Layout\ShowLayoutSection;
use Code16\Sharp\Show\SharpSingleShow;
class AccountSharpShow extends SharpSingleShow
{
function buildShowFields()
{
... |
services.ec2: Add the missing push_notifications args
Signed-off-by: Sayan Chowdhury <5f0367a2b3b757615b57f51d912cf16f2c0ad827@gmail.com> | #!/bin/env python
# -*- coding: utf8 -*-
""" Triggers an upload process with the specified raw.xz URL. """
import argparse
import logging
import logging.config
import multiprocessing.pool
import fedmsg.config
import fedimg.uploader
logging.config.dictConfig(fedmsg.config.load_config()['logging'])
log = logging.getLo... | #!/bin/env python
# -*- coding: utf8 -*-
""" Triggers an upload process with the specified raw.xz URL. """
import argparse
import logging
import logging.config
import multiprocessing.pool
import fedmsg.config
import fedimg.uploader
logging.config.dictConfig(fedmsg.config.load_config()['logging'])
log = logging.getLo... |
Fix for_each incorrectly using lazy map operator | from bot.api.api import Api
from bot.storage import Config, State, Cache
from bot.utils.dictionaryobject import DictionaryObject
class Event(DictionaryObject):
pass
class Update(Event):
def __init__(self, update, is_pending):
super().__init__()
self.update = update
self.is_pending = ... | from bot.api.api import Api
from bot.storage import Config, State, Cache
from bot.utils.dictionaryobject import DictionaryObject
class Event(DictionaryObject):
pass
class Update(Event):
def __init__(self, update, is_pending):
super().__init__()
self.update = update
self.is_pending = ... |
Fix bug of not getting full 60 | import { min } from "date-fns";
export default function queryPlaces (coordinates, radius, service, types) {
return new Promise(res => {
let queries = types.reduce((queries, type) => {
queries.push(queryPlacesByType(coordinates, radius, service, type))
return queries
}, [])
... | import { min } from "date-fns";
export default function queryPlaces (coordinates, radius, service, types) {
return new Promise(res => {
let queries = types.reduce((queries, type) => {
queries.push(queryPlacesByType(coordinates, radius, service, type))
return queries
}, [])
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.