text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Print all the messages on a QueryException (not just the length).
package net.ripe.db.whois.common; import javax.annotation.concurrent.Immutable; @Immutable public final class Message { private final Messages.Type type; private final String text; private final Object[] args; private final String formattedText; public Message(final Messages.Type type, final Str...
package net.ripe.db.whois.common; import javax.annotation.concurrent.Immutable; import java.util.regex.Pattern; @Immutable public final class Message { public static final Pattern BEGINNING_OF_LINE_PERCENT_SIGNS = Pattern.compile("^%+ "); private final Messages.Type type; private final String text; p...
Remove unnecessary (and debatable) comment.
""" OrderedDict variants of the default base classes. """ try: # Python 2.7+ from collections import OrderedDict except ImportError: # Oython 2.6 try: from ordereddict import OrderedDict except ImportError: OrderedDict = None from .graph import Graph from .multigraph import MultiGr...
""" OrderedDict variants of the default base classes. These classes are especially useful for doctests and unit tests. """ try: # Python 2.7+ from collections import OrderedDict except ImportError: # Oython 2.6 try: from ordereddict import OrderedDict except ImportError: OrderedDic...
Update to set register user after logged in
'use strict'; angular.module('lightweight').controller('CheckoutAsGuestController', ['$scope', '$rootScope', '$location', '$state', '$timeout', '$stateParams', '$window', 'Global', 'UserService','CartService', function($scope, $rootScope, $location, $state, $timeout, $stateParams, $window, Global, UserService,...
'use strict'; angular.module('lightweight').controller('CheckoutAsGuestController', ['$scope', '$rootScope', '$location', '$state', '$timeout', '$stateParams', '$window', 'Global', 'UserService','CartService', function($scope, $rootScope, $location, $state, $timeout, $stateParams, $window, Global, UserService,...
Fix compilation error with Kotlin 1.0
package org.jetbrains.kotlin.android.xmlconverter; import kotlin.text.Charsets; import org.junit.Rule; import org.junit.rules.TestName; import sun.plugin.dom.exception.InvalidStateException; import java.io.File; import static kotlin.collections.SetsKt.*; import static kotlin.io.FilesKt.*; import static org.junit.Asse...
package org.jetbrains.kotlin.android.xmlconverter; import org.junit.Rule; import org.junit.rules.TestName; import sun.plugin.dom.exception.InvalidStateException; import java.io.File; import static kotlin.collections.SetsKt.*; import static kotlin.io.FilesKt.*; import static org.junit.Assert.assertEquals; import stati...
Remove unused param & rename param from docblock
<?php /** * @file * Contains \Drupal\AppConsole\Generator\PluginBlockGenerator. */ namespace Drupal\AppConsole\Generator; class PluginBlockGenerator extends Generator { /** * Generator Plugin Block * @param $module * @param $class_name * @param $plugin_label * @param $plugin_id * @param $s...
<?php /** * @file * Contains \Drupal\AppConsole\Generator\PluginBlockGenerator. */ namespace Drupal\AppConsole\Generator; class PluginBlockGenerator extends Generator { /** * Generator Plugin Block * @param $module * @param $class_name * @param $plugin_label * @param $plugin_id * @param $d...
Move statement to 2 lines
var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var express = require('express'); var router = express.Router(); var mongoose = require('mongoose'...
var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser');var express = require('express'); var router = express.Router(); var mongoose = require('mongoose')...
Correct url to project details
define(['app', 'bloodhound'], function(app, Bloodhound) { 'use strict'; return { parent: 'admin_layout', url: 'new/project/', templateUrl: 'partials/admin/project-create.html', controller: function($scope, $http, $state) { $scope.searchRepositories = function(value) { return $http.get...
define(['app', 'bloodhound'], function(app, Bloodhound) { 'use strict'; return { parent: 'admin_layout', url: 'new/project/', templateUrl: 'partials/admin/project-create.html', controller: function($scope, $http, $state) { $scope.searchRepositories = function(value) { return $http.get...
Change conditional rendering and this bindings
import React from 'react' import FeedbackLink from '../components/FeedbackLink.js' class FeedbackSection extends React.Component { constructor(props) { super(props) this.state = { rateMessage: 'How was it? Rate it:', showButtons: true } } handleClick = () => { this.setState({ r...
import React from 'react' import FeedbackLink from '../components/FeedbackLink.js' class FeedbackSection extends React.Component { constructor(props) { super(props) this.state = { rateMessage: 'How was it? Rate it:', showButtons: true } this.handleClick = this.handleClick.bind(this) } ...
Fix static db connection. Singleton pattern.
<?php /** * DronePHP (http://www.dronephp.com) * * @link http://github.com/Pleets/DronePHP * @copyright Copyright (c) 2016 DronePHP. (http://www.dronephp.com) * @license http://www.dronephp.com/license */ namespace Drone\Db; abstract class AbstractTableGateway { /** * Handle * * @var D...
<?php /** * DronePHP (http://www.dronephp.com) * * @link http://github.com/Pleets/DronePHP * @copyright Copyright (c) 2016 DronePHP. (http://www.dronephp.com) * @license http://www.dronephp.com/license */ namespace Drone\Db; abstract class AbstractTableGateway { /** * Handle * * @var D...
Set the file permission to public instead of private
/* jshint loopfunc: true */ 'use strict'; /** * @ngdoc function * @name bannerPreviewApp.controller:BannersEditCtrl * @description * # BannersEditCtrl * Controller of the bannerPreviewApp */ angular.module('bannerPreviewApp') .controller('BannersEditCtrl', function ($scope, $upload, BannerService, banner, conf...
/* jshint loopfunc: true */ 'use strict'; /** * @ngdoc function * @name bannerPreviewApp.controller:BannersEditCtrl * @description * # BannersEditCtrl * Controller of the bannerPreviewApp */ angular.module('bannerPreviewApp') .controller('BannersEditCtrl', function ($scope, $upload, BannerService, banner, conf...
Reduce required numbers to match current coverage
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'], options: { jshintrc: '.jshintrc', } }, ...
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'], options: { jshintrc: '.jshintrc', } }, ...
Change command title and placeholder
define([ "text!src/templates/file.html", "less!src/stylesheets/main.less" ], function(fileTemplate) { var _ = codebox.require("hr/utils"); var commands = codebox.require("core/commands"); var rpc = codebox.require("core/rpc"); var dialogs = codebox.require("utils/dialogs"); commands.registe...
define([ "text!src/templates/file.html", "less!src/stylesheets/main.less" ], function(fileTemplate) { var _ = codebox.require("hr/utils"); var commands = codebox.require("core/commands"); var rpc = codebox.require("core/rpc"); var dialogs = codebox.require("utils/dialogs"); commands.registe...
Copy file permissions for all files
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), copy: { jquery: { expand: true, flatten: true, src: 'bower_components/jquery/dist/jquery.min.js', dest: 'dist/share/git-webui/w...
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), copy: { jquery: { expand: true, flatten: true, src: 'bower_components/jquery/dist/jquery.min.js', dest: 'dist/share/git-webui/w...
Remove copy constructor for PDAStack The copy() method is already sufficient.
#!/usr/bin/env python3 """Classes and methods for working with PDA stacks.""" class PDAStack(object): """A PDA stack.""" def __init__(self, stack): """Initialize the new PDA stack.""" self.stack = list(stack) def top(self): """Return the symbol at the top of the stack.""" ...
#!/usr/bin/env python3 """Classes and methods for working with PDA stacks.""" class PDAStack(object): """A PDA stack.""" def __init__(self, stack, **kwargs): """Initialize the new PDA stack.""" if isinstance(stack, PDAStack): self._init_from_stack_obj(stack) else: ...
Update job detail step to handle cancelled waiting jobs
import React from "react"; import { ClipLoader } from "halogenium"; import { Icon } from "../../base"; import { getTaskDisplayName } from "../../utils"; const JobStep = ({ step, isDone }) => { let hasBar; let stateIcon; let entryStyle; switch (step.state) { case "running": hasBar...
import React from "react"; import { ClipLoader } from "halogenium"; import { Icon } from "../../base"; import { getTaskDisplayName } from "../../utils"; const JobStep = ({ step, isDone }) => { let hasBar; let stateIcon; let entryStyle; switch (step.state) { case "running": hasBar...
Update template loaders analyzer to target Django 1.5
import ast from .base import BaseAnalyzer, Result class TemplateLoadersVisitor(ast.NodeVisitor): def __init__(self): self.found = [] removed_items = { 'django.template.loaders.app_directories.load_template_source': 'django.template.loaders.app_directories.Loader', 'djang...
import ast from .base import BaseAnalyzer, Result class TemplateLoadersVisitor(ast.NodeVisitor): def __init__(self): self.found = [] deprecated_items = { 'django.template.loaders.app_directories.load_template_source': 'django.template.loaders.app_directories.Loader', 'dj...
chore(analytics): Fix client ID not being sent to GA
import nanoid from 'nanoid'; const GA_KEY = 'GA:clientID'; let clientId = localStorage.getItem(GA_KEY); export default class Ga { constructor (db) { this.db = db; this.load(); } load () { if (!clientId) { clientId = nanoid(); localStorage.setItem(GA_KEY, clientId); } } report ...
import nanoid from 'nanoid'; const GA_KEY = 'GA:clientID'; let clientId = localStorage.getItem(GA_KEY); export default class Ga { constructor (db) { this.db = db; this.load(); } load () { if (!clientId) { clientId = nanoid(); localStorage.setItem(GA_KEY, clientId); } } report ...
Add buzzapi_job create reason text to the breakdown
<?php declare(strict_types=1); namespace App\Nova\Metrics; use App\Models\User; use Illuminate\Http\Request; use Laravel\Nova\Metrics\Partition; use Laravel\Nova\Metrics\PartitionResult; class CreateReasonBreakdown extends Partition { /** * The displayable name of the metric. * * @var string ...
<?php declare(strict_types=1); namespace App\Nova\Metrics; use App\Models\User; use Illuminate\Http\Request; use Laravel\Nova\Metrics\Partition; use Laravel\Nova\Metrics\PartitionResult; class CreateReasonBreakdown extends Partition { /** * The displayable name of the metric. * * @var string ...
Use named function syntax, more white space. Factor out myRender.
import { select, local } from "d3-selection"; var myLocal = local(), noop = function (){}; function myRender(props){ var my = myLocal.get(this); my.props = props; my.render(); } export default function (tagName, className){ var create = noop, render = noop, destroy = noop, selector = cla...
import { select, local } from "d3-selection"; var myLocal = local(), noop = function (){}; export default function (tagName, className){ var create = noop, render = noop, destroy = noop, myCreate = function (){ var my = myLocal.set(this, { selection: select(this), st...
Support case when expiration_datetime is None
from datetime import datetime, timedelta from invisibleroads_macros_security import make_random_string class DictionarySafe(dict): def __init__(self, key_length): self.key_length = key_length def put(self, value, time_in_seconds=None): while True: key = make_random_string(self.k...
from datetime import datetime, timedelta from invisibleroads_macros_security import make_random_string class DictionarySafe(dict): def __init__(self, key_length): self.key_length = key_length def put(self, value, time_in_seconds=None): while True: key = make_random_string(self.k...
[Java] Use service loader for ObjectFactory
package cucumber.runtime.java; import cucumber.api.java.ObjectFactory; import cucumber.runtime.CucumberException; import java.lang.reflect.Constructor; import java.util.HashMap; import java.util.Map; /** * This class has package scope so it doesn't get loaded by reflection, * thereby colliding with other DI implem...
package cucumber.runtime.java; import cucumber.api.java.ObjectFactory; import cucumber.runtime.CucumberException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; /** * This class has package scope so it doesn't get loaded by r...
Fix auth API usage (this is why we wait for CI)
import json from zeus import auth from zeus.api import client from zeus.exceptions import ApiError from zeus.models import Email, Identity from .base import Resource from ..schemas import EmailSchema, IdentitySchema, UserSchema emails_schema = EmailSchema(many=True, strict=True) identities_schema = IdentitySchema(ma...
import json from zeus import auth from zeus.api import client from zeus.exceptions import ApiError from zeus.models import Email, Identity from .base import Resource from ..schemas import EmailSchema, IdentitySchema, UserSchema emails_schema = EmailSchema(many=True, strict=True) identities_schema = IdentitySchema(ma...
Add "full scale" to antler settings.
from caribou.settings.setting_types import * from caribou.i18n import _ AntlerSettings = SettingsTopGroup( _("Antler Preferences"), "/org/gnome/antler/", "org.gnome.antler", [SettingsGroup("antler", _("Antler"), [ SettingsGroup("appearance", _("Appearance"), [ StringSett...
from caribou.settings.setting_types import * from caribou.i18n import _ AntlerSettings = SettingsTopGroup( _("Antler Preferences"), "/org/gnome/antler/", "org.gnome.antler", [SettingsGroup("antler", _("Antler"), [ SettingsGroup("appearance", _("Appearance"), [ StringSett...
BAP-9376: Create unit tests for ApiBundle. Fix ExpandRelatedEntities and FilterFieldsByExtra. Unit tests for ExpandRelatedEntities, FilterFieldsByExtra, CompleteDefinition, EnsureInitialized
<?php namespace Oro\Bundle\ApiBundle\Config; use Oro\Bundle\ApiBundle\Processor\Config\ConfigContext; /** * An instance of this class can be added to the config extras of the Context * to request to add related entities to a result. */ class ExpandRelatedEntitiesConfigExtra implements ConfigExtraInterface { c...
<?php namespace Oro\Bundle\ApiBundle\Config; use Oro\Bundle\ApiBundle\Processor\Config\ConfigContext; /** * An instance of this class can be added to the config extras of the Context * to request to add related entities to a result. */ class ExpandRelatedEntitiesConfigExtra implements ConfigExtraInterface { c...
Add assert for response status code
package com.skogsrud.halvard.springmvc.spike.controller; import com.skogsrud.halvard.springmvc.spike.tomcat.Server; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.Response; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import...
package com.skogsrud.halvard.springmvc.spike.controller; import com.skogsrud.halvard.springmvc.spike.tomcat.Server; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.Response; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import...
Clean up this code a bit (no functional change)
from django.forms import Widget from django.template.loader import render_to_string from ..utils import static_url class GenericKeyWidget(Widget): template = "admin/hatband/widgets/generickey.html" class Media: js = (static_url("visualsearch/dependencies.js"), static_url("visualsearch/...
from django.forms import Widget from django.template.loader import render_to_string from ..utils import static_url class GenericKeyWidget(Widget): template = "admin/hatband/widgets/generickey.html" class Media: js = (static_url("visualsearch/dependencies.js"), static_url("visualsearch/...
BB-4083: Remove information from ORM engine - refactor to accept object and array to delete method
<?php namespace Oro\Bundle\SearchBundle\Engine; interface IndexerInterface { /** * Save one of several entities to search index * * @param object|array $entity * @param array $context * * @return bool */ public function save($entity, array $context = []); /** ...
<?php namespace Oro\Bundle\SearchBundle\Engine; interface IndexerInterface { /** * Save one of several entities to search index * * @param object|array $entity * @param array $context * * @return bool */ public function save($entity, array $context = []); /** ...
Fix method to always return a value.
Application.Services.factory('Events', ['$filter', EventsService]); function EventsService($filter) { var service = { date: '', addConvertedTime: function (project) { project.reviews = service.update(project.open_reviews); project.samples = service.update(project.samples);...
Application.Services.factory('Events', ['$filter', EventsService]); function EventsService($filter) { var service = { date: '', addConvertedTime: function (project) { project.reviews = service.update(project.open_reviews); project.samples = service.update(project.samples);...
Change key and value to more descriptive names
from rest_framework import status from rest_framework.exceptions import APIException, ParseError def json_api_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array """ # Import inside method to avoid errors when the OSF is loaded without Django from rest_fr...
from rest_framework import status from rest_framework.exceptions import APIException, ParseError def json_api_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array """ # Import inside method to avoid errors when the OSF is loaded without Django from rest_fr...
Add error for non text file
<?php namespace fennecweb\ajax\upload; use \PDO as PDO; /** * Web Service. * Uploads Project biom files and save them in the database */ class Project extends \fennecweb\WebService { /** * @param $querydata[] * @returns result of file upload */ public function execute($querydata) { ...
<?php namespace fennecweb\ajax\upload; use \PDO as PDO; /** * Web Service. * Uploads Project biom files and save them in the database */ class Project extends \fennecweb\WebService { /** * @param $querydata[] * @returns result of file upload */ public function execute($querydata) { ...
Remove version from minified filename
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: { mini_src: { options: { banner: '/*! <%= pkg.name %>.min.js v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' }, files: { './<%= pkg.nam...
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: { mini_src: { options: { banner: '/*! <%= pkg.name %>.min.js v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' }, files: { './<%= pkg.nam...
Implement setCredentials on the mock OAuth2 client Fixes broken unit tests. The implementation looks kind of ridiculous, but it's not terribly different from what Google does themselves as of 1.1.3: https://github.com/google/google-api-nodejs-client/blob/bd356c38efc5ac460f319e4d0b005425013720cb/lib/auth/authclient.j...
/* 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/. */ const assert = require('assert'); const querystring = require('querystring'); var MockOAuth2Client = { generate...
/* 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/. */ const assert = require('assert'); const querystring = require('querystring'); var MockOAuth2Client = { generate...
Add script/lint --fix which fixes some code formatting issues via eslint
'use strict' const path = require('path') const {spawn} = require('child_process') const process = require('process') const CONFIG = require('../config') module.exports = async function () { return new Promise((resolve, reject) => { const eslintArgs = ['--cache', '--format', 'json'] if (process.argv.inclu...
'use strict' const path = require('path') const {spawn} = require('child_process') const CONFIG = require('../config') module.exports = async function () { return new Promise((resolve, reject) => { const eslint = spawn( path.join('script', 'node_modules', '.bin', 'eslint'), ['--cache', '--format', ...
Remove nom_port from options. This should be infered by the controller name. Add a name member for that. For now, infer the controller from the commandline string'
import itertools import string class ControllerConfig(object): _port_gen = itertools.count(8888) def __init__(self, cmdline="", address="127.0.0.1", port=None): ''' Store metadata for the controller. - cmdline is an array of command line tokens. Note: if you need to pass in the address and ...
import itertools import string class ControllerConfig(object): _port_gen = itertools.count(8888) def __init__(self, cmdline="", address="127.0.0.1", port=None, nom_port=None): ''' Store metadata for the controller. - cmdline is an array of command line tokens. Note: if you need to pass in t...
Fix issue with switching when there is dual supply
$(document).on("turbolinks:load", function() { $(".first-date-picker").datepicker( { dateFormat: 'DD, d MM yy', altFormat: 'yy-mm-dd', altField: $(".first-date-picker").parents("form:first").find("#first_date"), // minDate: -42, maxDate: -1, orientation: 'bottom',...
$(document).on("turbolinks:load", function() { $(".first-date-picker").datepicker( { dateFormat: 'DD, d MM yy', altFormat: 'yy-mm-dd', altField: "#first_date", // minDate: -42, maxDate: -1, orientation: 'bottom', changeMonth: true, changeYear: true...
Use "meta" block for logging variables
<?php namespace Rogue\Services; use Illuminate\Support\Facades\Log; use Softonic\GraphQL\ClientBuilder; class GraphQL { /** * Build a new GraphQL client. */ public function __construct() { $this->client = ClientBuilder::build(config('services.graphql.url')); } /** * Run a ...
<?php namespace Rogue\Services; use Illuminate\Support\Facades\Log; use Softonic\GraphQL\ClientBuilder; class GraphQL { /** * Build a new GraphQL client. */ public function __construct() { $this->client = ClientBuilder::build(config('services.graphql.url')); } /** * Run a ...
Add more assertions for Favicon
<?php namespace Arcanedev\Head\Tests\Entities; use Arcanedev\Head\Entities\Favicon; /** * Class FaviconTest * @package Arcanedev\Head\Tests\Entities */ class FaviconTest extends TestCase { /* ------------------------------------------------------------------------------------------------ | Properties ...
<?php namespace Arcanedev\Head\Tests\Entities; use Arcanedev\Head\Entities\Favicon; /** * Class FaviconTest * @package Arcanedev\Head\Tests\Entities */ class FaviconTest extends TestCase { /* ------------------------------------------------------------------------------------------------ | Properties ...
Make donuts display raw values
function toggleDisp(){ var txt = document.getElementById('asText'); var box = document.getElementById('asBoxed'); if (txt.style.display == 'none') { box.style.display = 'none'; txt.style.display = 'block'; } else { txt.style.display = 'none'; box.style.display = 'bloc...
function toggleDisp(){ var txt = document.getElementById('asText'); var box = document.getElementById('asBoxed'); if (txt.style.display == 'none') { box.style.display = 'none'; txt.style.display = 'block'; } else { txt.style.display = 'none'; box.style.display = 'bloc...
Fix crash in FAB background tint am: 9d42ab847a am: 3b28559aa3 * commit '3b28559aa396a40992b1c9e7e1e8af215340cd05': Fix crash in FAB background tint GitOrigin-RevId=84921ceb7940a7ce40affb58f22b4a11b35a3e60 PiperOrigin-RevId: 140551245
/* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
Fix script not working from bash
#!/usr/bin/env python3 import subprocess class NvidiaCommandsLayerException(Exception): pass class NvidiaCommandsLayer(object): @staticmethod def set_fan_percentage( value: int ) -> None: if value < 0 or value > 100: raise NvidiaCommandsLayerException('Cannot set a v...
#!/usr/bin/env python3.5 import subprocess class NvidiaCommandsLayerException(Exception): pass class NvidiaCommandsLayer(object): @staticmethod def set_fan_percentage( value: int ) -> None: if value < 0 or value > 100: raise NvidiaCommandsLayerException('Cannot set a...
Add support for deleting relationship
import { decamelize } from 'humps'; function serializeRelationships(resources = []) { return resources.map((resource) => serializeRelationship(resource)); } function serializeRelationship({ id, _type } = {}) { return { id, type: _type }; } function serialize({ id, _type, _meta, ...otherAttributes }) { let reso...
import { decamelize } from 'humps'; function serializeRelationships(resources = []) { return resources.map((resource) => serializeRelationship(resource)); } function serializeRelationship({ id, _type } = {}) { return { id, type: _type }; } function serialize({ id, _type, _meta, ...otherAttributes }) { let reso...
Add return to method (corrected typo)
<?php namespace Coreplex\Meta\Eloquent; use Coreplex\Meta\Contracts\Variant; trait HasMetaData { /** * Retrieve the meta data for this model * * @param Variant $variant * @return \Illuminate\Database\Eloquent\Relations\MorphOne */ public function meta(Variant $variant = null) { ...
<?php namespace Coreplex\Meta\Eloquent; use Coreplex\Meta\Contracts\Variant; trait HasMetaData { /** * Retrieve the meta data for this model * * @param Variant $variant * @return \Illuminate\Database\Eloquent\Relations\MorphOne */ public function meta(Variant $variant = null) { ...
Use weights a the layer indicator of point weight
CityDashboard.PointHeatmap = function(layer_params, attr, map, assoc_layer) { var data = []; var len = layer_params.points.length; if (layer_params.weights && layer_params.weights.length >= len) { for (var i = 0; i < len; i++) { data[i] = { location: new google.maps.La...
CityDashboard.PointHeatmap = function(layer_params, attr, map, assoc_layer) { var data = []; var len = layer_params.points.length; if (layer_params.weight && layer_params.weight.length >= len) { for (var i = 0; i < len; i++) { data[i] = { location: new google.maps.LatL...
Add necessary data to server response and improve error handling
const _ = require('lodash'); const config = require('../../../../config/ilmomasiina.config'); // eslint-disable-line const md5 = require('md5'); module.exports = () => (hook) => { const models = hook.app.get('models'); const id = hook.id; const editToken = hook.params.query.editToken; const fields = []; cons...
const config = require('../../../../config/ilmomasiina.config'); // eslint-disable-line const md5 = require('md5'); module.exports = () => (hook) => { const models = hook.app.get('models'); const id = hook.id; const editToken = hook.params.query.editToken; if (editToken !== md5(`${`${hook.id}`}${config.editTo...
[AC-7469] Merge remote-tracking branch 'origin/development' into AC-7469
# Generated by Django 2.2.10 on 2020-04-09 21:24 from django.db import migrations def add_deferred_user_role(apps, schema_editor): DEFERRED_MENTOR = 'Deferred Mentor' UserRole = apps.get_model('accelerator', 'UserRole') Program = apps.get_model('accelerator', 'Program') ProgramRole = apps.get_model('...
# Generated by Django 2.2.10 on 2020-04-09 21:24 from django.db import migrations def add_deferred_user_role(apps, schema_editor): DEFERRED_MENTOR = 'Deferred Mentor' UserRole = apps.get_model('accelerator', 'UserRole') Program = apps.get_model('accelerator', 'Program') ProgramRole = apps.get_model('...
Fix typo in inheritence/super call
"""This contains code for setting up parallel tempering calcs""" ######################################################################## # # # This script was written by Thomas Heavey in 2019. # # theavey@bu.edu thomasj...
"""This contains code for setting up parallel tempering calcs""" ######################################################################## # # # This script was written by Thomas Heavey in 2019. # # theavey@bu.edu thomasj...
Revert "Rebug sur le bouton ajouter quand on est en mode ajout le bouton n'est pas affiché" This reverts commit 039afa977340c9ae0342dd5cf9b03114768a3db1.
<span class="ombre"></span> <div id="col_scroller"> <div id="col_scroller_cont" class="clearfix"> <?php foreach ($details as $key => $detail): ?> <?php if (in_array($detail_action_mode, array('add', 'update')) && $key == $detail_key): ?> <?php include_partial('detailItemForm', array('detail'...
<span class="ombre"></span> <div id="col_scroller"> <div id="col_scroller_cont" class="clearfix"> <?php foreach ($details as $key => $detail): ?> <?php if (in_array($detail_action_mode, array('add', 'update')) && $key == $detail_key): ?> <?php include_partial('detailItemForm', array('detail'...
Add set_included function to twig to change the status of a template
<?php namespace Common\Core\Twig\Extensions; use Twig\Environment; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; final class IncludeOnceExtension extends AbstractExtension { /** @var array */ private $includedTemplates = []; public function getFunctions(): array { return [ ...
<?php namespace Common\Core\Twig\Extensions; use Twig\Environment; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; final class IncludeOnceExtension extends AbstractExtension { /** @var array */ private $includedTemplates = []; public function getFunctions(): array { return [ ...
Set up email templates for the accounts package only if email delivery is enabled
import { Accounts } from 'meteor/accounts-base'; import { GlobalSettings } from './GlobalSettings'; function setupEmailTemplatesForAccounts() { Accounts.emailTemplates.siteName = GlobalSettings.getSiteName(); Accounts.emailTemplates.from = Accounts.emailTemplates.siteName + '<' + GlobalSettings.getDefaultEmail...
import { Accounts } from 'meteor/accounts-base'; import {GlobalSettings} from './GlobalSettings'; Accounts.emailTemplates.siteName = GlobalSettings.getSiteName(); Accounts.emailTemplates.from = Accounts.emailTemplates.siteName + '<' + GlobalSettings.getDefaultEmailSenderAddress() + '>'; Accounts.emailTemplates.ve...
Fix KeyError in alerts implementation - Fix for alert that wasn't dismissing after refreshing the page
from django.core.urlresolvers import reverse from django.http.response import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.utils.translation import ugettext as _ from books.forms import BookForm from shared.models import BookType def index(request): book_list = BookType.obje...
from django.core.urlresolvers import reverse from django.http.response import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.utils.translation import ugettext as _ from books.forms import BookForm from shared.models import BookType def index(request): book_list = BookType.obje...
Update property of corporation name returned in search.
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Classes\EsiConnection; use Illuminate\Support\Facades\Log; class SearchController extends Controller { public function search(Request $request) { $esi = new EsiConnection; $result = $esi->esi->setQueryString([ ...
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Classes\EsiConnection; use Illuminate\Support\Facades\Log; class SearchController extends Controller { public function search(Request $request) { $esi = new EsiConnection; $result = $esi->esi->setQueryString([ ...
Set the default identifier to null
<?php namespace BinSoul\Net\Mqtt\Packet; /** * Provides methods for packets with an identifier. */ trait IdentifiablePacket { /** @var int */ private static $nextIdentifier = 0; /** @var int|null */ protected $identifier; /** * Returns the identifier or generates a new one. * * @...
<?php namespace BinSoul\Net\Mqtt\Packet; /** * Provides methods for packets with an identifier. */ trait IdentifiablePacket { /** @var int */ private static $nextIdentifier = 0; /** @var int */ protected $identifier = 0; /** * Returns the identifier or generates a new one. * * @r...
Change protected members to private
package com.sleekbyte.tailor.grammar; import com.sleekbyte.tailor.Tailor; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.PrintStream; impo...
package com.sleekbyte.tailor.grammar; import com.sleekbyte.tailor.Tailor; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.PrintStream; import static org.junit.Assert.assertEquals; public class GrammarTest { protec...
Make webpack dev server work for nested route paths.
const path = require('path'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({ inject: 'true', template: 'app/index.html' }); const extractLess = new ExtractTextPlugin({ filename: "...
const path = require('path'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({ inject: 'true', template: 'app/index.html' }); const extractLess = new ExtractTextPlugin({ filename: "...
Make WE use additive and multiplicative constants
from nalaf.features import FeatureGenerator from gensim.models import Word2Vec class WordEmbeddingsFeatureGenerator(FeatureGenerator): """ DOCSTRING """ def __init__(self, model_file, additive=0, multiplicative=1): self.model = Word2Vec.load(model_file) self.additive = additive ...
from nalaf.features import FeatureGenerator from gensim.models import Word2Vec class WordEmbeddingsFeatureGenerator(FeatureGenerator): """ DOCSTRING """ def __init__(self, model_file, weight=1): self.model = Word2Vec.load(model_file) self.weight = weight def generate(self, datase...
Test file loops over all the mounts
import os import importlib import warnings class TestOptronMount: mount = None def setup(self): print ("TestMount:setup() before each test method") def teardown(self): print ("TestMount:teardown() after each test method") @classmethod def setup_class(cls): mount_dir =...
from panoptes.mount.ioptron import iOptronMount class TestOptronMount: mount = None def setup(self): print ("TestMount:setup() before each test method") def teardown(self): print ("TestMount:teardown() after each test method") @classmethod def setup_class(cls): print ...
Update the project Development Status
"""Package Keysmith.""" import codecs import os.path import setuptools # type: ignore import keysmith # This project only depends on the standard library. def read(*parts): """Read a file in this repository.""" here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.path.join(here, *pa...
"""Package Keysmith.""" import codecs import os.path import setuptools # type: ignore import keysmith # This project only depends on the standard library. def read(*parts): """Read a file in this repository.""" here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.path.join(here, *pa...
Add onMove function to options
/* global console, Calendar, vis */ (function() { "use strict"; var calendar = new Calendar(); calendar.init(document.getElementById('visualization'), { height: "100vh", orientation: "top", zoomKey: 'shiftKey', zoomMax: 315360000000, zoomMin: 86400000, editable: { ...
/* global console, Calendar, vis */ (function() { "use strict"; var calendar = new Calendar(); calendar.init(document.getElementById('visualization'), { height: "100vh", orientation: "top", zoomKey: 'shiftKey', zoomMax: 315360000000, zoomMin: 86400000, editable: { ...
Add helper private method (isNullable)
<?php /** * This file is part of Railt package. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Railt\Reflection\Base\Behavior; use Railt\Reflection\Contracts\Behavior\AllowsTypeIndication; use Ra...
<?php /** * This file is part of Railt package. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Railt\Reflection\Base\Behavior; use Railt\Reflection\Contracts\Behavior\AllowsTypeIndication; use Ra...
Add audio type checks for MP3 and OGG Vorbis
/*global _:true, App:true, Backbone:true */ /*jshint forin:false, plusplus:false, sub:true */ 'use strict'; define([ 'zepto', 'install', 'datastore', 'collections/episodes', 'collections/podcasts', 'models/episode', 'models/podcast', 'views/app' ], function($, install, DataStore, Episod...
/*global _:true, App:true, Backbone:true */ /*jshint forin:false, plusplus:false, sub:true */ 'use strict'; define([ 'zepto', 'install', 'datastore', 'collections/episodes', 'collections/podcasts', 'models/episode', 'models/podcast', 'views/app' ], function($, install, DataStore, Episod...
[bugfix][ORANGE-293] Fix zero mount for doses
(function () { "use strict"; angular .module('orange') .directive('onlyNumbers', onlyNumbers); function onlyNumbers() { return { require: '?ngModel', scope: {}, link: function (scope, element, attributes, ngModel) { var _value; ...
(function () { "use strict"; angular .module('orange') .directive('onlyNumbers', onlyNumbers); function onlyNumbers() { return { require: '?ngModel', scope: {}, link: function (scope, element, attributes, ngModel) { var _value; ...
Make sure correct type is excluded
from collections import OrderedDict def form_questions(form): d = OrderedDict() children = form['children'] for child in children: if 'pathstr' in child and 'control' not in child and child['type'] != 'group': d.update({child['pathstr']: ''}) elif 'children' in child: ...
from collections import OrderedDict def form_questions(form): d = OrderedDict() children = form['children'] for child in children: if 'pathstr' in child and 'control' not in child: d.update({child['pathstr']: ''}) elif 'children' in child: for minor in child['childr...
[refactor] Use $document for unit test suppport.
/* global angular */ (function() { angular.module("googlechart") .factory("agcScriptTagHelper", agcScriptTagHelperFactory); agcScriptTagHelperFactory.$inject = ["$q", "$document"]; function agcScriptTagHelperFactory($q, $document) { /** Add a script tag to the document's head section an...
/* global angular */ (function() { angular.module("googlechart") .factory("agcScriptTagHelper", agcScriptTagHelperFactory); agcScriptTagHelperFactory.$inject = ["$q"]; function agcScriptTagHelperFactory($q) { /** Add a script tag to the document's head section and return an angular ...
Use same identifier as previous plugin version
const path = require('path'); const GitBook = require('gitbook-core'); const DisqusThread = require('react-disqus-thread'); const { React, Immutable } = GitBook; const DisqusFooter = React.createClass({ propTypes: { defaultIdentifier: React.PropTypes.string, page: GitBook.Shapes.Page, ...
const GitBook = require('gitbook-core'); const DisqusThread = require('react-disqus-thread'); const { React, Immutable } = GitBook; const DisqusFooter = React.createClass({ propTypes: { page: GitBook.Shapes.Page, shortName: React.PropTypes.string.isRequired, useIdentifier: Reac...
Fix toolbar scrolling when scrolling basic comment editor
package com.gh4a.widget; import android.support.design.widget.AppBarLayout; import android.support.design.widget.CoordinatorLayout; import android.view.MotionEvent; import android.view.View; public class ToggleableAppBarLayoutBehavior extends AppBarLayout.Behavior { private boolean mEnabled = true; public vo...
package com.gh4a.widget; import android.support.design.widget.AppBarLayout; import android.support.design.widget.CoordinatorLayout; import android.view.MotionEvent; import android.view.View; public class ToggleableAppBarLayoutBehavior extends AppBarLayout.Behavior { private boolean mEnabled = true; public vo...
Return errors in json only
import os import json import httplib as http import tornado.web import tornado.ioloop from dinosaurs import api from dinosaurs import settings class SingleStatic(tornado.web.StaticFileHandler): def initialize(self, path): self.dirname, self.filename = os.path.split(path) super(SingleStatic, self...
import os import json import httplib as http import tornado.web import tornado.ioloop from dinosaurs import api from dinosaurs import settings class SingleStatic(tornado.web.StaticFileHandler): def initialize(self, path): self.dirname, self.filename = os.path.split(path) super(SingleStatic, self...
Change the notification object for an array
<?php namespace App\Notifications; use function array_key_exists; use GuzzleHttp\Client; use Illuminate\Http\Request; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; class RequestReview extends Notification { public $notification; public $client; /** ...
<?php namespace App\Notifications; use GuzzleHttp\Client; use Illuminate\Http\Request; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; class RequestReview extends Notification { public $notification; public $client; /** * Create a new notification ins...
Change from local storage to chrome storage
import getWeatherInfo from './get-weather-info'; import fetchRandomPhoto from './fetch-random-photo'; import { lessThanOneHourAgo, lessThan24HoursAgo } from './helpers'; /* * Load the next image and update the weather */ const loadNewData = () => { chrome.storage.sync.get('photoFrequency', result => { const {...
import getWeatherInfo from './get-weather-info'; import fetchRandomPhoto from './fetch-random-photo'; import { lessThanOneHourAgo, lessThan24HoursAgo } from './helpers'; /* * Load the next image and update the weather */ const loadNewData = () => { chrome.storage.sync.get('photoFrequency', result => { const {...
Make use of the events provided by chosen. Make it work when using the search field.
/* * Chosen jQuery plugin to add an image to the dropdown items. */ (function($) { $.fn.chosenImage = function(options) { return this.each(function() { var $select = $(this); var imgMap = {}; // 1. Retrieve img-src from data attribute and build object of image sources...
/* * Chosen jQuery plugin to add an image to the dropdown items. */ (function($) { $.fn.chosenImage = function(options) { return this.each(function() { var $select = $(this); var imgMap = {}; // 1. Retrieve img-src from data attribute and build object of image sources...
Make sure that 'stop' works from everywhere
""" Very basic implementation of an event loop ========================================== The eventloop is a singleton to schedule and run events. Exports ------- - ``EventLoop``: the basic eventloop """ import asyncio import queue import sched import threading import time from .singleton import Singleton clas...
""" Very basic implementation of an event loop ========================================== The eventloop is a singleton to schedule and run events. Exports ------- - ``EventLoop``: the basic eventloop """ import asyncio import queue import sched import threading import time from .singleton import Singleton clas...
Load content snippets conditionally and add pagination links
<?php get_header(); ?> <div class="container"> <div id="primary" class="content-area"> <?php get_template_part(SNIPPETS_DIR . '/header/page', 'header'); ?> <main id="main" class="site-main" role="main"> <?php if (have_posts()) : /* Start the Loop */ ...
<?php get_header(); ?> <div class="container"> <?php // get_template_part(SNIPPETS_DIR . '/header/page', 'header'); ?> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php if (have_posts()) : /* Start the Loop */ ...
Make debug logging a bit more consistent
import os from twisted.internet import reactor from heufybot import HeufyBot, HeufyBotFactory from config import Config class BotHandler(object): factories = {} globalConfig = None def __init__(self): print "--- Loading configs..." self.globalConfig = Config("globalconfig.yml") sel...
import os from twisted.internet import reactor from heufybot import HeufyBot, HeufyBotFactory from config import Config class BotHandler(object): factories = {} globalConfig = None def __init__(self): print "--- Loading configs..." self.globalConfig = Config("globalconfig.yml") sel...
Remove comment about former functionality
// on click of a tag, it should be toggled - either added to or removed from an internal tracking // array and its style changed. // // When the internal array changes, it should write out a new tag list to the hidden input (function($) { $(document).ready(function() { $(".taggit-labels").closest("div").each(fun...
// on click of a tag, it should be toggled - either added to or removed from an internal tracking // array and its style changed. // // When the internal array changes, it should write out a new tag list to the hidden input (function($) { $(document).ready(function() { // TODO this line assumes one tag field and...
Fix para que los jugadores mantengan su posición
/** * Created by ivan on 10/5/14. */ angular.module('Frosch') .factory('ConfiguracionService', function ($http, $translate) { var clase = function () { var me = this; this.equipos = true; this.maxPorEquipo = 1; this.puntos = 800; this.numJugador...
/** * Created by ivan on 10/5/14. */ angular.module('Frosch') .factory('ConfiguracionService', function ($http, $translate) { var clase = function () { var me = this; this.equipos = true; this.maxPorEquipo = 1; this.puntos = 800; this.numJugador...
Update archan provider for archan 3.0
# -*- coding: utf-8 -*- """dependenpy plugins module.""" try: from archan import Provider, Argument, DesignStructureMatrix as ArchanDSM from .dsm import DSM as DependenpyDSM from .helpers import guess_depth class InternalDependencies(Provider): """Dependenpy provider for Archan.""" i...
# -*- coding: utf-8 -*- """dependenpy plugins module.""" try: from archan import Provider, Argument, DSM as ArchanDSM from .dsm import DSM as DependenpyDSM from .helpers import guess_depth class InternalDependencies(Provider): """Dependenpy provider for Archan.""" identifier = 'depen...
Add apiErrorResponse to caught errors during login
<?php namespace App\Api\Controllers\Auth; use Validator; use Illuminate\Http\Request; use App\Api\Controllers\ApiController; class LoginController extends ApiController { /** * Get a validator for an incoming login request. * * @param array $data * @return \Illuminate\Contracts\Validation\V...
<?php namespace App\Api\Controllers\Auth; use Validator; use Illuminate\Http\Request; use App\Api\Controllers\ApiController; class LoginController extends ApiController { /** * Get a validator for an incoming login request. * * @param array $data * @return \Illuminate\Contracts\Validation\V...
Create 1 temp directory if no number is given
import functools import tempfile import shutil class makedirs(object): def __init__(self, num=1): self._num = num def __call__(self, fn): @functools.wraps(fn) def wrapper(*args, **kwargs): def manager(): try: dirs = [ ...
import functools import tempfile import shutil class makedirs(object): def __init__(self, num): self._num = num def __call__(self, fn): @functools.wraps(fn) def wrapper(*args, **kwargs): def manager(): try: dirs = [ ...
Enable retreiving of only latest event from fb.
import { SET_LATEST_EVENT, SET_EXISTING } from './constants' import fbapi from 'toolbox/fbapi' import moment from 'moment' export function setLatestEvent(event) { return { type: SET_LATEST_EVENT, payload: { event: event } } } export function setExisting() { return { type: SET_EXISTING } ...
import { SET_LATEST_EVENT, SET_EXISTING } from './constants' import fbapi from 'toolbox/fbapi' import moment from 'moment' export function setLatestEvent(event) { return { type: SET_LATEST_EVENT, payload: { event: event } } } export function setExisting() { return { type: SET_EXISTING } ...
Remove gorlin_glue from generated docs for now. It produces about 100 warnings during doc build. git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@926 ead46cd0-7350-4e37-8683-fc4c6f79bf00
#!/usr/bin/env python """Script to auto-generate our API docs. """ # stdlib imports import os import sys # local imports from apigen import ApiDocWriter #***************************************************************************** if __name__ == '__main__': nipypepath = os.path.abspath('..') sys.path.insert(...
#!/usr/bin/env python """Script to auto-generate our API docs. """ # stdlib imports import os import sys # local imports from apigen import ApiDocWriter #***************************************************************************** if __name__ == '__main__': nipypepath = os.path.abspath('..') sys.path.insert(...
Add ajax calls for sending emails
/** * Created by nkmathew on 23/06/2016. */ $(document).ready(function () { var source = $("#email-list-template").html(); var template = Handlebars.compile(source); var html = template({email: 'ngetich.kipkoech@students.jkuat.ac.ke'}); $('#email-list-section').append(html); $("#em...
/** * Created by nkmathew on 23/06/2016. */ $(document).ready(function () { var source = $("#email-list-template").html(); var template = Handlebars.compile(source); var html = template({email: 'ngetich.kipkoech@students.jkuat.ac.ke'}); $('#email-list-section').append(html); $("#em...
Check email address is not already used. Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>
from django import forms from django.contrib.auth.models import User from librement.profile.enums import AccountEnum from librement.account.models import Email from librement.profile.models import Profile class RegistrationForm(forms.ModelForm): email = forms.EmailField() password = forms.CharField() pa...
from django import forms from django.contrib.auth.models import User from librement.profile.enums import AccountEnum from librement.profile.models import Profile class RegistrationForm(forms.ModelForm): email = forms.EmailField() password = forms.CharField() password_confirm = forms.CharField() cla...
Fix an error causing incorrect types
<?php /** * Front End Accounts * * @category WordPress * @package FrontEndAcounts * @since 0.1 * @author Christopher Davis <http://christopherdavis.me> * @copyright 2013 Christopher Davis * @license http://opensource.org/licenses/MIT MIT */ namespace Chrisguitarguy\FrontEndAccounts\For...
<?php /** * Front End Accounts * * @category WordPress * @package FrontEndAcounts * @since 0.1 * @author Christopher Davis <http://christopherdavis.me> * @copyright 2013 Christopher Davis * @license http://opensource.org/licenses/MIT MIT */ namespace Chrisguitarguy\FrontEndAccounts\For...
Fix "Add your company" button
/** * @jsx React.DOM */ const React = require('React'); const Site = require('Site'); const Container = require('Container'); const siteConfig = require('../../siteConfig.js'); class UserShowcase extends React.Component { render() { const showcase = siteConfig.users.map(user => { return ( <a hre...
/** * @jsx React.DOM */ const React = require('React'); const Site = require('Site'); const Container = require('Container'); const siteConfig = require('../../siteConfig.js'); class UserShowcase extends React.Component { render() { const showcase = siteConfig.users.map(user => { return ( <a hre...
Make global explicit in module scope This is mainly because tests don't inferr that global variables are just properties of the window object, as browsers do, but it also makes this more explicit.
(function(global) { "use strict"; var queues = {}; var dd = new global.diffDOM(); var getRenderer = $component => response => dd.apply( $component.get(0), dd.diff($component.get(0), $(response[$component.data('key')]).get(0)) ); var getQueue = resource => ( queues[resource] = queues[resource]...
(function(Modules) { "use strict"; var queues = {}; var dd = new diffDOM(); var getRenderer = $component => response => dd.apply( $component.get(0), dd.diff($component.get(0), $(response[$component.data('key')]).get(0)) ); var getQueue = resource => ( queues[resource] = queues[resource] || []...
Add failure message when testing whether a string matches a regex
package com.insightfullogic.lambdabehave.expectations; import org.hamcrest.Matcher; import org.hamcrest.Matchers; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; /** * . */ public final class StringExpectation extends BoundExpectation<String> { public StringExpectation(fin...
package com.insightfullogic.lambdabehave.expectations; import org.hamcrest.Matcher; import org.hamcrest.Matchers; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; /** * . */ public final class StringExpectation extends BoundExpectation<String> { public StringExpectation(fin...
[Command] Add property for bills repository
<?php namespace HCLabs\Bills\Command\Scenario\CreateBillsForAccount; use HCLabs\Bills\Command\Handler\AbstractCommandHandler; use HCLabs\Bills\Model\Bill; use HCLabs\Bills\Model\Repository\BillRepository; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class CreateBillsForAccountCommandHandler extend...
<?php namespace HCLabs\Bills\Command\Scenario\CreateBillsForAccount; use HCLabs\Bills\Command\Handler\AbstractCommandHandler; use HCLabs\Bills\Model\Bill; use HCLabs\Bills\Model\Repository\BillRepository; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class CreateBillsForAccountCommandHandler extend...
Add flushing for console logging
package com.proofpoint.log; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Handler; import java.util.logging.LogRecord; import static java.nio.charset.StandardCharsets.UTF_8; ...
package com.proofpoint.log; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.util.logging.Handler; import java.util.logging.LogRecord; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.logging.ErrorManager.CLOSE_FAILURE; import static java...
Add promise version of copy method
const fs = require('fs') const util = require('util') const path = require('path') class FsUtils { static get chmod() { return util.promisify(fs.chmod) } static get readFile() { return util.promisify(fs.readFile) } static get copyFile() { return util.promisify(fs.copyFile) } static get sym...
const fs = require('fs') const util = require('util') const path = require('path') class FsUtils { static get chmod() { return util.promisify(fs.chmod) } static get readFile() { return util.promisify(fs.readFile) } static get symlink() { return util.promisify(fs.symlink) } static get write...
Update the idProperty and labelProperty of the store properly based on what the picklist is using.
/* * Copyright (c) 1997-2013, SalesLogix, NA., LLC. All rights reserved. */ /** * @class Mobile.SalesLogix.Views.PickList * * * @extends Sage.Platform.Mobile.List * */ define('Mobile/SalesLogix/Views/PickList', [ 'dojo/_base/declare', 'dojo/string', 'Sage/Platform/Mobile/List' ], function( decl...
/* * Copyright (c) 1997-2013, SalesLogix, NA., LLC. All rights reserved. */ /** * @class Mobile.SalesLogix.Views.PickList * * * @extends Sage.Platform.Mobile.List * */ define('Mobile/SalesLogix/Views/PickList', [ 'dojo/_base/declare', 'dojo/string', 'Sage/Platform/Mobile/List' ], function( decl...
Initialize earlier the Everlive instance.
(function (global) { 'use strict'; var app = global.app = global.app || {}; app.everlive = new Everlive({ apiKey: app.config.everlive.apiKey, scheme: app.config.everlive.scheme }); var fixViewResize = function () { if (device.platform === 'iOS') { ...
(function (global) { 'use strict'; var app = global.app = global.app || {}; var fixViewResize = function () { if (device.platform === 'iOS') { setTimeout(function() { $(document.body).height(window.innerHeight); }, 10); } }; var...
Set log with small message
# -*- coding: utf-8 -*- import sys from traceback import format_exception from pyramid.decorator import reify from pyramid.httpexceptions import HTTPInternalServerError from pyramid.interfaces import IRequestFactory from ines.convert import force_string from ines.middlewares import Middleware from ines.utils import ...
# -*- coding: utf-8 -*- import sys from traceback import format_exception from pyramid.decorator import reify from pyramid.httpexceptions import HTTPInternalServerError from pyramid.interfaces import IRequestFactory from ines.middlewares import Middleware from ines.utils import format_error_to_json class LoggingMi...
Fix Chrome headless when root on Linux Fix Chrome headless when running as root by adding --no-sandbox.
// Copyright (c) Martin Costello, 2016. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. const puppeteer = require("puppeteer"); process.env.CHROME_BIN = puppeteer.executablePath(); module.exports = function (config) { config.set...
// Copyright (c) Martin Costello, 2016. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. const puppeteer = require("puppeteer"); process.env.CHROME_BIN = puppeteer.executablePath(); module.exports = function (config) { config.set...
Remove "1" from possible $alphabet Remove "1" from possible $alphabet. Fixes #1
<?php namespace Allty\Utils; class Base58 { static $alphabet = '23456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; const BASE = 58; public static function encode($int) { if(!is_integer($int)) { throw new \InvalidArgumentException('$int must be an integer...
<?php namespace Allty\Utils; class Base58 { static $alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; const BASE = 58; public static function encode($int) { if(!is_integer($int)) { throw new \InvalidArgumentException('$int must be an intege...
Fix selectedLabels selected$ merge function As we did for localStorage, we should also consider that values can change over time and so newSelected may not be part of it anymore. Fallback onto props.select() method in such case − which will here deal with localStorage values… or take the first/last value as the last ...
import { div, select, option, label } from '@cycle/dom'; import { Observable } from 'rx'; import R from 'ramda'; function LabeledSelect({ DOM, props$, values$ }) { const newSelected$ = DOM .select('.select') .events('input') .map(ev => ev.target.value) .startWith(null); const selected$ = Observabl...
import { div, select, option, label } from '@cycle/dom'; import { Observable } from 'rx'; import R from 'ramda'; function LabeledSelect({ DOM, props$, values$ }) { const newSelected$ = DOM .select('.select') .events('input') .map(ev => ev.target.value) .startWith(null); const selected$ = Observabl...
Make sure that the select queries return records otherwise, bail
'use strict'; exports.up = function (knex, Promise) { return knex('publishedProjects') .whereNull('date_created') .orWhereNull('date_updated') .select('id', 'date_created', 'date_updated') .then(function(publishedProjects) { if (!publishedProjects) { return; } return Promise.map(publishedP...
'use strict'; exports.up = function (knex, Promise) { return knex('publishedProjects') .whereNull('date_created') .orWhereNull('date_updated') .select('id', 'date_created', 'date_updated') .then(function(publishedProjects) { return Promise.map(publishedProjects, function(publishedProject) { var pub...
Fix logic error with searching of composer loader
<?php /** * Parser Reflection API * * @copyright Copyright 2015, Lisachenko Alexander <lisachenko.it@gmail.com> * * This source file is subject to the license that is bundled * with this source code in the file LICENSE. */ namespace ParserReflection\Locator; use Composer\Autoload\ClassLoader; use ParserReflec...
<?php /** * Parser Reflection API * * @copyright Copyright 2015, Lisachenko Alexander <lisachenko.it@gmail.com> * * This source file is subject to the license that is bundled * with this source code in the file LICENSE. */ namespace ParserReflection\Locator; use Composer\Autoload\ClassLoader; use ParserReflec...
Convert Trans::trans() to use __() instead
<?php namespace Bolt\Nut; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Bolt\Translation\Translator as Trans; class ExtensionsEnable extends BaseCommand { protected function configure() { ...
<?php namespace Bolt\Nut; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Bolt\Translation\Translator as Trans; class ExtensionsEnable extends BaseCommand { protected function configure() { ...
Hide for your own account.
import React from 'react'; import steem from 'steem' import { Button } from 'semantic-ui-react' export default class AccountFollow extends React.Component { constructor(props) { super(props) this.state = { processing: false, following: props.account.following || [] } } componentWillRecei...
import React from 'react'; import steem from 'steem' import { Button } from 'semantic-ui-react' export default class AccountFollow extends React.Component { constructor(props) { super(props) this.state = { processing: false, following: props.account.following || [] } } componentWillRecei...
Disable POST approved invoice for now Need to rethink this. Looks like some dependency change (swagger-tools) broke this. Anyway, there should be a way to transform drafts into approved into paid. Maybe single endpoint would do.
'use strict'; module.exports = { 'get': { 'description': 'This endpoint returns information about invoices that have been approved. The response includes basic details of each invoice, such as sender and receiver information.', 'responses': { '200': { 'description': 'An...
'use strict'; module.exports = { 'get': { 'description': 'This endpoint returns information about invoices that have been approved. The response includes basic details of each invoice, such as sender and receiver information.', 'responses': { '200': { 'description': 'An...
Use literal function for citext array default value, not string
'use strict' module.exports = function (sequelize, DataTypes) { let User = sequelize.define('User', { id: { type: DataTypes.UUID, primaryKey: true, defaultValue: DataTypes.UUIDV4 }, email: { type: DataTypes.STRING, allowNull: false }, password: { type: DataType...
'use strict' module.exports = function (sequelize, DataTypes) { let User = sequelize.define('User', { id: { type: DataTypes.UUID, primaryKey: true, defaultValue: DataTypes.UUIDV4 }, email: { type: DataTypes.STRING, allowNull: false }, password: { type: DataType...