text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix for not-markdown texts on .md pages
<?php /** * DokuWiki Plugin markdownextra (Action Component) * * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html * @author Andreas Gohr <andi@splitbrain.org> */ // must be run within Dokuwiki if (!defined('DOKU_INC')) die(); if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugin...
<?php /** * DokuWiki Plugin markdownextra (Action Component) * * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html * @author Andreas Gohr <andi@splitbrain.org> */ // must be run within Dokuwiki if (!defined('DOKU_INC')) die(); if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugin...
Add possibility to configure the action CHANGELOG update
<?php namespace Liip\RMT\Action; use Liip\RMT\Changelog\ChangelogManager; use Liip\RMT\Context; /** * Update the changelog file */ class ChangelogUpdateAction extends BaseAction { protected $options; public function __construct($options) { $this->options = array_merge(array( 'dump-...
<?php namespace Liip\RMT\Action; use Liip\RMT\Changelog\ChangelogManager; use Liip\RMT\Context; /** * Update the changelog file */ class ChangelogUpdateAction extends BaseAction { protected $options; public function __construct($options) { $this->options = $options; } public function ...
Update the RB.APIToken resource to use a defaults function This change updates the `RB.APIToken` resource to use the new `defaults` function that all other resources are using. Testing Done: Ran JS tests. Reviewed at https://reviews.reviewboard.org/r/7394/
RB.APIToken = RB.BaseResource.extend({ defaults: function() { return _.defaults({ tokenValue: null, note: null, policy: {}, userName: null }, RB.BaseResource.prototype.defaults()); }, rspNamespace: 'api_token', url: function() { v...
RB.APIToken = RB.BaseResource.extend({ defaults: _.defaults({ tokenValue: null, note: null, policy: {}, userName: null }, RB.BaseResource.prototype.defaults), rspNamespace: 'api_token', url: function() { var url = SITE_ROOT + (this.get('localSitePrefix') || '') ...
Change repository URL to point to OpenPrinting's organisation
#!/usr/bin/env python from distutils.core import setup from distutils.command.sdist import sdist as _sdist class sdist(_sdist): def run(self): try: import sys sys.path.append("contrib") import git2changes print('generating CHANGES.txt') with open...
#!/usr/bin/env python from distutils.core import setup from distutils.command.sdist import sdist as _sdist class sdist(_sdist): def run(self): try: import sys sys.path.append("contrib") import git2changes print('generating CHANGES.txt') with open...
Improve url in the test.
/*global describe, beforeEach, module, inject, it, expect*/ /*jslint nomen: true*/ describe('Post module', function () { "use strict"; beforeEach(module('post')); var PostManager, Post, $httpBackend, $rootScope; beforeEach(inject(function ($injector) { $httpBackend = $injector.get("$httpBacken...
/*global describe, beforeEach, module, inject, it, expect*/ /*jslint nomen: true*/ describe('Post module', function () { "use strict"; beforeEach(module('post')); var PostManager, Post, $httpBackend, $rootScope; beforeEach(inject(function ($injector) { $httpBackend = $injector.get("$httpBacken...
Refactor Dusk Breadcrumbs test to be more efficient
<?php namespace Tests\Browser; use App\Models\User; use Laravel\Dusk\Browser; use Tests\DuskTestCase; class BreadcrumbsTest extends DuskTestCase { public function testBreadcrumbsForPagesThatDoNotRequiredAuthentication(): void { $breadcrumbs = $this->guestPagesBreadcrumbs(); $this->browse(fun...
<?php namespace Tests\Browser; use App\Models\User; use Laravel\Dusk\Browser; use Tests\DuskTestCase; class BreadcrumbsTest extends DuskTestCase { /** * @dataProvider guestPagesBreadcrumbs */ public function testBreadcrumbsForPagesThatDoNotRequiredAuthentication(string $url, array $crumbs): void ...
Fix logical error in FAB scroll behaviour FAB was not re-drawing on scroll up in recycler view.
package com.bookbase.bookbase.fragments.behaviour; import android.content.Context; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.FloatingActionButton; import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.view.View; public class FABS...
package com.bookbase.bookbase.fragments.behaviour; import android.content.Context; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.FloatingActionButton; import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.view.View; public class FABS...
Use the new mechanism for the callback functions
/** * @constructor * @param {string} baseURL - URL for the Open PHACTS API * @param {string} appID - Application ID for the application being used. Created by https://dev.openphacts.org * @param {string} appKey - Application Key for the application ID. * @license [MIT]{@link http://opensource.org/licenses/MIT} * ...
/** * @constructor * @param {string} baseURL - URL for the Open PHACTS API * @param {string} appID - Application ID for the application being used. Created by https://dev.openphacts.org * @param {string} appKey - Application Key for the application ID. * @license [MIT]{@link http://opensource.org/licenses/MIT} * ...
Return current user as promise (saas-185)
'use strict'; (function() { angular.module('ncsaas') .service('usersService', ['RawUser', 'RawKey', usersService]); function usersService(RawUser, RawKey) { /*jshint validthis: true */ var vm = this; vm.getCurrentUser = getCurrentUser; vm.getCurrentUserWithKeys = getCurrentUserWithKeys; vm...
'use strict'; (function() { angular.module('ncsaas') .service('usersService', ['RawUser', 'RawKey', usersService]); function usersService(RawUser, RawKey) { /*jshint validthis: true */ var vm = this; vm.getCurrentUser = getCurrentUser; vm.getCurrentUserWithKeys = getCurrentUserWithKeys; vm...
Delete Loki database and persistent storage on logout.
/** * Copyright 2015, Government of Canada. * All rights reserved. * * This source code is licensed under the MIT license. * * @providesModule User */ var Cookie = require('react-cookie'); var Events = require('./Events'); /** * An object that manages all user authentication and the user profile. * * @const...
/** * Copyright 2015, Government of Canada. * All rights reserved. * * This source code is licensed under the MIT license. * * @providesModule User */ var Cookie = require('react-cookie'); var Events = require('./Events'); /** * An object that manages all user authentication and the user profile. * * @const...
Remove the unnecessary dot that matches everything
/* 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/. */ // @flow /** * Takes a string and returns the string with public URLs removed. * It doesn't remove the URLs lik...
/* 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/. */ // @flow /** * Takes a string and returns the string with public URLs removed. * It doesn't remove the URLs lik...
Revert unintend change. Fixes bug.
# A context carrying the loaded configuration. from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver import config class ConfigContext(object): def __init__(self, config): self._config = config self._cloud_workstations = {} self._volumes = {} ...
# A context carrying the loaded configuration. from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver import config class ConfigContext(object): def __init__(self, config): self._config = config self._cloud_workstations = {} self._volumes_by_cws = {...
Fix issue with brackets in generated queries.
(function () { 'use strict'; define( [ 'lodash', 'jquery' ], function (_, $) { return function (baseUrl, ajaxOptions, noCache, logErrors) { var queryString; queryString = function (parameters) { ret...
(function () { 'use strict'; define( [ 'lodash', 'jquery' ], function (_, $) { return function (baseUrl, ajaxOptions, noCache, logErrors) { var queryString; queryString = function (parameters) { ret...
Remove python prefix from name
from __future__ import unicode_literals import re from setuptools import setup, find_packages def get_version(filename): content = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content)) return metadata['version'] setup( name='tunigo', version=get_version('tunigo/...
from __future__ import unicode_literals import re from setuptools import setup, find_packages def get_version(filename): content = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content)) return metadata['version'] setup( name='Python-Tunigo', version=get_version('...
Update defaultSetting with defaut rosbridge address Hi, Currently no address are provide as default, so the page stop loading and we cannot configure where the WS server (rosbridge) is . By using location.hostname as address we provide webserver addresse as default (usualy the same as ws server) and port 9090 is ...
angular.module('roscc') .controller('SettingsController', function($scope, localStorageService) { $scope.add = function() { $scope.settings.push( JSON.parse(JSON.stringify(defaultSetting)) ); // Clone object $scope.selectedSettingIndex = String($scope.settings.length - 1); };...
angular.module('roscc') .controller('SettingsController', function($scope, localStorageService) { $scope.add = function() { $scope.settings.push( JSON.parse(JSON.stringify(defaultSetting)) ); // Clone object $scope.selectedSettingIndex = String($scope.settings.length - 1); };...
Check for vendor returned by API call in my-rep directive. This prevents tray from showing if there is no vendor!
angular .module('app') .directive("myRep", ['$location', 'authService', 'vendorService', '$document', function($location, authService, vendorService, $document) { return { replace: true, templateUrl: 'app/templates/directives/myRep.html', link:...
angular .module('app') .directive("myRep", ['$location', 'authService', 'vendorService', '$document', function($location, authService, vendorService, $document) { return { replace: true, templateUrl: 'app/templates/directives/myRep.html', link:...
Make runner stop when player last action is to end
package wumpus; import java.util.Iterator; import java.util.NoSuchElementException; import wumpus.Environment.Result; import wumpus.Environment.Action; /** * The iteration of plays that the player can take until reaches its end. */ public class Runner implements Iterable<Player>, Iterator<Player> { private fin...
package wumpus; import java.util.Iterator; import java.util.NoSuchElementException; import wumpus.Environment.Result; /** * The iteration of plays that the player can take until reaches its end. */ public class Runner implements Iterable<Player>, Iterator<Player> { private final World world; private int it...
Use Numpy dtype when creating Numpy array (as opposed to the Numba dtype)
import numpy as np from numba import from_dtype, cuda from numba import unittest_support as unittest class TestAlignment(unittest.TestCase): def test_record_alignment(self): rec_dtype = np.dtype([('a', 'int32'), ('b', 'float64')], align=True) rec = from_dtype(rec_dtype) @cuda.jit((rec[:],...
import numpy as np from numba import from_dtype, cuda from numba import unittest_support as unittest class TestAlignment(unittest.TestCase): def test_record_alignment(self): rec_dtype = np.dtype([('a', 'int32'), ('b', 'float64')], align=True) rec = from_dtype(rec_dtype) @cuda.jit((rec[:],...
Add machine name to heap dump file name
/** * Created by ronyadgar on 29/11/2015. */ var heapdump = require('heapdump'); var logger = require('./logger/logger')(module); var fs = require('fs'); var config = require('./../common/Configuration'); var path = require('path'); var hostname = require('../common/utils/hostname'); module.exports = (function(){ ...
/** * Created by ronyadgar on 29/11/2015. */ var heapdump = require('heapdump'); var logger = require('./logger/logger')(module); var fs = require('fs'); var config = require('./../common/Configuration'); var path = require('path'); module.exports = (function(){ var timeInterval = config.get('heapDumpParams').t...
Clarify what the happens in argument analysis
module.exports = class Call { constructor(callee, args) { this.callee = callee; this.args = args; } analyze(context) { this.callee.analyze(context); context.assertIsFunction(this.callee.referent); this.checkNumberOfArguments(this.callee.referent); this.checkArgumentNamesAndPositionalRules...
module.exports = class Call { constructor(callee, args) { this.callee = callee; this.args = args; } analyze(context) { this.callee.analyze(context); context.assertIsFunction(this.callee.referent); this.checkNumberOfArguments(this.callee.referent); this.checkArgumentNamesAndPositionalRules...
Add check for redeclared symbols.
package pt.up.fe.comp.utils; import java.util.Stack; public class SymbolTable<T> { public SymbolTable(boolean lazy) { _lazy = lazy; beginScope(); } public void beginScope() { _scopes.add(new Scope<T>(_lazy)); } public void endScope() { // do not delete "global" s...
package pt.up.fe.comp.utils; import java.util.Stack; public class SymbolTable<T> { public SymbolTable(boolean lazy) { _lazy = lazy; beginScope(); } public void beginScope() { _scopes.add(new Scope<T>(_lazy)); } public void endScope() { // do not delete "global" s...
Fix issue with create_superuser method on UserManager
from django.utils import timezone from django.contrib.auth.models import BaseUserManager from model_utils.managers import InheritanceQuerySet from .conf import settings class UserManager(BaseUserManager): def _create_user(self, email, password, is_staff, is_superuser, **extra_fields): ...
from django.utils import timezone from django.contrib.auth.models import BaseUserManager from model_utils.managers import InheritanceQuerySet from .conf import settings class UserManager(BaseUserManager): def _create_user(self, email, password, is_staff, is_superuser, **extra_fields): ...
Remove unneeded TEST_RUN_EDIT permission from default new user role.
from django.core.management.base import BaseCommand, CommandError from ...api import admin from ...models import Company, CompanyList from ....users.models import Role, RoleList, PermissionList DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([ "PERMISSION_COMPANY_INFO_VIEW", "PERMISSION_PRODUCT_VIEW", ...
from django.core.management.base import BaseCommand, CommandError from ...api import admin from ...models import Company, CompanyList from ....users.models import Role, RoleList, PermissionList DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([ "PERMISSION_COMPANY_INFO_VIEW", "PERMISSION_PRODUCT_VIEW", ...
Add red color on dislikes
import React, { Component } from 'react'; import { Link } from 'react-router'; import Avatar from '../widgets/Avatar'; import './LikesList.scss'; export default class LikesList extends Component { constructor(props) { super(props); this.state = { show: 10, }; } handleShowMore() { this.setS...
import React, { Component } from 'react'; import { Link } from 'react-router'; import Avatar from '../widgets/Avatar'; import './LikesList.scss'; export default class LikesList extends Component { constructor(props) { super(props); this.state = { show: 10, }; } handleShowMore() { this.setS...
Update list command to display table
<?php namespace NZTim\Queue\Commands; use Illuminate\Console\Command; use NZTim\Queue\QueuedJob\QueuedJob; use NZTim\Queue\QueueManager; class ListCommand extends Command { protected $signature = 'queuemgr:list {days=7}'; protected $description = 'Lists recent jobs within the specified number of days'; ...
<?php namespace NZTim\Queue\Commands; use Illuminate\Console\Command; use NZTim\Queue\QueueManager; class ListCommand extends Command { protected $signature = 'queuemgr:list {days=7}'; protected $description = 'Lists recent jobs within the specified number of days'; /** @var QueueManager */ protecte...
Refactor adding temp to permutations
"""Leetcode 46. Permutations Medium URL: https://leetcode.com/problems/permutations/ Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] """ class Solution(object): def _backtrack(self, pe...
"""Leetcode 46. Permutations Medium URL: https://leetcode.com/problems/permutations/ Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] """ class Solution(object): def _backtrack(self, pe...
Increase the version to 0.2 An backward incompatible change was introduced by removing the package names metadata from the inventory core. If necessary, it is hereby advised to provide the metadata in other ways supported by ansible, such as variables defined on role or playbook level.
# coding: utf-8 # Author: Milan Kubik from setuptools import setup, find_packages with open('README.md') as f: long_description = f.read() setup( name='ipaqe-dyndir', version='0.2.0', description='Ansible dynamic inventory for FreeIPA', long_description=long_description, keywords='freeipa te...
# coding: utf-8 # Author: Milan Kubik from setuptools import setup, find_packages with open('README.md') as f: long_description = f.read() setup( name='ipaqe-dyndir', version='0.1.4', description='Ansible dynamic inventory for FreeIPA', long_description=long_description, keywords='freeipa te...
Remove a bit of django boilerplate
from django.test import TestCase from django.test.client import Client from signups.models import User from splinter_demo.test_runner import BROWSER class TestSignup(TestCase): def visit(self, path): BROWSER.visit('http://localhost:65432' + path) def test_sign_up(self): Client().post('/', {'e...
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase from django.test.client import Client from signups.models import User from splinter_demo.test_runner im...
Add mergeApiHeaders and mergeApiBody method. Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
<?php namespace Katsana\Sdk; use GuzzleHttp\Psr7\Uri; use Laravie\Codex\Request as BaseRequest; abstract class Request extends BaseRequest { /** * Get API Header. * * @return array */ protected function getApiHeaders() { $headers = [ 'Accept' => "application/vnd.KA...
<?php namespace Katsana\Sdk; use GuzzleHttp\Psr7\Uri; use Laravie\Codex\Request as BaseRequest; abstract class Request extends BaseRequest { /** * Get API Header. * * @return array */ protected function getApiHeaders() { $headers = [ 'Accept' => "application/vnd.KA...
Fix @csutter's sloppy code style
define([ "jquery", "lib/utils/viewport_helper" ], function($, isInViewport) { "use strict"; var HeroParallax, _pageYOffset, started = false, speed = 15, els; HeroParallax = function( args ) { this.$els = args.els || $(".js-bg-parallax"); $(window).bind("scroll", $.proxy(this._onS...
define([ "jquery", "lib/utils/viewport_helper" ], function($, isInViewport) { "use strict"; var HeroParallax, _pageYOffset, started = false, speed = 15, els; HeroParallax = function( args ) { this.$els = args.els || $(".js-bg-parallax"); $(window).bind("scroll", $.proxy(this._onS...
Reorder ENV urls redis providers.
import os from django.conf import settings SESSION_REDIS_HOST = getattr( settings, 'SESSION_REDIS_HOST', '127.0.0.1' ) SESSION_REDIS_PORT = getattr( settings, 'SESSION_REDIS_PORT', 6379 ) SESSION_REDIS_DB = getattr( settings, 'SESSION_REDIS_DB', 0 ) SESSION_REDIS_PREFIX = getattr(...
import os from django.conf import settings SESSION_REDIS_HOST = getattr( settings, 'SESSION_REDIS_HOST', '127.0.0.1' ) SESSION_REDIS_PORT = getattr( settings, 'SESSION_REDIS_PORT', 6379 ) SESSION_REDIS_DB = getattr( settings, 'SESSION_REDIS_DB', 0 ) SESSION_REDIS_PREFIX = getattr(...
Reduce los sprites SVG a 32x32
var gulp = require('gulp'), gulpif = require('gulp-if'), imagemin = require('gulp-imagemin'), livereload = require('gulp-livereload'), newer = require('gulp-newer'), svgSprite = require('gulp-svg-sprite'), CONFIG = require('../config.js') gulp.task('svg-indiv...
var gulp = require('gulp'), gulpif = require('gulp-if'), imagemin = require('gulp-imagemin'), livereload = require('gulp-livereload'), newer = require('gulp-newer'), svgSprite = require('gulp-svg-sprite'), CONFIG = require('../config.js') gulp.task('svg-indiv...
Fix put to the torch and allow it to use saves
const DrawCard = require('../../../drawcard.js'); class PutToTheTorch extends DrawCard { canPlay(player, card) { if(player !== this.controller || this !== card) { return false; } var currentChallenge = this.game.currentChallenge; if(!currentChallenge || currentChalleng...
const DrawCard = require('../../../drawcard.js'); class PutToTheTorch extends DrawCard { canPlay(player, card) { if(player !== this.controller || this !== card) { return false; } var currentChallenge = this.game.currentChallenge; if(!currentChallenge || currentChalleng...
Add apikey to get_report api
from threading import Semaphore from os.path import basename from rate import ratelimiter import requests class VirusTotal(): def __init__(self, apikey, limit=4, every=60): self.semaphore = threading.Semaphore(limit) self.apikey = apikey self.every = every def scan(self, path): ...
from threading import Semaphore from os.path import basename from rate import ratelimiter import requests class VirusTotal(): def __init__(self, apikey, limit=4, every=60): self.semaphore = Semaphore(limit) self.apikey = apikey self.every = every def scan(self, path): with ra...
Implement versioned crawling and remapping.
package no.uio.ifi.trackfind.backend.services; import org.apache.commons.collections4.CollectionUtils; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.Ref; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereoty...
package no.uio.ifi.trackfind.backend.services; import org.apache.commons.collections4.CollectionUtils; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.Ref; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereoty...
Add additional logging to init game
/* global angular */ import {web3, Chess} from '../../contract/Chess.sol'; angular.module('dappChess').controller('InitializeGameCtrl', function ($rootScope, $scope, accounts) { $scope.availableAccounts = accounts.availableAccounts; $scope.selectedAccount = accounts.defaultAccount; $scope.startcolor = 'wh...
/* global angular */ import {web3, Chess} from '../../contract/Chess.sol'; angular.module('dappChess').controller('InitializeGameCtrl', function ($rootScope, $scope, accounts) { $scope.availableAccounts = accounts.availableAccounts; $scope.selectedAccount = accounts.defaultAccount; $scope.startcolor = 'wh...
Test self request without authentication
from uuid import uuid4 from changes.config import db from changes.models import Author from changes.testutils import APITestCase class AuthorBuildListTest(APITestCase): def test_simple(self): fake_author_id = uuid4() self.create_build(self.project) path = '/api/0/authors/{0}/builds/'.fo...
from uuid import uuid4 from changes.config import db from changes.models import Author from changes.testutils import APITestCase class AuthorBuildListTest(APITestCase): def test_simple(self): fake_author_id = uuid4() self.create_build(self.project) path = '/api/0/authors/{0}/builds/'.fo...
Improve floating button item label styles
'use strict' import React, { Component } from 'react' import ReactCSS from 'reactcss' import colors from '../../assets/styles/variables/colors' import { spacing, sizing } from '../../assets/styles/variables/utils' class FloatingButtonItemLabel extends Component { classes() { return { 'default': { ...
'use strict' import React, { Component } from 'react' import ReactCSS from 'reactcss' import colors from '../../assets/styles/variables/colors' import { spacing, sizing } from '../../assets/styles/variables/utils' class FloatingButtonItemLabel extends Component { classes() { return { 'default': { ...
Add from parameter in handleNewMessage
import React, { Component } from 'react'; import ChatMessages from './ChatMessages'; import ChatFooter from './ChatFooter'; import connector from '../connection/connector'; import * as config from '../connection/config'; class Chatbody extends Component { constructor(props) { super(props); this.sta...
import React, { Component } from 'react'; import ChatMessages from './ChatMessages'; import ChatFooter from './ChatFooter'; class Chatbody extends Component { constructor(props) { super(props); this.state = { partner: { gender: 'female', university: 'Univ...
Update para esconder o botão de cadastrar uma vez que o usuário fizer o logon.
<?php /* @var $this yii\web\View */ use yii\helpers\Html; $this->title = 'Trinket'; ?> <div class="site-index"> <div class="jumbotron"> <div id="logo"><?php echo "<img src=\"image/logo.jpg\">"; ?></div> <h1>Bem vindo a Trinket</h1> <p class="lead">Um site feito para trocas d...
<?php /* @var $this yii\web\View */ use yii\helpers\Html; $this->title = 'Trinket'; ?> <div class="site-index"> <div class="jumbotron"> <div id="logo"><?php echo "<img src=\"image/logo.jpg\">"; ?></div> <h1>Bem vindo a Trinket</h1> <p class="lead">Um site feito para trocas d...
Add an isActiveWhen on the dashbaord sidebar class
<?php namespace Modules\Dashboard\Sidebar; use Maatwebsite\Sidebar\Group; use Maatwebsite\Sidebar\Item; use Maatwebsite\Sidebar\Menu; use Modules\Core\Contracts\Authentication; class SidebarExtender implements \Maatwebsite\Sidebar\SidebarExtender { /** * @var Authentication */ protected $auth; ...
<?php namespace Modules\Dashboard\Sidebar; use Maatwebsite\Sidebar\Group; use Maatwebsite\Sidebar\Item; use Maatwebsite\Sidebar\Menu; use Modules\Core\Contracts\Authentication; class SidebarExtender implements \Maatwebsite\Sidebar\SidebarExtender { /** * @var Authentication */ protected $auth; ...
Fix argument in cron job
const CronJob = require('cron').CronJob; const Database = require('./database.js'); const database = Object.create(Database).init(); const MillisecondsInOneDay = 24*60*60*1000; const Days = 1; module.exports = function() { new CronJob('0 * * * *', function() { console.log('cleaning up old groups'); ...
const CronJob = require('cron').CronJob; const Database = require('./database.js'); const database = Object.create(Database).init(); const MillisecondsInOneDay = 24*60*60*1000; const Days = 1; module.exports = function() { new CronJob('0 * * * *', function() { console.log('cleaning up old groups'); ...
Fix python 3 compat. BREAKS python 2.x
import os import json from jsonschema import Draft4Validator def validate_mapping(mapping): """ Validate a mapping configuration file against the relevant schema. """ file_path = os.path.join(os.path.dirname(__file__), 'schemas', 'mapping.json') with open(file_path, 'r') as f...
import os import json from jsonschema import Draft4Validator def validate_mapping(mapping): """ Validate a mapping configuration file against the relevant schema. """ file_path = os.path.join(os.path.dirname(__file__), 'schemas', 'mapping.json') with open(file_path, 'rb') as ...
Make NamedStruct instance names less confusing Ideally we'd want to make the name the same as the instance name, but I'm not sure if it's possible without introducing an additional constructor argument.
import string import struct from collections import namedtuple class NamedStruct(struct.Struct): def __init__(self, fields, order='', size=0): self.values = namedtuple("NamedStruct", ' '.join(k for k, _ in fields)) format = order + ''.join([v for _, v in fields]) if size: form...
import string import struct from collections import namedtuple class NamedStruct(struct.Struct): def __init__(self, fields, order='', size=0): self.values = namedtuple("header", ' '.join(k for k, _ in fields)) format = order + ''.join([v for _, v in fields]) if size: format +=...
Use correct auth failure message Signed-off-by: snipe <e9c017fc53f27c86a4fb6d4f0de7d332b596a185@snipe.net>
<?php namespace App\Http\Livewire; use Livewire\Component; class LoginForm extends Component { public $username = ''; public $password = ''; public $can_submit = false; /** * Set the validation rules for login * * @author A. Ginaotto <snipe@snipe.net> * @version v6.0 * @ret...
<?php namespace App\Http\Livewire; use Livewire\Component; class LoginForm extends Component { public $username = ''; public $password = ''; public $can_submit = false; /** * Set the validation rules for login * * @author A. Ginaotto <snipe@snipe.net> * @version v6.0 * @ret...
Add the WordPress i18n as a filter to twig
<?php namespace jvwp; use FlorianWolters\Component\Util\Singleton\SingletonTrait; class Templates { use SingletonTrait; private $twigLoader; private $twigEnvironment; function __construct () { $this->twigLoader = new \Twig_Loader_Filesystem(array()); $this->twigEnvironment ...
<?php namespace jvwp; use FlorianWolters\Component\Util\Singleton\SingletonTrait; class Templates { use SingletonTrait; private $twigLoader; private $twigEnvironment; function __construct () { $this->twigLoader = new \Twig_Loader_Filesystem(array()); $this->twigEnvironment ...
Fix support in IE 11 Remove usage of => and `` comments that break backwards compatibility with IE
Selectize.define('tag_limit', function (options) { const self = this options.tagLimit = options.tagLimit this.onBlur = (function (e) { const original = self.onBlur return function (e) { original.apply(this, e); if (!e) return const $contro...
Selectize.define('tag_limit', function (options) { const self = this options.tagLimit = options.tagLimit this.onBlur = (function (e) { const original = self.onBlur return function (e) { original.apply(this, e); if (!e) return const $contro...
Add docblock to help IDE
<?php /************************************************************************************* * Copyright (C) 2014 by Alejandro Fiestas Olivares <afiestas@kde.org> * * * * This program is free software; you can redistribu...
<?php /************************************************************************************* * Copyright (C) 2014 by Alejandro Fiestas Olivares <afiestas@kde.org> * * * * This program is free software; you can redistribu...
Add sanity checks for temperature readings
# coding=utf-8 from utils import SensorConsumerBase import sys class Bathroom(SensorConsumerBase): def __init__(self): SensorConsumerBase.__init__(self, "home") def run(self): self.subscribe("bathroom-pubsub", self.pubsub_callback) def pubsub_callback(self, data): if "action" i...
# coding=utf-8 from utils import SensorConsumerBase import sys class Bathroom(SensorConsumerBase): def __init__(self): SensorConsumerBase.__init__(self, "home") def run(self): self.subscribe("bathroom-pubsub", self.pubsub_callback) def pubsub_callback(self, data): if "action" i...
Use the Titanic example data set
import unittest import json import great_expectations as ge from great_expectations import render class TestPageRenderers(unittest.TestCase): def test_import(self): from great_expectations import render def test_prescriptive_expectation_renderer(self): results = render.render( re...
import unittest import json import great_expectations as ge from great_expectations import render class TestPageRenderers(unittest.TestCase): def test_import(self): from great_expectations import render def test_prescriptive_expectation_renderer(self): results = render.render( re...
Disable the offline plugin for Gatsby
module.exports = { siteMetadata: { title: `Neon Tsunami`, author: `Dwight Watson`, description: `A blog on Laravel & Rails.`, siteUrl: `https://www.neontsunami.com`, social: { twitter: `DwightConrad`, }, }, plugins: [ `gatsby-plugin-postcss`, { resolve: `gatsby-plugin-p...
module.exports = { siteMetadata: { title: `Neon Tsunami`, author: `Dwight Watson`, description: `A blog on Laravel & Rails.`, siteUrl: `https://www.neontsunami.com`, social: { twitter: `DwightConrad`, }, }, plugins: [ `gatsby-plugin-postcss`, { resolve: `gatsby-plugin-p...
Move ngModal to body to allow to breakout relative positioning
angular.module('ngModal', []) /** * ng-modal Directive * * Loads the picker modal. * All modal content should be placed within this directive. E.g.; * <ng-modal>modal content</ng-modal> */ .directive('ngModal', ['$sce', function($sce) { function link(scope, element, attr...
angular.module('ngModal', []) /** * ng-modal Directive * * Loads the picker modal. * All modal content should be placed within this directive. E.g.; * <ng-modal>modal content</ng-modal> */ .directive('ngModal', ['$sce', function($sce) { function link(scope, element, attr...
Clean up transpose helper method
import string import math import itertools class CryptoSquare: @classmethod def encode(cls, msg): if len(cls.normalize(msg)) == 0: return '' return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg)))) @classmethod def squarify(cls, msg): return [msg[i:...
import string import math import itertools class CryptoSquare: @classmethod def encode(cls, msg): if len(cls.normalize(msg)) == 0: return '' return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg)))) @classmethod def squarify(cls, msg): return [msg[i:...
[Process] Add default xampp path to the list of possible paths to check
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Process; /** * An executable finder specifically des...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Process; /** * An executable finder specifically des...
Move '$theme' injection in partial method
<?php namespace Bloge\Renderers; use Bloge\NotFoundException; /** * Basic renderer * * This renderer renders raw PHP templates * * @package bloge */ class PHP implements IRenderer { /** * @var string $path */ protected $path; /** * @var array $data */ protected $data ...
<?php namespace Bloge\Renderers; use Bloge\NotFoundException; /** * Basic renderer * * This renderer renders raw PHP templates * * @package bloge */ class PHP implements IRenderer { /** * @var string $path */ protected $path; /** * @var array $data */ protected $data ...
Fix an import path to work for case sensitive OSes
define(['backbone', 'marionette', 'app/modules/Activity/d3/graph', 'text!templates/devTools/activity/graph.html' ], function(Backbone, Marionette, Graph, tpl) { var ActivityGraph = Backbone.Marionette.ItemView.extend({ template: tpl, tagName: "div", className: 'activity-graph', defaults: { ...
define(['backbone', 'marionette', 'app/modules/activity/d3/graph', 'text!templates/devTools/activity/graph.html' ], function(Backbone, Marionette, Graph, tpl) { var ActivityGraph = Backbone.Marionette.ItemView.extend({ template: tpl, tagName: "div", className: 'activity-graph', defaults: { ...
Allow to redefine scope via metadata
"use strict"; var marked = require('meta-marked'); var jsxTransform = require('react-tools').transform; var runtime = require.resolve('./runtime'); function compile(src, opts) { var compiled = marked(src); var meta = compiled.meta || {}; var component = meta.component ? 'require(' + JSON.stringi...
"use strict"; var marked = require('meta-marked'); var jsxTransform = require('react-tools').transform; var runtime = require.resolve('./runtime'); function compile(src, opts) { var compiled = marked(src); var meta = compiled.meta || {}; var component = meta.component ? 'require("' + meta.compon...
Fix encoding detection in python (shebang line was not parsed anymore)
""" Contains the python specific FileManager. """ import ast import re from pyqode.core.managers import FileManager class PyFileManager(FileManager): """ Extends file manager to override detect_encoding. With python, we can detect encoding by reading the two first lines of a file and extracting its en...
""" Contains the python specific FileManager. """ import ast import re from pyqode.core.managers import FileManager class PyFileManager(FileManager): """ Extends file manager to override detect_encoding. With python, we can detect encoding by reading the two first lines of a file and extracting its en...
Remove last called information from the profile page
<div class="pagehead"> <div class="{{ Auth::user()->getFluidLayout() }}"> <div class="row"> <div class="col-xs-12"> @include ('partials.notification') <div class="people-profile-information"> @if ($contact->has_avatar == 'true') <img src="{{ $contact->getAvatarURL(11...
<div class="pagehead"> <div class="{{ Auth::user()->getFluidLayout() }}"> <div class="row"> <div class="col-xs-12"> @include ('partials.notification') <div class="people-profile-information"> @if ($contact->has_avatar == 'true') <img src="{{ $contact->getAvatarURL(11...
Add server folder copy to build
const path = require('path'); const webpack = require('webpack'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const extractSass = new ExtractTextPlugin({ filename: '[name].css', // '[name].[contenthash].css' // disable: process.env....
const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const extractSass = new ExtractTextPlugin({ filename: '[name].css', // '[name].[contenthash].css' // disable: process.env.NODE_ENV === 'development' }); module.exports = { ent...
Remove default null property sets.
<?php namespace Adldap\Connections; class DetailedError { /** * The error code from ldap_errno. * * @var int|null */ protected $errorCode; /** * The error message from ldap_error. * * @var string|null */ protected $errorMessage; /** * The diagnostic m...
<?php namespace Adldap\Connections; class DetailedError { /** * The error code from ldap_errno. * * @var int */ protected $errorCode = null; /** * The error message from ldap_error. * * @var string */ protected $errorMessage = null; /** * The diagnost...
Build a common mixin method.
var path = require('path'); var fs = require('fs'); var _ = require('underscore'); var debug = require('debug')('carcass:Index'); var descriptor = Object.getOwnPropertyDescriptor; var properties = Object.getOwnPropertyNames; var defineProp = Object.defineProperty; module.exports = function(obj) { // Register eve...
var path = require('path'); var fs = require('fs'); var _ = require('underscore'); var debug = require('debug')('carcass:Index'); module.exports = function(obj) { // Register every file in a dir plus a namespace. obj.register = function(dir, namespace) { namespace || (namespace = 'plugins'); /...
Rename encode/decode parameterization in test
from collections import deque from hypothesis import given from hypothesis.strategies import (frozensets, integers, lists, one_of, sets, tuples) from tests.hypothesis2 import examples from tests.hypothesis2.strategies import deques, optionals from tests.test_entities import (DataCla...
from collections import deque from hypothesis import given from hypothesis.strategies import (frozensets, integers, lists, one_of, sets, tuples) from tests.hypothesis2 import examples from tests.hypothesis2.strategies import deques, optionals from tests.test_entities import (DataCla...
Split preparating of context into separate method when rendering pages
<?php declare(strict_types=1); namespace MattyG\BBStatic\Content\Page; use MattyG\BBStatic\BBCode\NeedsBBCodeRendererTrait; use MattyG\BBStatic\Util\Vendor\NeedsTemplateEngineTrait; use Symfony\Component\Filesystem\NeedsFilesystemTrait; class PageRenderer { use NeedsBBCodeRendererTrait; use NeedsFilesystemTr...
<?php declare(strict_types=1); namespace MattyG\BBStatic\Content\Page; use MattyG\BBStatic\BBCode\NeedsBBCodeRendererTrait; use MattyG\BBStatic\Util\Vendor\NeedsTemplateEngineTrait; use Symfony\Component\Filesystem\NeedsFilesystemTrait; final class PageRenderer { use NeedsBBCodeRendererTrait; use NeedsFilesy...
Clean up cookie lookup in TTRAuth
from requests.auth import AuthBase import requests import json from exceptions import raise_on_error class TTRAuth(AuthBase): def __init__(self, user, password): self.user = user self.password = password def response_hook(self, r, **kwargs): j = json.loads(r.content) if int(j[...
from requests.auth import AuthBase import requests import json from exceptions import raise_on_error class TTRAuth(AuthBase): def __init__(self, user, password): self.user = user self.password = password def response_hook(self, r, **kwargs): j = json.loads(r.content) if int(j[...
Fix call to HTTP404 now it is a function.
#! /usr/bin/env python """ Aragog Router Decorator ----------------------- Convert any function into a WSGI endpoint with a simple decorator. """ from aragog.wsgi import get_url from aragog.routing.client_error import HTTP404 class Router(object): """ Router holds the mapping of routes to callables. """...
#! /usr/bin/env python """ Aragog Router Decorator ----------------------- Convert any function into a WSGI endpoint with a simple decorator. """ from aragog.wsgi import get_url from aragog.routing.client_error import HTTP404 class Router(object): """ Router holds the mapping of routes to callables. """...
Fix char counter when init one more time
var locastyle = locastyle || {}; locastyle.charCounter = (function() { 'use strict'; function updateCounter(index, count) { $('.ls-number-counter-'+index).text(count); } function countText() { $('[data-ls-module="charCounter"]').each(function(index, field) { $('.ls-number-counter-' + index).par...
var locastyle = locastyle || {}; locastyle.charCounter = (function() { 'use strict'; function updateCounter(index, count) { $('.ls-number-counter-'+index).text(count); } function countText() { $('[data-ls-module="charCounter"]').each(function(index, field) { var limit = $(field).attr('maxlength...
Correct column name in migration
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class UpdateForumTableCategories extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('forum_categories', function (Blueprint $table) ...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class UpdateForumTableCategories extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('forum_categories', function (Blueprint $table) ...
Bump modular augur's TreeTime version requirement to match remote Now distinguished from the Python 2 version of TreeTime.
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywo...
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywo...
Optimize plugin loading, add error messages
import java.io.*; import java.net.*; import java.util.*; import java.net.ServerSocket; public class JMP { public static void main(String[] args) throws IOException { String mysqlHost = System.getProperty("mysqlHost"); int mysqlPort = Integer.parseInt(System.getProperty("mysqlPort")); int po...
import java.io.*; import java.net.*; import java.util.*; import java.net.ServerSocket; public class JMP { public static void main(String[] args) throws IOException { String mysqlHost = System.getProperty("mysqlHost"); int mysqlPort = Integer.parseInt(System.getProperty("mysqlPort")); int po...
Improve generate_tmp_file_path pytest command docs
import os def generate_tmp_file_path(tmpdir_factory, file_name_with_extension: str, tmp_dir_path: str = None) -> str: """ Generate file path relative to a temporary directory. :param tmpdir_factory: py.test's `tmpdir_factory` fixture. :param file_...
import os def generate_tmp_file_path(tmpdir_factory, file_name_with_extension: str, tmp_dir_path: str = None) -> str: """ Generate file path rooted in a temporary dir. :param tmpdir_factory: py.test's tmpdir_factory fixture. :param file_name_with_...
Refactor remote_repo, to return None if there is no remote.
from collections import namedtuple Remote = namedtuple('Remote', ('name', 'url')) CommitInfo = namedtuple("CommitInfo", ('commit', 'origin', 'remote_repo')) class PRInfo(object): def __init__(self, json): self.json = json @property def base_sha(self): return self.json['base']['sha'] ...
from collections import namedtuple Remote = namedtuple('Remote', ('name', 'url')) CommitInfo = namedtuple("CommitInfo", ('commit', 'origin', 'remote_repo')) class PRInfo(object): def __init__(self, json): self.json = json @property def base_sha(self): return self.json['base']['sha'] ...
Modify the tool-info module according to Philipp's reviews
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.result as result import benchexec.tools.template class Tool(benchexec.t...
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.result as result import benchexec.tools.template class Tool(benchexec.t...
Fix warning, add assignment operator
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), // the package file to use qunit: { // internal task or name of a plugin (like "qunit") all: ['js/tests/*.html'] }, watch: { files: [ 'js/tests/*.j...
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), // the package file to use qunit: { // internal task or name of a plugin (like "qunit") all: ['js/tests/*.html'] }, watch: { files: [ 'js/tests/*.j...
Add helper: get single post
<?php /** * @example * FastForward::Helpers() * ->renderImage(142, 'full'); */ class FastForward_Helpers { public function renderImage($id, $size = 'thumbnail') { echo wp_get_attachment_image($id, $size); } public function getImageAllSizes($id, $custom = array()) { $thumbnail = wp_...
<?php /** * @example * FastForward::Helpers() * ->renderImage(142, 'full'); */ class FastForward_Helpers { public function renderImage($id, $size = 'thumbnail') { echo wp_get_attachment_image($id, $size); } public function getImageAllSizes($id, $custom = array()) { $thumbnail = wp_...
Add message for empty slide history
import React from 'react'; import {connectToStores} from 'fluxible-addons-react'; import SlideHistoryStore from '../../../../stores/SlideHistoryStore'; import UserProfileStore from '../../../../stores/UserProfileStore'; import PermissionsStore from '../../../../stores/PermissionsStore'; import {Feed} from 'semantic-ui-...
import React from 'react'; import {connectToStores} from 'fluxible-addons-react'; import SlideHistoryStore from '../../../../stores/SlideHistoryStore'; import UserProfileStore from '../../../../stores/UserProfileStore'; import PermissionsStore from '../../../../stores/PermissionsStore'; import {Feed} from 'semantic-ui-...
Handle null being passed to getUserById
<?php namespace Hackzilla\Bundle\TicketBundle\Manager; use Doctrine\ORM\EntityRepository; use Hackzilla\Bundle\TicketBundle\Model\UserInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; class UserManager implements UserManagerInterface { private $tokenStorage; private $u...
<?php namespace Hackzilla\Bundle\TicketBundle\Manager; use Doctrine\ORM\EntityRepository; use Hackzilla\Bundle\TicketBundle\Model\UserInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; class UserManager implements UserManagerInterface { private $tokenStorage; private $u...
Fix style and missing semi-colon.
<?php // CONFIRMATION DIALOG ?> <div id="confirmDelete" title="Delete {{ $model }}" style="display: none;"> This action <em>cannot</em> be undone. Are you sure you want to delete this {{ $model }}? </div> <?php // SCRIPT ?> <script> $(function() { var form = $("deleteItem") var confirm = $( "#confir...
<?php // CONFIRMATION DIALOG ?> <div id="confirmDelete" title="Delete {{ $model }}" style="display: none;"> This action <em>cannot</em> be undone. Are you sure you want to delete this {{ $model }}? </div> <?php // SCRIPT ?> <script> $(function() { var form = $("deleteItem") var confirm = $( "#confir...
Add key type to refresh token model
<?php namespace Laravel\Passport; use Illuminate\Database\Eloquent\Model; class RefreshToken extends Model { /** * The database table used by the model. * * @var string */ protected $table = 'oauth_refresh_tokens'; /** * Indicates if the IDs are auto-incrementing. * * ...
<?php namespace Laravel\Passport; use Illuminate\Database\Eloquent\Model; class RefreshToken extends Model { /** * The database table used by the model. * * @var string */ protected $table = 'oauth_refresh_tokens'; /** * Indicates if the IDs are auto-incrementing. * * ...
Add 'attempts_left' to the http exception.
import json import requests SMS_AUTH_ENDPOINT = 'http://localhost:5000' class SMSAuthClient(object): def __init__(self, endpoint=SMS_AUTH_ENDPOINT): self.endpoint = endpoint def create_auth(self, auth_id, recipient): payload = {'auth_id': auth_id, 'recipient': recipient...
import json import requests SMS_AUTH_ENDPOINT = 'http://localhost:5000' class SMSAuthClient(object): def __init__(self, endpoint=SMS_AUTH_ENDPOINT): self.endpoint = endpoint def create_auth(self, auth_id, recipient): payload = {'auth_id': auth_id, 'recipient': recipient...
Remove constants and internal value of status types
<?php declare(strict_types=1); namespace CultuurNet\UDB3\Event\ValueObjects; use InvalidArgumentException; final class StatusType { private const AVAILABLE = 'Available'; private const TEMPORARILY_UNAVAILABLE = 'TemporarilyUnavailable'; private const UNAVAILABLE = 'Unavailable'; /** * @var str...
<?php declare(strict_types=1); namespace CultuurNet\UDB3\Event\ValueObjects; use InvalidArgumentException; final class StatusType { private const SCHEDULED = 'EventScheduled'; private const POSTPONED = 'EventPostponed'; private const CANCELLED = 'EventCancelled'; /** * @var string */ ...
Add 'visit' to tracker stub
(function (instanceName) { var i, s, z, w = window, d = document, q = 'script', f = ['config', 'track', 'identify', 'visit', 'push', 'call'], c = function () { var self = this; self._e = []; for (i = 0; i < f.length; i++) { ...
(function (instanceName) { var i, s, z, w = window, d = document, q = 'script', f = ['config', 'track', 'identify', 'push', 'call'], c = function () { var self = this; self._e = []; for (i = 0; i < f.length; i++) { ...
[Cache/CouchbaseCache] Return false instead of null for compat. This changeset fixes and verifies that instead of null, false is returned from the fetch method. This fixes a bug which causes CouchbaseCache not to work in combination with the ORM library. Test added.
<?php namespace Doctrine\Tests\Common\Cache; use Couchbase; use Doctrine\Common\Cache\CouchbaseCache; class CouchbaseCacheTest extends CacheTest { private $couchbase; public function setUp() { if (extension_loaded('couchbase')) { try { $this->couchbase = new Couchbase...
<?php namespace Doctrine\Tests\Common\Cache; use Couchbase; use Doctrine\Common\Cache\CouchbaseCache; class CouchbaseCacheTest extends CacheTest { private $couchbase; public function setUp() { if (extension_loaded('couchbase')) { try { $this->couchbase = new Couchbase...
Fix support for positional parameters in Doctrine ORM
<?php namespace RulerZ\Target\DoctrineORM; use Hoa\Ruler\Model as AST; use RulerZ\Compiler\Context; use RulerZ\Exception; use RulerZ\Model; use RulerZ\Target\GenericSqlVisitor; use RulerZ\Target\Operators\Definitions as OperatorsDefinitions; class DoctrineORMVisitor extends GenericSqlVisitor { /** * @var D...
<?php namespace RulerZ\Target\DoctrineORM; use Hoa\Ruler\Model as AST; use RulerZ\Compiler\Context; use RulerZ\Exception; use RulerZ\Model; use RulerZ\Target\GenericSqlVisitor; use RulerZ\Target\Operators\Definitions as OperatorsDefinitions; class DoctrineORMVisitor extends GenericSqlVisitor { /** * @var D...
Fix ArgumentParserTest.test_argv_from_args to be more portable. One of the tests was testing --jobs 4, but on a machine w/ 4 CPUs, that would get reduced to the default. This patch changes things to test --jobs 3, which is less likely to be seen in the wild.
# Copyright 2014 Dirk Pranke. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2014 Dirk Pranke. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Refactor promise helper function to include notify.
/*! resol-vbus | Copyright (c) 2013-2014, Daniel Wippermann | MIT license */ 'use strict'; var Q = require('q'); var utils = { /** * @see http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript */ generateGUID: function() { var s4 = function() { ret...
/*! resol-vbus | Copyright (c) 2013-2014, Daniel Wippermann | MIT license */ 'use strict'; var Q = require('q'); var utils = { /** * @see http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript */ generateGUID: function() { var s4 = function() { ret...
conan: Copy find modules to root of module path
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.2" class VeraPPTargetCmakeConan(ConanFile): name = "verapp-target-cmake" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspillaz/cm...
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.2" class VeraPPTargetCmakeConan(ConanFile): name = "verapp-target-cmake" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspillaz/cm...
Remove debug output in queue display function
ui = { } ui.player = { update: function(trackURI) { spotify.getTrackInfo(trackURI) .then(function(track) { document.getElementById('player-title').innerHTML = track.title document.getElementById('player-artist').innerHTML = track.artist ...
ui = { } ui.player = { update: function(trackURI) { spotify.getTrackInfo(trackURI) .then(function(track) { document.getElementById('player-title').innerHTML = track.title document.getElementById('player-artist').innerHTML = track.artist ...
[Fix]: Fix problem with fragment backstack Resolves: # See also: #
package com.kogimobile.android.baselibrary.navigation; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; public class FragmentNavigator { public static void navigateTo(FragmentManager manager, Fragment fragment, int container...
package com.kogimobile.android.baselibrary.navigation; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; public class FragmentNavigator { public static void navigateTo(FragmentManager manager, Fragment fragment, int containe...
Remove silly exception inserted for testing
from datetime import datetime from sqlalchemy import MetaData, Column, ForeignKey, Table from sqlalchemy import DateTime, Integer, Unicode, UnicodeText metadata = MetaData() old_revision_table = Table('revision', metadata, Column('id', Integer, primary_key=True), Column('create_time', DateTime, default=datet...
from datetime import datetime from sqlalchemy import MetaData, Column, ForeignKey, Table from sqlalchemy import DateTime, Integer, Unicode, UnicodeText metadata = MetaData() old_revision_table = Table('revision', metadata, Column('id', Integer, primary_key=True), Column('create_time', DateTime, default=datet...
Set static function to public
<?php namespace Caffeinated\Slugs\Traits; trait Sluggable { /** * The "booting" method of the model. * * @return void */ public static function boot() { parent::boot(); static::creating(function($model) { $slugName = static::getSlugName(); $slug...
<?php namespace Caffeinated\Slugs\Traits; trait Sluggable { /** * The "booting" method of the model. * * @return void */ protected static function boot() { parent::boot(); static::creating(function($model) { $slugName = static::getSlugName(); $s...
Add redirect to login endpoint if 401 received
function redirectLogin() { window.location.href = '/log_in'; } function likeComment(event, commentId) { console.log(forumId); console.log(commentId); $.ajax({ 'url': '/forums/' + forumId + '/comments/' + commentId + "/like", 'type': 'PUT', 'success': function(res) { ...
function likeComment(event, commentId) { console.log(forumId); console.log(commentId); $.ajax({ 'url': '/forums/' + forumId + '/comments/' + commentId + "/like", 'type': 'PUT', 'success': function(res) { console.log(res); $(event.target).children('p').text(res...
Fix array syntax for 5.3
<?php namespace TwigBridgeTests\View; use PHPUnit_Framework_TestCase; use Mockery as m; use Illuminate\View\Environment; use TwigBridge\View\View; use TwigBridge\Engines\TwigEngine; use TwigBridge\Twig\Loader\Filesystem; use Twig_Environment; class ViewTest extends PHPUnit_Framework_TestCase { public function te...
<?php namespace TwigBridgeTests\View; use PHPUnit_Framework_TestCase; use Mockery as m; use Illuminate\View\Environment; use TwigBridge\View\View; use TwigBridge\Engines\TwigEngine; use TwigBridge\Twig\Loader\Filesystem; use Twig_Environment; class ViewTest extends PHPUnit_Framework_TestCase { public function te...
Reduce number of ReflectionProperty::getName calls
<?php namespace BroadwaySerialization\Hydration; /** * Simple implementation of a hydrator, which uses reflection to iterate over the properties of an object */ class HydrateUsingReflection implements Hydrate { /** * @var array An array of arrays of \ReflectionProperty instances */ private $proper...
<?php namespace BroadwaySerialization\Hydration; /** * Simple implementation of a hydrator, which uses reflection to iterate over the properties of an object */ class HydrateUsingReflection implements Hydrate { /** * @var array An array of arrays of \ReflectionProperty instances */ private $proper...
Add a dummy server - Tests are broken
import unittest import mock from tikplay import server class DummyServer(): def __init__(self, *args, **kwargs): self._shutdown = False self._alive = False def serve_forever(self): self._alive = True while not self._shutdown: if self._shutdown: brea...
import unittest import mock from tikplay import server class ServerTestcase(unittest.TestCase): def setUp(self): self.handler_class = mock.MagicMock() self.server_class = mock.MagicMock() self.server_class.serve_forever = mock.MagicMock() self.__server = server.Server(host='127.0.0...
Fix for fixtures populator entity array
<?php namespace Kunstmaan\FixturesBundle\Populator; use Doctrine\Common\Collections\ArrayCollection; use Kunstmaan\FixturesBundle\Populator\Methods\MethodInterface; class Populator { /** * @var MethodInterface[] */ private $populators; public function __construct() { $this->popula...
<?php namespace Kunstmaan\FixturesBundle\Populator; use Doctrine\Common\Collections\ArrayCollection; use Kunstmaan\FixturesBundle\Populator\Methods\MethodInterface; class Populator { /** * @var MethodInterface[] */ private $populators; public function __construct() { $this->popula...
Fix organizer recap email title
<?php namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Queue\ShouldQueue; class OrganizerRecap extends Mailable { use Queueable, SerializesModels; public $participants; /** * Create a new message instanc...
<?php namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Queue\ShouldQueue; class OrganizerRecap extends Mailable { use Queueable, SerializesModels; public $participants; /** * Create a new message instanc...
Fix png for python 2/3 compatibility
from __future__ import absolute_import, print_function, division from builtins import open from future import standard_library standard_library.install_aliases() import six import json, numpy as np, os, io from .base import Property from . import exceptions class File(Property): mode = 'r' #: mode for opening th...
from __future__ import absolute_import, unicode_literals, print_function, division from builtins import open from future import standard_library standard_library.install_aliases() import six import json, numpy as np, os, io from .base import Property from . import exceptions class File(Property): mode = 'r' #: m...
Fix test 2_get_file to use try with resources
package getFile; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.FileNotFoundException; import java.io.FileReader; public class GetFileImpl { public static void writeInFile(String file, int i) { Stri...
package getFile; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.FileNotFoundException; import java.io.FileReader; public class GetFileImpl { public static void writeInFile(String file, int i) { try ...
Use `Windows.ApplicationModel.Package.current.id.name` instead of `.ProductId` as we get "permission denied" error when trying to retrieve productId Unable to find any documentation on required permissions...
"use strict" cordova.commandProxy.add("CsDeviceInfo", { getAppId: function (successCb, failCb) { setTimeout(function () { try { successCb(Windows.ApplicationModel.Package.current.id.name) } catch (e) { failCb(e) } }, 0) }, ...
"use strict" cordova.commandProxy.add("CsDeviceInfo", { getAppId: function (successCb, failCb) { setTimeout(function () { try { successCb(Windows.ApplicationModel.Package.current.id.ProductId) } catch (e) { failCb(e) } }, 0) ...