text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Allow user colour to be 'default' | /** @module */
import * as TextFormatting from '@/helpers/TextFormatting';
import { def } from './common';
export default class UserState {
constructor(user) {
this.nick = user.nick;
this.host = user.host || '';
this.username = user.username || '';
this.realname = user.realname || ... | /** @module */
import * as TextFormatting from '@/helpers/TextFormatting';
import { def } from './common';
export default class UserState {
constructor(user) {
this.nick = user.nick;
this.host = user.host || '';
this.username = user.username || '';
this.realname = user.realname || ... |
Add filter for limiting to one account | from tastypie import fields
from tastypie.resources import ModelResource, ALL
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import Authorization
from subscription.models import Subscription, MessageSet
from djcelery.models import PeriodicTask
class PeriodicTaskResource(ModelResou... | from tastypie import fields
from tastypie.resources import ModelResource, ALL
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import Authorization
from subscription.models import Subscription, MessageSet
from djcelery.models import PeriodicTask
class PeriodicTaskResource(ModelResou... |
Change info to warning if files not renamed | #!/usr/bin/python3
# tv_namer.py - Renames passed media files of TV shows
import shutil
import os
import sys
import logging
import videoLister
import scrapeTVDB
import regSplit
logger = logging.getLogger(__name__)
logging.basicConfig(filename='tv_namer.log',level=logging.DEBUG,
format='%(asctime)... | #!/usr/bin/python3
# tv_namer.py - Renames passed media files of TV shows
import shutil
import os
import sys
import logging
import videoLister
import scrapeTVDB
import regSplit
logger = logging.getLogger(__name__)
logging.basicConfig(filename='tv_namer.log',level=logging.DEBUG,
format='%(asctime)... |
Add fetch polyfill to entry file | import 'babel-polyfill'
import 'whatwg-fetch'
import React from 'react'
import ReactDOM from 'react-dom'
import createStore from './store/createStore'
import AppContainer from './containers/AppContainer'
// import fetchApiKeyifNeeded from './store/auth'
// ========================================================
// St... | import 'babel-polyfill'
import React from 'react'
import ReactDOM from 'react-dom'
import createStore from './store/createStore'
import AppContainer from './containers/AppContainer'
// import fetchApiKeyifNeeded from './store/auth'
// ========================================================
// Store Instantiation
// =... |
Add custom header for AJAX requests | import config from '../../config';
function formatUrl(path) {
const adjustedPath = path[0] !== '/' ? '/' + path : path;
const apiPath = `/api/${config.apiVersion}${adjustedPath}`;
return apiPath;
}
class ApiAjax {
constructor() {
['get', 'post', 'put', 'patch', 'del'].forEach((method) =>
this[metho... | import config from '../../config';
function formatUrl(path) {
const adjustedPath = path[0] !== '/' ? '/' + path : path;
const apiPath = `/api/${config.apiVersion}${adjustedPath}`;
return apiPath;
}
class ApiAjax {
constructor() {
['get', 'post', 'put', 'patch', 'del'].forEach((method) =>
this[metho... |
Make run_tests a function to make it fully backwards compatible | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels, extra_tests=None):
import pytest
import sys
... | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels):
import pytest
import sys
if test_labels is ... |
Remove bash lang def for prismjs | // Grunt configuration
module.exports = {
autoprefixer: {
browsers: ['> 1%', 'last 2 versions']
},
concat: {
src: [
'node_modules/svg4everybody/dist/svg4everybody.js',
'node_modules/jquery-collapse/src/jquery.collapse.js',
'node_m... | // Grunt configuration
module.exports = {
autoprefixer: {
browsers: ['> 1%', 'last 2 versions']
},
concat: {
src: [
'node_modules/svg4everybody/dist/svg4everybody.js',
'node_modules/jquery-collapse/src/jquery.collapse.js',
'node_m... |
Update form definition in tests to demonstrate functionality | define(function () {
return [
{
"default": {
name: "TestForm",
label: "TestForm",
_elements: [
{
"default": {
name: "Name",
type: "text",
label: "Name"
}
},
{
"default": {
... | define(function () {
return [
{
"default": {
name: "TestForm",
label: "TestForm",
_elements: [
{
"default": {
name: "Name",
type: "text",
label: "Name"
}
},
{
"default": {
... |
Update grid field count view able on each page for staff | <?php
/**
*
*
* @package silverstripe
* @subpackage sections
*/
class PeopleSection extends Section
{
private static $title = "List of people";
private static $description = "";
/**
* Database fields
* @var array
*/
private static $db = array(
'Title' => 'Varchar(40)',
... | <?php
/**
*
*
* @package silverstripe
* @subpackage sections
*/
class PeopleSection extends Section
{
private static $title = "List of people";
private static $description = "";
/**
* Database fields
* @var array
*/
private static $db = array(
'Title' => 'Varchar(40)',
... |
Remove unnecessary default parameter values | <?php
namespace Amp\Internal;
use Interop\Async\Loop;
/**
* Stores a set of functions to be invoked when an awaitable is resolved.
*
* @internal
*/
class WhenQueue {
/**
* @var callable[]
*/
private $queue = [];
/**
* @param callable|null $callback Initial callback to add to queue.
... | <?php
namespace Amp\Internal;
use Interop\Async\Loop;
/**
* Stores a set of functions to be invoked when an awaitable is resolved.
*
* @internal
*/
class WhenQueue {
/**
* @var callable[]
*/
private $queue = [];
/**
* @param callable|null $callback Initial callback to add to queue.
... |
Fix acceptance tests to match correct shape from API repsonse | "use strict"
const path = require('path')
const OperationHelper = require('../../').OperationHelper
require('dotenv').config({
silent: true,
path: path.join(__dirname, '.env')
})
const e = process.env
let config = {
AWS_ACCESS_KEY_ID: e.AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY: e.AWS_SECRET_ACCESS_... | "use strict"
const path = require('path')
const OperationHelper = require('../../').OperationHelper
require('dotenv').config({
silent: true,
path: path.join(__dirname, '.env')
})
const e = process.env
let config = {
AWS_ACCESS_KEY_ID: e.AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY: e.AWS_SECRET_ACCESS_... |
Use env var for API URL when adding bookmarks | ;(function(){
'use strict';
var modalCtrl = function($scope, $uibModalInstance, $http, messageParts){
$scope.modalTitle = messageParts.title;
$scope.modalHeading = messageParts.heading;
$scope.message = messageParts.message;
$scope.messageTemplate = messageParts.messageTemplate;
... | ;(function(){
'use strict';
var modalCtrl = function($scope, $uibModalInstance, $http, messageParts){
$scope.modalTitle = messageParts.title;
$scope.modalHeading = messageParts.heading;
$scope.message = messageParts.message;
$scope.messageTemplate = messageParts.messageTemplate;
... |
ZON-4070: Fix typo (belongs to commit:9ec5886) | from setuptools import setup, find_packages
setup(
name='zeit.brightcove',
version='2.10.2.dev0',
author='gocept, Zeit Online',
author_email='zon-backend@zeit.de',
url='http://www.zeit.de/',
description='Brightcove HTTP interface',
packages=find_packages('src'),
package_dir={'': 'src'},... | from setuptools import setup, find_packages
setup(
name='zeit.brightcove',
version='2.10.2.dev0',
author='gocept, Zeit Online',
author_email='zon-backend@zeit.de',
url='http://www.zeit.de/',
description='Brightcove HTTP interface',
packages=find_packages('src'),
package_dir={'': 'src'},... |
Add identifier to log entry | <?php namespace Nathanmac\InstantMessenger\Services;
use Nathanmac\InstantMessenger\Message;
use Psr\Log\LoggerInterface;
class LogService implements MessengerService {
/**
* The Logger instance.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;
/**
* Create a new log tran... | <?php namespace Nathanmac\InstantMessenger\Services;
use Nathanmac\InstantMessenger\Message;
use Psr\Log\LoggerInterface;
class LogService implements MessengerService {
/**
* The Logger instance.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;
/**
* Create a new log tran... |
Add a timestamp to each report | /*global Firebase, grecaptcha*/
;(function() {
var form = document.querySelector('.al-form > form');
var captchaIsValid = false;
window.initCaptcha = function() {
var captcha = document.querySelector('#captcha');
grecaptcha.render(captcha, {
sitekey: '6Ld9nwATAAAAACdsGH5foKWLUwuICMWrtevg1Gch',
... | /*global Firebase, grecaptcha*/
;(function() {
var form = document.querySelector('.al-form > form');
var captchaIsValid = false;
window.initCaptcha = function() {
var captcha = document.querySelector('#captcha');
grecaptcha.render(captcha, {
sitekey: '6Ld9nwATAAAAACdsGH5foKWLUwuICMWrtevg1Gch',
... |
Use data-active=true instead of data-start-active | (function(){
"use strict";
xtag.register("sam-tabbar", {
lifecycle: {
created: function() {
if (!this.role) {
this.role = "tablist";
}
},
inserted: function() {
this.activeTabId = this.querySelector("[role='tab'][data-active=true]").id;
},
remove... | (function(){
"use strict";
xtag.register("sam-tabbar", {
lifecycle: {
created: function() {
if (!this.role) {
this.role = "tablist";
}
},
inserted: function() {
this.activeTabId = this.querySelector("[role='tab'][data-start-active]").id;
},
remov... |
Make sure that output is text in Python 2 & 3. | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong... | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong... |
Remove the extra setNotModified function call.
Signed-off-by: Hunter Skrasek <6e2f9e6111e77edd0c446ea7a84e25323d137a61@perk.com> | <?php namespace Aranw\ETagsMiddleware;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
class ETags implements HttpKernelInterface {
/**
* The wrapped kernel implementation.
*
* @var \Symfony\Component\HttpKernel\HttpKernelInterf... | <?php namespace Aranw\ETagsMiddleware;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
class ETags implements HttpKernelInterface {
/**
* The wrapped kernel implementation.
*
* @var \Symfony\Component\HttpKernel\HttpKernelInterf... |
Use sqlite if no DEV_DATABASE specified in development env | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
if os.environ.get('DEV_DATABASE_URL'):
... | import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL')
class TestingConfig(Config):
... |
Set initial slug length to 3 | <?php
class Helpers
{
const SUPERUSER_ID = 1;
const PAGINATION_DEFAULT_ITEMS = 15;
const UPLOAD_SLUG_INITIAL_LENGTH = 3;
const NEW_USER_DAYS = 7; // How long is a user considered "new"
const API_KEY_LENGTH = 64;
const DB_CACHE_TIME = 5; // Minutes
// http://stackoverflow.com/questions/2510... | <?php
class Helpers
{
const SUPERUSER_ID = 1;
const PAGINATION_DEFAULT_ITEMS = 15;
const UPLOAD_SLUG_INITIAL_LENGTH = 4;
const NEW_USER_DAYS = 7; // How long is a user considered "new"
const API_KEY_LENGTH = 64;
const DB_CACHE_TIME = 5; // Minutes
// http://stackoverflow.com/questions/2510... |
Set a type for deleteSession() | <?php
interface OAuth2ServerDatabase
{
public function validateClient(
string $clientId,
string $clientSecret = null,
string $redirectUri = null
);
public function newSession(
string $clientId,
string $redirectUri,
$type = 'user',
string $typeId = nu... | <?php
interface OAuth2ServerDatabase
{
public function validateClient(
string $clientId,
string $clientSecret = null,
string $redirectUri = null
);
public function newSession(
string $clientId,
string $redirectUri,
$type = 'user',
string $typeId = nu... |
Return tree to prevent breaking builds | var JSCSFilter = require('broccoli-jscs');
var mergeTrees = require('broccoli-merge-trees');
var pickFiles = require('broccoli-static-compiler');
var checker = require('ember-cli-version-checker');
module.exports = {
name: 'broccoli-jscs',
shouldSetupRegistryInIncluded: function() {
return !checker.isAbove(t... | var JSCSFilter = require('broccoli-jscs');
var mergeTrees = require('broccoli-merge-trees');
var pickFiles = require('broccoli-static-compiler');
var checker = require('ember-cli-version-checker');
module.exports = {
name: 'broccoli-jscs',
shouldSetupRegistryInIncluded: function() {
return !checker.isAbove(t... |
Update the error messaging to be more useful and use the correct exit codes | <?php
require_once __DIR__ . '/../../abstract.php';
class Meanbee_Configpoweredcss_Regenerate extends Mage_Shell_Abstract
{
/**
* Run script
*
*/
public function run()
{
/**
* Shell script regenerate the configpowered css for all stores
*/
try {
... | <?php
require_once __DIR__ . '/../../abstract.php';
class Meanbee_Configpoweredcss_Regenerate extends Mage_Shell_Abstract
{
/**
* Run script
*
*/
public function run()
{
/**
* Shell script regenerate the configpowered css for all stores
*/
try {
... |
Print actual error, not [object Object] | const pageConfig = require('../config');
const fs = require('fs');
module.exports = {
// Switch to welder-web iframe if welder-web is integrated with Cockpit.
// Cockpit web service is listening on TCP port 9090.
gotoURL: (nightmare, page) => {
if (pageConfig.root.includes('9090')) {
nightmare
... | const pageConfig = require('../config');
const fs = require('fs');
module.exports = {
// Switch to welder-web iframe if welder-web is integrated with Cockpit.
// Cockpit web service is listening on TCP port 9090.
gotoURL: (nightmare, page) => {
if (pageConfig.root.includes('9090')) {
nightmare
... |
Create mapCategories on ndcs reducer | export const initialState = {
loading: false,
loaded: false,
error: false,
data: {}
};
const setLoading = (state, loading) => ({ ...state, loading });
const setError = (state, error) => ({ ...state, error });
const setLoaded = (state, loaded) => ({ ...state, loaded });
export default {
fetchNDCSInit: state ... | export const initialState = {
loading: false,
loaded: false,
error: false,
data: {}
};
const setLoading = (state, loading) => ({ ...state, loading });
const setError = (state, error) => ({ ...state, error });
const setLoaded = (state, loaded) => ({ ...state, loaded });
export default {
fetchNDCSInit: state ... |
Hide mobile (also hidden in styles.css) when css is not loaded | import config from "config";
import ReactDOMServer from "react-dom/server";
import serialize from "serialize-javascript";
import "cookie-parser";
import Helmet from "react-helmet";
export default function renderPage(element, fetcher, userAgent) {
const elementRendered = ReactDOMServer.renderToString(element);
cons... | import config from "config";
import ReactDOMServer from "react-dom/server";
import serialize from "serialize-javascript";
import "cookie-parser";
import Helmet from "react-helmet";
export default function renderPage(element, fetcher, userAgent) {
const elementRendered = ReactDOMServer.renderToString(element);
cons... |
Work around Node <v6 bug where shorthand props named `get` do not parse | import got from 'got'
import createDebug from 'debug'
const debug = createDebug('miniplug:http')
export default function httpPlugin (httpOpts) {
httpOpts = {
backoff: (fn) => fn,
...httpOpts
}
return (mp) => {
const request = httpOpts.backoff(
// wait until connections are complete before sen... | import got from 'got'
import createDebug from 'debug'
const debug = createDebug('miniplug:http')
export default function httpPlugin (httpOpts) {
httpOpts = {
backoff: (fn) => fn,
...httpOpts
}
return (mp) => {
const request = httpOpts.backoff(
// wait until connections are complete before sen... |
chore: Fix grunt-bump config to include the changelog. | module.exports = function (grunt) {
grunt.initConfig({
pkgFile: 'package.json',
simplemocha: {
options: {
ui: 'bdd',
reporter: 'dot'
},
unit: {
src: [
'test/mocha-globals.coffee',
'test/*.spec.coffee'
]
}
},
'npm-contributors'... | module.exports = function (grunt) {
grunt.initConfig({
pkgFile: 'package.json',
simplemocha: {
options: {
ui: 'bdd',
reporter: 'dot'
},
unit: {
src: [
'test/mocha-globals.coffee',
'test/*.spec.coffee'
]
}
},
'npm-contributors'... |
Update default formatting for bar chart module | define([
'extensions/controllers/module',
'common/views/visualisations/bar_chart_with_number',
'common/collections/bar_chart_with_number'
],
function (ModuleController, BarChartWithNumberView, BarChartWithNumberCollection) {
var BarChartWithNumberModule = ModuleController.extend({
visualisationClass: BarCha... | define([
'extensions/controllers/module',
'common/views/visualisations/bar_chart_with_number',
'common/collections/bar_chart_with_number'
],
function (ModuleController, BarChartWithNumberView, BarChartWithNumberCollection) {
var BarChartWithNumberModule = ModuleController.extend({
visualisationClass: BarCha... |
Update web client swagger test for swagger-ui 2.1.4 | function jasmineTests() {
var jasmineEnv = jasmine.getEnv();
var consoleReporter = new jasmine.ConsoleReporter();
window.jasmine_phantom_reporter = consoleReporter;
jasmineEnv.addReporter(consoleReporter);
function waitAndExecute() {
if (!jasmineEnv.currentRunner().suites_.length) {
... | function jasmineTests() {
var jasmineEnv = jasmine.getEnv();
var consoleReporter = new jasmine.ConsoleReporter();
window.jasmine_phantom_reporter = consoleReporter;
jasmineEnv.addReporter(consoleReporter);
function waitAndExecute() {
if (!jasmineEnv.currentRunner().suites_.length) {
... |
Fix scrollbar showing. Auto-calculate the pixels inside calc().
The scrollbar fix is actually just line 21 | import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import '../styles/video.css'
class Tutorial extends Component {
constructor (props) {
super(props)
this.state = {
topCoord: null
}
}
componentDidMount () {
const thisElement = ReactDOM.findDOMNode(this)
const top ... | import React from 'react'
import '../styles/video.css'
const Tutorial = props =>
<div className='container'>
<div className='row' style={{ marginBottom: 0 }}>
<div
className='col s12 valign-wrapper'
style={{ minHeight: 'calc(100vh - 64px)' }}
>
<div style={{ width: '100%' }}>
... |
Make ball light blink at 10Hz instead of 5Hz when a ball is at top | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.stuy.commands;
import edu.wpi.first.wpilibj.Timer;
/**
*
* @author admin
*/
public class BallLightUpdate extends CommandBase {
private int BLINK_FREQUENCY_HZ = 10;
private double lastTime = 0;
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.stuy.commands;
import edu.wpi.first.wpilibj.Timer;
/**
*
* @author admin
*/
public class BallLightUpdate extends CommandBase {
private int BLINK_FREQUENCY_HZ = 5;
private double lastTime = 0;
... |
Add a accesor for size | <?php
namespace Datenknoten\LigiBundle\Entity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @Gedmo\Uploadable(pathMethod="getDefaultPath", filenameGenerator="SHA1", allowOverwrite=true, appendNumber=true)
*/
class File
{
/**
* @ORM\Column(name="id", type="int... | <?php
namespace Datenknoten\LigiBundle\Entity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @Gedmo\Uploadable(pathMethod="getDefaultPath", filenameGenerator="SHA1", allowOverwrite=true, appendNumber=true)
*/
class File
{
/**
* @ORM\Column(name="id", type="int... |
Make result object local to function | var serviceName = "facebook";
var request = require("request");
var serviceConfig = require("./../config/services.config.json");
function facebook (cb) {
var result = {
service: serviceName,
status: false
};
request({
url: serviceConfig[serviceName],
... | var serviceName = "facebook";
var request = require("request");
var serviceConfig = require("./../config/services.config.json");
var result = {
service: serviceName,
status: false
}
function facebook (cb) {
request({
url: serviceConfig[serviceName],
method: "GET... |
Add an interface to update global context | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Template"""
import peanut
import jinja2
from os import path
from jinja2 import FileSystemLoader
from jinja2.exceptions import TemplateNotFound
class SmartLoader(FileSystemLoader):
"""A smart template loader"""
available_extension = ['.html', '.xml']
def... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Template"""
import peanut
import jinja2
from os import path
from jinja2 import FileSystemLoader
from jinja2.exceptions import TemplateNotFound
class SmartLoader(FileSystemLoader):
"""A smart template loader"""
available_extension = ['.html', '.xml']
def... |
Fix error PHP <= 5.6 | <?php
namespace PDOSimpleMigration\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class MigrationMigrateCommand extends AbstractCommand
{
protect... | <?php
namespace PDOSimpleMigration\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class MigrationMigrateCommand extends AbstractCommand
{
protect... |
Remove version limit on sphinx | import setuptools
import versioneer
if __name__ == "__main__":
setuptools.setup(
name='basis_set_exchange',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='The Quantum Chemistry Basis Set Exchange',
author='The Molecular Sciences Software I... | import setuptools
import versioneer
if __name__ == "__main__":
setuptools.setup(
name='basis_set_exchange',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='The Quantum Chemistry Basis Set Exchange',
author='The Molecular Sciences Software I... |
Fix roles relation of Permission | <?php namespace Klaravel\Ntrust\Traits;
use Illuminate\Cache\TaggableStore;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Cache;
trait NtrustPermissionTrait
{
/**
* Many-to-Many relations with role model.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
... | <?php namespace Klaravel\Ntrust\Traits;
use Illuminate\Cache\TaggableStore;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Cache;
trait NtrustPermissionTrait
{
/**
* Many-to-Many relations with role model.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
... |
Set the baseURL for development | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
baseURL: '/',
locationType: 'hash',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-contr... | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
baseURL: '/',
locationType: 'hash',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-contr... |
Fix translation_replace for translations dryrun | package com.crowdin.cli.commands.functionality;
import com.crowdin.cli.properties.PropertiesBean;
import com.crowdin.cli.utils.CommandUtils;
import com.crowdin.cli.utils.PlaceholderUtil;
import com.crowdin.cli.utils.Utils;
import org.apache.commons.lang3.StringUtils;
import java.util.Collections;
import java.util.Lis... | package com.crowdin.cli.commands.functionality;
import com.crowdin.cli.properties.PropertiesBean;
import com.crowdin.cli.utils.CommandUtils;
import com.crowdin.cli.utils.PlaceholderUtil;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.util.List;
import java.util.stream.Collectors;
publi... |
COM-212: Add a grid to popup
- added possibility to render number cell as an editable field | define([
'underscore',
'backgrid',
'orodatagrid/js/datagrid/formatter/number-formatter'
], function(_, Backgrid, NumberFormatter) {
'use strict';
var NumberCell;
/**
* Number column cell.
*
* @export oro/datagrid/cell/number-cell
* @class oro.datagrid.cell.NumberCell
... | define([
'underscore',
'backgrid',
'orodatagrid/js/datagrid/formatter/number-formatter'
], function(_, Backgrid, NumberFormatter) {
'use strict';
var NumberCell;
/**
* Number column cell.
*
* @export oro/datagrid/cell/number-cell
* @class oro.datagrid.cell.NumberCell
... |
Update the task according to Autoprefixer API changes | /*
* grunt-autoprefixer
*
*
* Copyright (c) 2013 Dmitry Nikitenko
* Licensed under the MIT license.
*/
'use strict';
module.exports = function (grunt) {
var autoprefixer = require('autoprefixer');
grunt.registerMultiTask('autoprefixer', 'Parse CSS and add prefixed properties and values by Can I Use d... | /*
* grunt-autoprefixer
*
*
* Copyright (c) 2013 Dmitry Nikitenko
* Licensed under the MIT license.
*/
'use strict';
module.exports = function (grunt) {
var autoprefixer = require('autoprefixer');
grunt.registerMultiTask('autoprefixer', 'Parse CSS and add prefixed properties and values by Can I Use d... |
Remove code which should never have made it in | """
This module implements python classes which inherit from
and extend the functionality of the ROOT canvas classes.
"""
import ROOT
from ..core import Object
from .. import rootpy_globals as _globals
from .. import defaults, QROOT
class _PadBase(Object):
def _post_init(self):
self.members = []
... | """
This module implements python classes which inherit from
and extend the functionality of the ROOT canvas classes.
"""
import ctypes, ctypes.util
ctypes.cdll.LoadLibrary(ctypes.util.find_library("Gui"))
import ROOT
from ..core import Object
from .. import rootpy_globals as _globals
from .. import defaults, QROOT
... |
Rename to something more sensible | <?php
namespace eien\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use NotificationChannels\Telegram\TelegramChannel;
use NotificationChannels\Telegram\TelegramMessage;
class sendT... | <?php
namespace eien\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use NotificationChannels\Telegram\TelegramChannel;
use NotificationChannels\Telegram\TelegramMessage;
class Teleg... |
Test getting comment for Mime type | from xdg import Mime
import unittest
import os.path
import tempfile, shutil
import resources
class MimeTest(unittest.TestCase):
def test_get_type_by_name(self):
appzip = Mime.get_type_by_name("foo.zip")
self.assertEqual(appzip.media, "application")
self.assertEqual(appzip.subtype, "zip")
... | from xdg import Mime
import unittest
import os.path
import tempfile, shutil
import resources
class MimeTest(unittest.TestCase):
def test_get_type_by_name(self):
appzip = Mime.get_type_by_name("foo.zip")
self.assertEqual(appzip.media, "application")
self.assertEqual(appzip.subtype, "zip")
... |
Fix compile error in android example app. | package com.seatgeek.sixpack.android;
import com.seatgeek.sixpack.Alternative;
import com.seatgeek.sixpack.Experiment;
import com.seatgeek.sixpack.Sixpack;
import com.seatgeek.sixpack.SixpackBuilder;
import com.seatgeek.sixpack.log.LogLevel;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Mod... | package com.seatgeek.sixpack.android;
import com.seatgeek.sixpack.Alternative;
import com.seatgeek.sixpack.Experiment;
import com.seatgeek.sixpack.Sixpack;
import com.seatgeek.sixpack.SixpackBuilder;
import com.seatgeek.sixpack.log.LogLevel;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Mod... |
Fix style issues with previous commit | <?php
namespace Illuminate\Database\Query\Processors;
use Illuminate\Database\Query\Builder;
class SqlServerProcessor extends Processor
{
/**
* Process an "insert get ID" query.
*
* @param \Illuminate\Database\Query\Builder $query
* @param string $sql
* @param array $values
*... | <?php
namespace Illuminate\Database\Query\Processors;
use Illuminate\Database\Query\Builder;
class SqlServerProcessor extends Processor
{
/**
* Process an "insert get ID" query.
*
* @param \Illuminate\Database\Query\Builder $query
* @param string $sql
* @param array $values
*... |
Update the port to be an integer.
Fix the port to be an integer. Use the format function for string formatting. | from flask import request, Flask
from st2reactor.sensor.base import Sensor
class EchoFlaskSensor(Sensor):
def __init__(self, sensor_service, config):
super(EchoFlaskSensor, self).__init__(
sensor_service=sensor_service,
config=config
)
self._host = '127.0.0.1'
... | from flask import request, Flask
from st2reactor.sensor.base import Sensor
class EchoFlaskSensor(Sensor):
def __init__(self, sensor_service, config):
super(EchoFlaskSensor, self).__init__(
sensor_service=sensor_service,
config=config
)
self._host = '127.0.0.1'
... |
Include bad actor list check in to column for transfering, include new warning for phishing accounts | export function validate_account_name(value) {
const badActorList = /(polonox|poloneix|blocktrads|blocktrade|bittrexx)/;
let i, label, len, length, ref, suffix;
suffix = 'Account name should ';
if (!value) {
return suffix + 'not be empty.';
}
length = value.length;
if (length < 3) {... |
export function validate_account_name(value) {
let i, label, len, length, ref, suffix;
suffix = 'Account name should ';
if (!value) {
return suffix + 'not be empty.';
}
length = value.length;
if (length < 3) {
return suffix + 'be longer.';
}
if (length > 16) {
r... |
Make the 0012 migration reversible | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils.version import LooseVersion
from django.db import models, migrations
def set_position_value_for_levin_classes(apps, schema_editor):
i = 0
LevinClass = apps.get_model('syntacticframes', 'LevinClass')
levin_class_list = sorted(L... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils.version import LooseVersion
from django.db import models, migrations
def set_position_value_for_levin_classes(apps, schema_editor):
i = 0
LevinClass = apps.get_model('syntacticframes', 'LevinClass')
levin_class_list = sorted(L... |
Change comment to reference backend as such. | <?php
namespace Orbt\ResourceManager;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Guzzle\Common\Collection;
use Guzzle\Http\Client;
/**
* A generic resource manager.
*
* A resource manager takes care of fetching resources and processing them by dispatching event using the Symfon... | <?php
namespace Orbt\ResourceManager;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Guzzle\Common\Collection;
use Guzzle\Http\Client;
/**
* A generic resource manager.
*
* A resource manager takes care of fetching resources and processing them by dispatching event using the Symfon... |
Change scan_type and artifacts fields to enums | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCtdailyqcTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ctdailyqc', f... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCtdailyqcTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ctdailyqc', f... |
Replace setenv with putenv. Reported by Dietmar Schwertberger. | """A more or less complete user-defined wrapper around dictionary objects."""
import riscos
class _Environ:
def __init__(self, initial = None):
pass
def __repr__(self):
return repr(riscos.getenvdict())
def __cmp__(self, dict):
if isinstance(dict, UserDict):
return cmp(r... | """A more or less complete user-defined wrapper around dictionary objects."""
import riscos
class _Environ:
def __init__(self, initial = None):
pass
def __repr__(self):
return repr(riscos.getenvdict())
def __cmp__(self, dict):
if isinstance(dict, UserDict):
return cmp(r... |
Fix printing template when value is an array. | <!DOCTYPE html>
<html lang="en">
<head>
<title>Print Table</title>
<meta charset="UTF-8">
<meta name=description content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/boots... | <!DOCTYPE html>
<html lang="en">
<head>
<title>Print Table</title>
<meta charset="UTF-8">
<meta name=description content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/boots... |
Correct bug on chapters when playing a chapter
The chapter wasn't playing due to the wrong reference of the exposed function setTime. | (function(app){
"use strict"
/**
* Creates a new HTML element ov-index to create an openVeo player
* index, with a list of presentation slides.
* It requires ovPlayerDirectory global variable to be defined and have
* a value corresponding to the path of the openVeo Player
* root directory.
*
... | (function(app){
"use strict"
/**
* Creates a new HTML element ov-index to create an openVeo player
* index, with a list of presentation slides.
* It requires ovPlayerDirectory global variable to be defined and have
* a value corresponding to the path of the openVeo Player
* root directory.
*
... |
Use proprer name to create the mixin | const createPolobxMixin = function(stores) {
let appState = {};
Object.keys(stores).forEach( key => {
const store = mobx.observable(stores[key].store);
const actions = stores[key].actions;
appState[key] = {
store,
actions
};
});
function dispatch({store, action, payload}) {
if... | const MobxMixin = function(stores) {
let appState = {};
Object.keys(stores).forEach( key => {
const store = mobx.observable(stores[key].store);
const actions = stores[key].actions;
appState[key] = {
store,
actions
};
});
function dispatch({store, action, payload}) {
if (appSta... |
Make images clickable on members search | import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
class MembersPreview extends Component {
render() {
const {displayName, searchImg, intro, slug} = this.props;
return (
<div className="col-xs-12 col-sm-4 col-md-3">
<div className="thumbnail" style={{
... | import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
class MembersPreview extends Component {
render() {
const {displayName, searchImg, intro, slug} = this.props;
return (
<div className="col-xs-12 col-sm-4 col-md-3">
<div className="thumbnail" style={{
... |
Make RECENT mode title consistent. | import {ChangeEmitter} from "../utils/ChangeEmitter.js";
import AppDispatcher from "../dispatcher/AppDispatcher.js";
import ContainerConstants from "../constants/ContainerConstants.js";
import SearchConstants from "../constants/SearchConstants.js";
var _defaultMode = ContainerConstants.ALL;
function setMode(m) {
... | import {ChangeEmitter} from "../utils/ChangeEmitter.js";
import AppDispatcher from "../dispatcher/AppDispatcher.js";
import ContainerConstants from "../constants/ContainerConstants.js";
import SearchConstants from "../constants/SearchConstants.js";
var _defaultMode = ContainerConstants.ALL;
function setMode(m) {
... |
Make an example package private | /*
* JBoss, Home of Professional Open Source
* Copyright Red Hat, Inc., and individual contributors
*
* 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/... | /*
* JBoss, Home of Professional Open Source
* Copyright Red Hat, Inc., and individual contributors
*
* 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/... |
Set webpack public path so file URLs become absolute | import path from 'path'
import webpack from 'webpack'
import StaticSiteGeneratorPlugin from 'static-site-generator-webpack-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
const config = {
entry: './index.js',
output: {
filename: 'main.[hash].js',
path: path.join(__dirname, 'build'),
... | import path from 'path'
import webpack from 'webpack'
import StaticSiteGeneratorPlugin from 'static-site-generator-webpack-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
const config = {
entry: './index.js',
output: {
filename: 'main.[hash].js',
path: path.join(__dirname, 'build'),
... |
Fix getToken rename issue in 5.4 | <?php
namespace Collective\Html;
use Illuminate\Support\ServiceProvider;
class HtmlServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Register the service provider.
*
* @ret... | <?php
namespace Collective\Html;
use Illuminate\Support\ServiceProvider;
class HtmlServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Register the service provider.
*
* @ret... |
Change title of history page depend on the current page | <div class="panel <?php echo (isset($single)?'single':''); ?>">
<div class="warp">
<?php if (isset($single)): ?>
<b>Last Read</b>
<?php else: ?>
<b>My Reading History</b>
<?php endif; ?>
</div>
<div class="<?php echo (isset($single)?'':'warp'); ?>">
<?php ... | <div class="panel <?php echo (isset($single)?'single':''); ?>">
<div class="warp">
<b>My Reading History</b>
</div>
<div class="<?php echo (isset($single)?'':'warp'); ?>">
<?php while ($row = $history->row()): ?>
<div <?php echo (isset($single)?'class="list"':''); ?>>
<a href... |
Edit dedupe campus slugs code | from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **options):
dup... | from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **options):
dup... |
Remove the hard coded process name now that the process name has been set. | (function (module) {
module.controller('ProjectHomeController', ProjectHomeController);
ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state", "Restangular"];
function ProjectHomeController(project, mcmodal, templates, $state, Restangular) {
var ctrl = this;
ctrl.pro... | (function (module) {
module.controller('ProjectHomeController', ProjectHomeController);
ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state", "Restangular"];
function ProjectHomeController(project, mcmodal, templates, $state, Restangular) {
var ctrl = this;
ctrl.pro... |
Use simple cache for known transactions | package io.debezium.examples.cacheinvalidation.persistence;
import java.util.concurrent.TimeUnit;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import org.infinispan.Cache;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.manager.DefaultCa... | package io.debezium.examples.cacheinvalidation.persistence;
import java.util.concurrent.TimeUnit;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import org.infinispan.Cache;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.manager.DefaultCa... |
Store reference to player, dim lights | elation.require(['engine.engine', 'engine.things.player', 'engine.things.light', 'janusweb.janusweb'], function() {
elation.component.add('janusweb.client', function() {
this.initEngine = function() {
//this.enginecfg.systems.push('admin');
}
this.initWorld = function() {
var things = this.wor... | elation.require(['engine.engine', 'engine.things.light', 'janusweb.janusweb'], function() {
elation.component.add('janusweb.client', function() {
this.initEngine = function() {
//this.enginecfg.systems.push('admin');
}
this.initWorld = function() {
var things = this.world.load({
name: ... |
CRM-4194: Fix "You have a new email" message
fixed compositions concept | require([
'oroui/js/app/controllers/base/controller'
], function(BaseController) {
'use strict';
BaseController.loadBeforeAction([
'jquery',
'oroemail/js/app/components/email-notification-component',
'oroemail/js/app/models/email-notification/email-notification-count-model'
], f... | require([
'oroui/js/app/controllers/base/controller'
], function(BaseController) {
'use strict';
BaseController.loadBeforeAction([
'jquery',
'oroemail/js/app/components/email-notification-component',
'oroemail/js/app/components/new-email-message-component',
'oroemail/js/app/... |
Remove duplicated record plain get | const jwt = require('jsonwebtoken')
const config = require('config')
const bcrypt = require('bcrypt')
const _ = require('lodash')
const User = require('./../models/user')
const Messages = require('./../messages')
const Authenticate = (user) => {
return new Promise((resolve, reject) => {
User.... | const jwt = require('jsonwebtoken')
const config = require('config')
const bcrypt = require('bcrypt')
const _ = require('lodash')
const User = require('./../models/user')
const Messages = require('./../messages')
const Authenticate = (user) => {
return new Promise((resolve, reject) => {
User.... |
:fire: Remove function wrapping around js includes | 'use strict'
const FS = require('fs')
const Path = require('path')
const Base = require('./base')
class GenericPlugin extends Base {
constructor() {
super()
this.registerTag(['Compiler-Include'], function(name, value, options) {
value = Path.resolve(options.internal.file.directory, value)
option... | 'use strict'
const FS = require('fs')
const Path = require('path')
const Base = require('./base')
class GenericPlugin extends Base {
constructor() {
super()
this.registerTag(['Compiler-Include'], function(name, value, options) {
value = Path.resolve(options.internal.file.directory, value)
option... |
Set the computed value on the View-Model itself, the way Vue does it | const prefix = '_async_computed$'
export default {
install (Vue, options) {
options = options || {}
Vue.config
.optionMergeStrategies
.asyncComputed = Vue.config.optionMergeStrategies.computed
Vue.mixin({
created () {
Object.keys(this.$options.asyncComputed || {}).forEach(key ... | const prefix = '_async_computed$'
export default {
install (Vue, options) {
options = options || {}
Vue.config
.optionMergeStrategies
.asyncComputed = Vue.config.optionMergeStrategies.computed
Vue.mixin({
created () {
Object.keys(this.$options.asyncComputed || {}).forEach(key ... |
Remove the security bypass hack. It's not needed anymore. | // Security.java
package ed.security;
import ed.js.engine.*;
public class Security {
public final static boolean OFF = Boolean.getBoolean( "NO-SECURITY" );
final static String SECURE[] = new String[]{
Convert.DEFAULT_PACKAGE + "._data_corejs_" ,
Convert.DEFAULT_PACKAGE + "._data_sites_adm... | // Security.java
package ed.security;
import ed.js.engine.*;
public class Security {
public final static boolean OFF = Boolean.getBoolean( "NO-SECURITY" );
final static boolean TEST_BYPASS = Boolean.getBoolean("ed.js.engine.SECURITY_BYPASS");
final static String SECURE[] = new String[]{
Conver... |
Fix phones in update profile form | <?php
namespace Furniture\FrontendBundle\Form\Type\UserProfile;
use Furniture\CommonBundle\Form\DataTransformer\ArrayToStringTransformer;
use Furniture\RetailerBundle\Entity\RetailerUserProfile;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsReso... | <?php
namespace Furniture\FrontendBundle\Form\Type\UserProfile;
use Furniture\RetailerBundle\Entity\RetailerUserProfile;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class RetailerUserProfileType extends AbstractType
... |
Fix issue with Query.parse_chain being broken in InsertRelationCommand | class Query:
def __init__(self, ident, name, oper, value):
self.ident = ident
self.name = name
self.oper = oper
self.value = value
def test(self, prop_dict):
if self.ident is not None:
key = "%s.%s" % (self.ident, self.name)
else:
key = se... | class Query:
def __init__(self, ident, name, oper, value):
self.ident = ident
self.name = name
self.oper = oper
self.value = value
def test(self, prop_dict):
if self.ident is not None:
key = "%s.%s" % (self.ident, self.name)
else:
key = se... |
Send request_count and error_count outside sensor_data | import json
import requests
import time
from collections import Counter
from multiprocessing import Process, Queue
from queue import Empty
shared_queue = None
def datetime_by_minute(dt):
return dt.replace(second=0, microsecond=0).isoformat() + 'Z'
def process_jobs(url, app_id, queue):
while True:
... | import json
import requests
import time
from collections import Counter
from multiprocessing import Process, Queue
from queue import Empty
shared_queue = None
def datetime_by_minute(dt):
return dt.replace(second=0, microsecond=0).isoformat() + 'Z'
def process_jobs(url, app_id, queue):
while True:
... |
Create with reusable builder functions.
Use `new Function`, but use it to build a builder you can reuse instead
of building a function each time. Got this from Cadence fiddling.
% node benchmark/increment/create.js
_adhere create 1 x 467,669 ops/sec ±0.66% (97 runs sampled)
adhere create 1 x 5,753,834 ops/sec ±1.31... | var builders = []
module.exports = function (method, additional, f) {
if (arguments.length == 2) {
f = additional
additional = 0
}
// Preserving arity costs next to nothing; the call to `execute` in
// these functions will be inlined. The airty function itself will never
// be inlin... | module.exports = function (method, additional, f) {
if (arguments.length == 2) {
f = additional
additional = 0
}
// Preserving arity costs next to nothing; the call to `execute` in
// these functions will be inlined. The airty function itself will never
// be inlined because it is in... |
Use open and close function | angular.module('mwUI.UiComponents')
//TODO rename to mwCollapsible
.directive('mwCollapsable', function () {
return {
transclude: true,
scope: {
mwCollapsable: '=',
title: '@mwTitle'
},
templateUrl: 'uikit/mw-ui-components/directives/templates/mw_collapsible.html',
l... | angular.module('mwUI.UiComponents')
//TODO rename to mwCollapsible
.directive('mwCollapsable', function () {
return {
transclude: true,
scope: {
mwCollapsable: '=',
title: '@mwTitle'
},
templateUrl: 'uikit/mw-ui-components/directives/templates/mw_collapsible.html',
l... |
Read and write as binary. | <?php
namespace Orbt\ResourceMirror\Resource;
use Orbt\ResourceMirror\Exception\ReplicatorException;
/**
* Basic replicator implementation using file operations to replicate.
*/
class FileReplicator implements Replicator
{
/**
* Base URL.
* @var string
*/
protected $baseUrl;
/**
* T... | <?php
namespace Orbt\ResourceMirror\Resource;
use Orbt\ResourceMirror\Exception\ReplicatorException;
/**
* Basic replicator implementation using file operations to replicate.
*/
class FileReplicator implements Replicator
{
/**
* Base URL.
* @var string
*/
protected $baseUrl;
/**
* T... |
Replace %(module)s with %(pathname)s in DEFAULT_KVP_FORMAT
The pathname gives more context in large projects that contains repeated module
names (eg models, base, etc). |
DEFAULT_LOGGING_CONF = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'default': {'format': '%(asctime)s %(module)s %(message)s'},
},
'filters': {
'logger_filter': {
'()': 'belogging.filters.LoggerFilter',
},
},
'handlers': {
'... |
DEFAULT_LOGGING_CONF = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'default': {'format': '%(asctime)s %(module)s %(message)s'},
},
'filters': {
'logger_filter': {
'()': 'belogging.filters.LoggerFilter',
},
},
'handlers': {
'... |
Add negative delta to avoid stopping the processor immediately | package org.yamcs.studio.ui.archive;
import java.util.List;
import javax.swing.SwingUtilities;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkben... | package org.yamcs.studio.ui.archive;
import java.util.List;
import javax.swing.SwingUtilities;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkben... |
Add opt in/out keywords for tropo | from urllib import urlencode
from urllib2 import urlopen
from corehq.apps.sms.util import clean_phone_number
from corehq.apps.sms.models import SQLSMSBackend
from dimagi.ext.couchdbkit import *
from corehq.messaging.smsbackends.tropo.forms import TropoBackendForm
from django.conf import settings
class SQLTropoBackend... | from urllib import urlencode
from urllib2 import urlopen
from corehq.apps.sms.util import clean_phone_number
from corehq.apps.sms.models import SQLSMSBackend
from dimagi.ext.couchdbkit import *
from corehq.messaging.smsbackends.tropo.forms import TropoBackendForm
from django.conf import settings
class SQLTropoBackend... |
[BUGFIX] Check for existance of $releasesList[0] before using | <?php
namespace Deployer;
task('buffer:stop', function () {
$releasesList = get('releases_list');
// Remove lock files also from previous release because it can be still read by apache/nginx after switching.
// get('releases_list') is cached by deployer on first call in other task so it does not have the ... | <?php
namespace Deployer;
task('buffer:stop', function () {
$releasesList = get('releases_list');
// Remove lock files also from previous release because it can be still read by apache/nginx after switching.
// get('releases_list') is cached by deployer on first call in other task so it does not have the ... |
Set completions meta-text styling to match | from pygments.token import Token
from pygments.style import Style
from pygments.util import ClassNotFound
from prompt_toolkit.styles import default_style_extensions
import pygments.styles
def style_factory(name):
try:
style = pygments.styles.get_style_by_name(name)
except ClassNotFound:
style ... | from pygments.token import Token
from pygments.style import Style
from pygments.util import ClassNotFound
from prompt_toolkit.styles import default_style_extensions
import pygments.styles
def style_factory(name):
try:
style = pygments.styles.get_style_by_name(name)
except ClassNotFound:
style ... |
Update SystemMessage, replace existing message with new payload | // Copyright 2016 David Lavieri. All rights reserved.
// Use of this source code is governed by a MIT License
// License that can be found in the LICENSE file.
import * as types from './../constants/system_message';
const initialState = [];
export {initialState};
export default (state = initialState, action) => {
... | // Copyright 2016 David Lavieri. All rights reserved.
// Use of this source code is governed by a MIT License
// License that can be found in the LICENSE file.
import * as types from './../constants/system_message';
const initialState = [];
export {initialState};
export default (state = initialState, action) => {
... |
Use the webserver module, which means the script is now cross-platform. Hooray, Python\! | #!/usr/bin/env python
import re
import webbrowser
import urlparse
import platform
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class OpenRemoteHandler(BaseHTTPRequestHandler):
def do_GET(self):
url = ''
try:
request_url = urlparse.urlsplit(self.path)
if re.... | #!/usr/bin/env python
import sys
import re
import subprocess
import urlparse
import platform
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class OpenRemoteHandler(BaseHTTPRequestHandler):
def do_GET(self):
url = ''
try:
request_url = urlparse.urlsplit(self.path)
... |
Remove Emulation logs directory one time at the beggining of the test suite | <?php
namespace Ivory\GoogleMapBundle\Tests\Emulation;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\HttpKernel\Util\Filesystem;
/**
* Web test case
*
* @author GeLo <geloen.eric@gmail.com>
*/
class WebTestCase extends BaseWebTestCase
{
/**
* @var boolean ... | <?php
namespace Ivory\GoogleMapBundle\Tests\Emulation;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\HttpKernel\Util\Filesystem;
/**
* Web test case
*
* @author GeLo <geloen.eric@gmail.com>
*/
class WebTestCase extends BaseWebTestCase
{
/**
* @var boolean ... |
Revert omission of image size
Turns out this is still required in SVG mode :D | <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Emoji\Listener;
use Flarum\Event\ConfigureFormatter;
use Illuminate\Contracts\E... | <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Emoji\Listener;
use Flarum\Event\ConfigureFormatter;
use Illuminate\Contracts\E... |
Exit if no accounts need to be repaired | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Entities\Accounts\Models\Account;
use App\Entities\Groups\Models\Group;
use Illuminate\Support\Facades\DB;
final class RepairMissingGroupsCOmmand extends Command
{
/**
* The name and signature of the console command.
*
*... | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Entities\Accounts\Models\Account;
use App\Entities\Groups\Models\Group;
use Illuminate\Support\Facades\DB;
final class RepairMissingGroupsCOmmand extends Command
{
/**
* The name and signature of the console command.
*
*... |
Set the default bouncetime value to -666
Set the default bouncetime to -666 (the default value -666 is in Rpi.GPIO source code).
As-Is: if the bouncetime is not set, your setting for event detecting is silently down. And there is no notification that bouncetime is required. | from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FALLING,
... | from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FALLING,
... |
Attach the current timestamp to each RTI model | define(['MoxieModel', 'underscore', 'moxie.conf'], function(MoxieModel, _, conf) {
var testDelayed = function(estTime) {
return !((estTime.indexOf('On time') === 0) || (estTime.indexOf('Starts here') === 0));
};
var RTIModel = MoxieModel.extend({
url: function() {
return conf.end... | define(['MoxieModel', 'underscore', 'moxie.conf'], function(MoxieModel, _, conf) {
var testDelayed = function(estTime) {
return !((estTime.indexOf('On time') === 0) || (estTime.indexOf('Starts here') === 0));
};
var RTIModel = MoxieModel.extend({
url: function() {
return conf.end... |
Fix test.We have new default handler, so handlers list size must updated.
git-svn-id: 9326b53cbc4a8f4c3d02979b62b178127d5150fe@1808 c7d0bf07-ec0d-0410-b2cc-d48fa9be22ba | package org.codehaus.xfire.transport.http;
import org.codehaus.xfire.addressing.AddressingInHandler;
import org.codehaus.xfire.addressing.AddressingOutHandler;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.ServiceRegistry;
import org.codehaus.xfire.test.AbstractServletTest;
import com.m... | package org.codehaus.xfire.transport.http;
import org.codehaus.xfire.addressing.AddressingInHandler;
import org.codehaus.xfire.addressing.AddressingOutHandler;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.ServiceRegistry;
import org.codehaus.xfire.test.AbstractServletTest;
import com.m... |
Fix link to medias in UserCard | import React from 'react'
import style from './style.styl'
import avatarUrl from '../../utils/avatarUrl.js'
import Link from 'react-router/Link'
const UserCard = ({id, name, gender, mediaCount, likeCount, dislikeCount}) => (
<div className={style.card}>
<img src={avatarUrl(id)} />
<div className={style.con... | import React from 'react'
import style from './style.styl'
import avatarUrl from '../../utils/avatarUrl.js'
import Link from 'react-router/Link'
const UserCard = ({id, name, gender, mediaCount, likeCount, dislikeCount}) => (
<div className={style.card}>
<img src={avatarUrl(id)} />
<div className={style.con... |
Remove extra parenthesis on subscribe page | @extends('layout.master')
@section('title', trans('cachet.subscriber.subscribe'). " | ". $siteTitle)
@section('description', trans('cachet.meta.description.subscribe', ['app' => $siteTitle]))
@section('content')
<div class="pull-right">
<p><a class="btn btn-success btn-outline" href="{{ cachet_route('status-pag... | @extends('layout.master')
@section('title', trans('cachet.subscriber.subscribe'). " | ". $siteTitle))
@section('description', trans('cachet.meta.description.subscribe', ['app' => $siteTitle]))
@section('content')
<div class="pull-right">
<p><a class="btn btn-success btn-outline" href="{{ cachet_route('status-pa... |
Stop the madness and put things back | (function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
// Check for the various File API support.
if (window.... | (function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
// Check for the various File API support.
if (window.... |
Refactor PostgresContainer to use JDBC for database and role creation | package io.ebean.docker.commands;
import java.sql.Connection;
import java.sql.SQLException;
public abstract class JdbcBaseDbContainer extends DbContainer {
JdbcBaseDbContainer(DbConfig config) {
super(config);
this.checkConnectivityUsingAdmin = true;
}
abstract void createDatabase();
abstract void ... | package io.ebean.docker.commands;
import java.sql.Connection;
import java.sql.SQLException;
public abstract class JdbcBaseDbContainer extends DbContainer {
JdbcBaseDbContainer(DbConfig config) {
super(config);
this.checkConnectivityUsingAdmin = true;
}
abstract void createDatabase();
abstract void ... |
Include doubles.targets in packages list. | from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
import doubles
with open('README.md') as f:
long_description = f.read()
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.... | from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
import doubles
with open('README.md') as f:
long_description = f.read()
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.... |
Allow Renderable name to be included in initialization data | "use strict";
const merge = require('../../../util/merge');
const {coroutine: co} = require('bluebird');
class Renderable {
constructor(data) {
this.parent = undefined;
this.data = data || {};
this.id = this.constructor.id;
this.name = (data && data.name) ? data.name : this.constructor.name;
thi... | "use strict";
const merge = require('../../../util/merge');
const {coroutine: co} = require('bluebird');
class Renderable {
constructor(data) {
this.parent = undefined;
this.data = data || {};
this.id = this.constructor.id;
this.name = this.constructor.name;
this.templateFile = this.constructor.... |
Add resolve target entity to listener instead of configuration in the add resolve target entities compiler pass. | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2017, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\AdminBundle\Depen... | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2017, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\AdminBundle\Depen... |
Replace deprecated ConfigureClientView with ConfigureWebApp again | <?php
namespace Flagrow\Analytics\Listeners;
use DirectoryIterator;
use Flarum\Event\ConfigureWebApp;
use Illuminate\Contracts\Events\Dispatcher;
use Flarum\Event\ConfigureLocales;
class AddClientAssets
{
public function subscribe(Dispatcher $events)
{
$events->listen(ConfigureWebApp::class, [$this, ... | <?php
namespace Flagrow\Analytics\Listeners;
use DirectoryIterator;
use Flarum\Event\ConfigureClientView;
use Illuminate\Contracts\Events\Dispatcher;
use Flarum\Event\ConfigureLocales;
class AddClientAssets
{
public function subscribe(Dispatcher $events)
{
$events->listen(ConfigureClientView::class, ... |
Enhance cache to one week | 'use strict';
var express = require('express');
var morgan = require('morgan');
var compression = require('compression');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var passport = require('passport');
var config = require('./environment');
module.expo... | 'use strict';
var express = require('express');
var morgan = require('morgan');
var compression = require('compression');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var passport = require('passport');
var config = require('./environment');
module.expo... |
Remove error handling for now. | var fs = require('fs');
var path = require('path');
var Stream = require('stream');
function statdir(dir, names, cb) {
var entries = [];
names.forEach(function(name) {
var relName = path.join(dir, name);
fs.lstat(relName, function(err, stats) {
entries.push({name: relName, isDir: stats && stats.isD... | var fs = require('fs');
var path = require('path');
var Stream = require('stream');
function statdir(dir, names, cb) {
var entries = [];
names.forEach(function(name) {
var relName = path.join(dir, name);
fs.lstat(relName, function(err, stats) {
entries.push({name: relName, isDir: stats && stats.isD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.