text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Fix double items showing up in workflow waiting for me | <?php
namespace Concrete\Core\Notification\View\Menu;
use Concrete\Core\Application\UserInterface\ContextMenu\DropdownMenu;
use Concrete\Core\Application\UserInterface\ContextMenu\Item\DividerItem;
use Concrete\Core\Application\UserInterface\ContextMenu\Item\ItemInterface;
use Concrete\Core\Application\UserInterface\C... | <?php
namespace Concrete\Core\Notification\View\Menu;
use Concrete\Core\Application\UserInterface\ContextMenu\DropdownMenu;
use Concrete\Core\Application\UserInterface\ContextMenu\Item\DividerItem;
use Concrete\Core\Application\UserInterface\ContextMenu\Item\ItemInterface;
use Concrete\Core\Application\UserInterface\C... |
Fix celery config to respect the host configured on settings | import os
from django.conf import settings
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://{}:{}/0'.format(settings.REDIS_HOST, REDIS_PORT))
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
C... | import os
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://localhost:%s/0' % REDIS_PORT)
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheB... |
Drop parent() its not used, and may not be exposed on all logging systems directly. | /*
* Copyright (C) 2010 the original author or authors.
*
* 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 applicab... | /*
* Copyright (C) 2010 the original author or authors.
*
* 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 applicab... |
Remove logging. It will just break travis. | from api.caching.tasks import ban_url, logger
from framework.guid.model import Guid
from framework.tasks.handlers import enqueue_task
from modularodm import signals
@signals.save.connect
def log_object_saved(sender, instance, fields_changed, cached_data):
abs_url = None
if hasattr(instance, 'absolute_api_v2_ur... | from api.caching.tasks import ban_url, logger
from framework.guid.model import Guid
from framework.tasks.handlers import enqueue_task
from modularodm import signals
@signals.save.connect
def log_object_saved(sender, instance, fields_changed, cached_data):
abs_url = None
if hasattr(instance, 'absolute_api_v2_ur... |
Make migration reverse no-op a valid SQL query
When using a PostgreSQL database with Django 1.7 empty reverse query
statements in DB migrations cause an error, so we replace the empty
no-op statement with a valid query that still does nothing so the
reverse migration will work in this case.
This problem doesn't seem ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_events', '0011_event_show_in_calendar'),
]
operations = [
migrations.AlterModelTable(
name='event',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_events', '0011_event_show_in_calendar'),
]
operations = [
migrations.AlterModelTable(
name='event',
... |
Add command to allow reset with longpress on both a and b. | var EventEmitter = require('events').EventEmitter;
var hardware = module.exports = new EventEmitter();
//var e = nobleEmitter.connect(peripheralUuid, serviceUuid, characteristicUuid);
var e = (process.env.DEVICE) ?
require('./serialport')(process.env.DEVICE) :
require('./stdin-mock');
var command... | var EventEmitter = require('events').EventEmitter;
var hardware = module.exports = new EventEmitter();
//var e = nobleEmitter.connect(peripheralUuid, serviceUuid, characteristicUuid);
var e = (process.env.DEVICE) ?
require('./serialport')(process.env.DEVICE) :
require('./stdin-mock');
var command... |
Modify abstract parameter to match its children
All instances of this already accept the parameter, so we should codify
it as part of the spec. | from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
class DocumentStore(object):
"""
Very basic implementation of a document store.
"""
__metaclass__ = ABCMeta
@abstractmethod
def get_document(self, doc_id):
pass
@abstractmethod
def save_document(s... | from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
class DocumentStore(object):
"""
Very basic implementation of a document store.
"""
__metaclass__ = ABCMeta
@abstractmethod
def get_document(self, doc_id):
pass
@abstractmethod
def save_document(s... |
Set state.video value to undefined | import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import YTSearch from 'youtube-api-search';
import SearchBar from './components/SearchBar';
import VideoList from './components/VideoList';
const YT_API = 'AIzaSyDqL_re6cE8YhtNr_O7GvX1SX3aQo1clyg';
class App extends Component {
constructo... | import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import YTSearch from 'youtube-api-search';
import SearchBar from './components/SearchBar';
import VideoList from './components/VideoList';
const YT_API = 'AIzaSyDqL_re6cE8YhtNr_O7GvX1SX3aQo1clyg';
class App extends Component {
constructo... |
Stop referencing Item and Items from view data. | <?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
<feed xmlns="http://www.w3.org/2005/Atom"
xml:lang="en"
xml:base="<?= PROTOCOL_HOST_PORT . \CWA\APP_ROOT ?>">
<id><?= 'tag:' . DOMAIN . ',2015:' . $ControllerURL . ':feed/atom' ?></id>
<link rel="self" type="<?= \CWA\Net\HTTP\HttpResponse::getContentType(... | <?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
<feed xmlns="http://www.w3.org/2005/Atom"
xml:lang="en"
xml:base="<?= PROTOCOL_HOST_PORT . \CWA\APP_ROOT ?>">
<id><?= 'tag:' . DOMAIN . ',2015:' . $ControllerURL . ':feed/atom' ?></id>
<link rel="self" type="<?= \CWA\Net\HTTP\HttpResponse::getContentType(... |
Use embedded enum in alembic revision
Unlikely to matter here but like this it will work correctly even in a
future where someone may add new sources to the original enum (in that
case this particular revision should not add those newer ones, which
would be the case when using the imported enum) | """Add column for profile picture type to User
Revision ID: f37d509e221c
Revises: c997dc927fbc
Create Date: 2020-09-04 15:43:18.413156
"""
from enum import Enum
import sqlalchemy as sa
from alembic import op
from indico.core.db.sqlalchemy import PyIntEnum
# revision identifiers, used by Alembic.
revision = 'f37d5... | """Add column for profile picture type to User
Revision ID: f37d509e221c
Revises: c997dc927fbc
Create Date: 2020-09-04 15:43:18.413156
"""
import sqlalchemy as sa
from alembic import op
from indico.core.db.sqlalchemy import PyIntEnum
from indico.modules.users.models.users import ProfilePictureSource
# revision ide... |
Test checking to deliberately break the build | package com.fenixinfotech.ehcache.playpen;
import net.sf.ehcache.CacheManager;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class CustomEhCac... | package com.fenixinfotech.ehcache.playpen;
import net.sf.ehcache.CacheManager;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class CustomEhCacheTest
{
private static final Logger lo... |
Test if the resource directory exists before reading it | const fs = require('fs-extra');
const RESOURCE_FOLDER = __dirname + '/../resources/';
const DESTINATION_FOLDER = __dirname + '/../out/';
/**
* Gives the list of resources defined for a preset.
*
* @param {String} presetName - Name of the preset
* @return {Array.<String>} List of the resources defined for this pre... | const fs = require('fs-extra');
const RESOURCE_FOLDER = __dirname + '/../resources/';
const DESTINATION_FOLDER = __dirname + '/../out/';
/**
* Gives the list of resources defined for a preset.
*
* @param {String} presetName - Name of the preset
* @return {Array.<String>} List of the resources defined for this pre... |
Add request to inside of try | import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': toke... | import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': toke... |
Hide debug logs by default | package behave.tools;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
//TODO use some proper logging framework
public class Log {
private static boolean m_logDebug = false;
private static DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss:SSS");
public sta... | package behave.tools;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
//TODO use some proper logging framework
public class Log {
private static DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss:SSS");
public static void debug(String msg) {
print("deb... |
Rename package oracle-paas -> nodeconductor-paas-oracle | #!/usr/bin/env python
from setuptools import setup, find_packages
dev_requires = [
'Sphinx==1.2.2',
]
install_requires = [
'nodeconductor>=0.95.0',
]
setup(
name='nodeconductor-paas-oracle',
version='0.1.0',
author='OpenNode Team',
author_email='info@opennodecloud.com',
url='http://nod... | #!/usr/bin/env python
from setuptools import setup, find_packages
dev_requires = [
'Sphinx==1.2.2',
]
install_requires = [
'nodeconductor>=0.95.0',
]
setup(
name='oracle-paas',
version='0.1.0',
author='OpenNode Team',
author_email='info@opennodecloud.com',
url='http://nodeconductor.com... |
Remove unused machines and prefix vars | package etcd
import (
"errors"
"github.com/coreos/go-etcd/etcd"
"github.com/kelseyhightower/confd/config"
"path/filepath"
"strings"
)
func GetValues(keys []string) (map[string]interface{}, error) {
vars := make(map[string]interface{})
c := etcd.NewClient()
success := c.SetCluster(config.EtcdNodes())
if !succ... | package etcd
import (
"errors"
"github.com/coreos/go-etcd/etcd"
"github.com/kelseyhightower/confd/config"
"path/filepath"
"strings"
)
var machines = []string{
"http://127.0.0.1:4001",
}
var prefix string = "/"
func GetValues(keys []string) (map[string]interface{}, error) {
vars := make(map[string]interface{})... |
Add CombatHelper class and getters/setters for modifiers. | const Type = require('./type').Type;
/*
* These functions take an entity (npc/player)
* and return the correct method or property
* depending on type.
*/
const getName = entity => Type.isPlayer(entity) ?
entity.getName() :
entity.getShortDesc('en');
const getSpeed = entity => entity.getAttackSpeed;
const g... | const Type = require('./type').Type;
/*
* These functions take an entity (npc/player)
* and return the correct method or property
* depending on type.
*/
const getName = entity => Type.isPlayer(entity) ?
entity.getName() :
entity.getShortDesc('en');
const getSpeed = entity => entity.getAttackSpeed;
const g... |
[tests] Remove test for deprecated createmultsig option | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
class Depr... | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... |
Add console script and test requirements. | from distutils.core import setup
import os
setup(
name='python-jambel',
version='0.1',
py_module=['jambel'],
url='http://github.com/jambit/python-jambel',
license='UNKNOWN',
author='Sebastian Rahlf',
author_email='sebastian.rahlf@jambit.com',
description="Interface to jambit's project t... | from distutils.core import setup
import os
setup(
name='python-jambel',
version='0.1',
py_module=['jambel'],
url='http://github.com/jambit/python-jambel',
license='UNKNOWN',
author='Sebastian Rahlf',
author_email='sebastian.rahlf@jambit.com',
description="Interface to jambit's project t... |
Fix provideConfig() in configure using event.type instead of event.name | const { next, hookStart, hookEnd } = require('hooter/effects')
const assignDefaults = require('./assignDefaults')
const validateConfig = require('./validateConfig')
const EVENTS_WITH_CONFIG = ['start', 'execute', 'process', 'handle', 'error']
module.exports = function* configurePlugin() {
let schema, config
fu... | const { next, hookStart, hookEnd } = require('hooter/effects')
const assignDefaults = require('./assignDefaults')
const validateConfig = require('./validateConfig')
const EVENTS_WITH_CONFIG = ['start', 'execute', 'process', 'handle', 'error']
module.exports = function* configurePlugin() {
let schema, config
fu... |
Replace Array.includes with utility function for IE11 compat 🐲 | import { entries } from '../utils/object-utils';
import { contains } from '../utils/array-utils';
export const VALID_ATTRIBUTES = [
'data-md-text-align'
];
/*
* A "mixin" to add section attribute support
* to markup and list sections.
*/
export function attributable(ctx) {
ctx.attributes = {};
ctx.setAttrib... | import { entries } from '../utils/object-utils';
export const VALID_ATTRIBUTES = [
'data-md-text-align'
];
/*
* A "mixin" to add section attribute support
* to markup and list sections.
*/
export function attributable(ctx) {
ctx.attributes = {};
ctx.setAttribute = (key, value) => {
if (!VALID_ATTRIBUTES... |
Update Mobile Oxford views to reflect use of app framework in
molly.maps. | from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
from molly.conf import applications
admin.autodiscover()
urlpatterns = patterns('',
(r'adm/(.*)', admin.site.root),
# These are how we expect all applications to be eventually.
(r'^contact/', applic... | from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
from molly.conf import applications
admin.autodiscover()
urlpatterns = patterns('',
(r'adm/(.*)', admin.site.root),
# These are how we expect all applications to be eventually.
(r'^contact/', applic... |
Remove unnecessary Hello World println
Change-Id: If4575dbbcd99c064fab3bc4d76c3f317c6c95c9a | /******************************************************************************
* Copyright Lajos Katona
*
* 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:/... | /******************************************************************************
* Copyright Lajos Katona
*
* 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:/... |
Support for completion callback with error | var exec = require('child_process').exec;
var self = module.exports;
/**
* Eject the specified disk drive.
* @param {int|string} id Locator for the disk drive.
* @param {Function} callback Optional callback for disk drive ejection completion / error.
*/
self.eject = function(id, callback) {
// are ... | var exec = require('child_process').exec;
var self = module.exports;
self.eject = function(id) {
// are we running on mac?
if (process.platform === 'darwin') {
// setup optional argument, on mac, will default to 1
id = (typeof id === 'undefined') ? 1 : id;
exec('drutil tray eject ' + id, function(err, stdout... |
Add error and detail field to captcha errors | from functools import wraps
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from rest_framework_captcha.models import Captcha
from rest_framework_captcha.helpers import get_settings, get_request_from_args
from rest_framework.response import Response
from rest_framework.exceptions impo... | from functools import wraps
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from rest_framework_captcha.models import Captcha
from rest_framework_captcha.helpers import get_settings, get_request_from_args
from rest_framework.response import Response
from rest_framework.exceptions impo... |
Fix KeyboardInterrupt exception filtering.
Add exception information and not just the stack trace.
Make the url easier to change at runtime.
Review URL: http://codereview.chromium.org/2109001
git-svn-id: bd64dd6fa6f3f0ed0c0666d1018379882b742947@47179 4ff67af0-8c30-449e-8e8b-ad334ec8d88c | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Breakpad for Python.
Sends a notification when a process stops on an exception."""
import atexit
import getpass
import urllib
import traceback
impor... | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Breakpad for Python.
Sends a notification when a process stops on an exception."""
import atexit
import getpass
import urllib
import traceback
impor... |
Reset input if value is "" | Validator = {};
Validator.addValidator = function (index, el) { // This function is called in $().each(). The first arg will be an index. Though we dont need it
$el = $(el);
// Add function by tag name.
switch ($el.prop('tagName')) {
case 'INPUT':
switch ($el.attr('type')) {
case 'number': $el.change(Valid... | Validator = {};
Validator.addValidator = function (index, el) { // This function is called in $().each(). The first arg will be an index. Though we dont need it
$el = $(el);
// Add function by tag name.
switch ($el.prop('tagName')) {
case 'INPUT':
switch ($el.attr('type')) {
case 'number': $el.change(Valid... |
Remove junk code and comments. |
var runway = require('./runway.js')
module.exports = runway
document.onclick = function(event) {
event = event || window.event // IE specials
var target = event.target || event.srcElement // IE specials
if (target.tagName === 'A') {
event.preventDefault()
processLink.call(target)
}
}
function proc... |
var runway = require('./runway.js')
module.exports = runway
document.onclick = function(event) {
event = event || window.event // IE specials
var target = event.target || event.srcElement // IE specials
if (target.tagName === 'A') {
event.preventDefault()
processLink.call(target)
}
}
function proc... |
Make uids valid for use in URLs | /**
* Module dependencies
*/
var crypto = require('crypto');
/**
* The size ratio between a base64 string and the equivalent byte buffer
*/
var ratio = Math.log(64) / Math.log(256);
/**
* Make a Base64 string ready for use in URLs
*
* @param {String}
* @returns {String}
* @api private
*/
function urlRead... | /**
* Module dependencies
*/
var crypto = require('crypto');
/**
* The size ratio between a base64 string and the equivalent byte buffer
*/
var ratio = Math.log(64) / Math.log(256);
/**
* Generate an Unique Id
*
* @param {Number} length The number of chars of the uid
* @param {Number} cb (optional) Callba... |
Improve ui responsiveness if urls.path is databound | var m = angular.module("routeUrls", []);
m.factory("urls", function($route) {
var pathsByName = {};
angular.forEach($route.routes, function (route, path) {
if (route.name) {
pathsByName[route.name] = path;
}
});
var regexs = {};
var path = function (name, params) {
... | var m = angular.module("routeUrls", []);
m.factory("urls", function($route) {
var pathsByName = {};
angular.forEach($route.routes, function (route, path) {
if (route.name) {
pathsByName[route.name] = path;
}
});
var path = function (name, params) {
var url = pathsB... |
Disable forgotten returns for server promises | require('babel-register');
require('babel-polyfill');
const Bluebird = require('bluebird');
const WebpackIsomorphicTools = require('webpack-isomorphic-tools');
const config = require('../common/config');
const rootDir = require('path').resolve(__dirname, '..', '..');
const webpackIsomorphicAssets = require('../../webp... | require('babel-register');
require('babel-polyfill');
const Bluebird = require('bluebird');
const WebpackIsomorphicTools = require('webpack-isomorphic-tools');
const config = require('../common/config');
const rootDir = require('path').resolve(__dirname, '..', '..');
const webpackIsomorphicAssets = require('../../webp... |
Fix duplicated key not copying ID correctly | package net.mcft.copy.betterstorage;
import net.mcft.copy.betterstorage.items.ItemKey;
import net.mcft.copy.betterstorage.items.ItemLock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.ICraftingHandler;
/** Ha... | package net.mcft.copy.betterstorage;
import net.mcft.copy.betterstorage.items.ItemKey;
import net.mcft.copy.betterstorage.items.ItemLock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.ICraftingHandler;
/** Ha... |
Add some additional logging for ajax failures. | // Common ajax-handling functions for dashboard-like pages. Looks for <reload/>
// elements to reload the page, and reports errors or failures via alerts.
g_action_url = "action.php";
// Note that this doesn't run if the $.ajax call has a 'success:' callback that
// generates an error.
$(document).ajaxSuccess(functi... | // Common ajax-handling functions for dashboard-like pages. Looks for <reload/>
// elements to reload the page, and reports errors or failures via alerts.
g_action_url = "action.php";
// Note that this doesn't run if the $.ajax call has a 'success:' callback that
// generates an error.
$(document).ajaxSuccess(functi... |
Correct link to start controller in routing | 'use strict';
angular.module('repicbro', ['repicbro.controllers',
'repicbro.services',
'repicbro.filters',
'ngRoute',
'ngTouch'])
.config(function ($routeProvider, $locationProvider, constants) {
$loca... | 'use strict';
angular.module('repicbro', ['repicbro.controllers',
'repicbro.services',
'repicbro.filters',
'ngRoute',
'ngTouch'])
.config(function ($routeProvider, $locationProvider, constants) {
$loca... |
Create and modify lines in same loop | import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_line.getiterator(... | from operator import itemgetter
import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag f... |
Use the new api for stringifying the box | // Dependencies
var Box = require("../lib");
// Create a simple box
var b1 = Box("20x10");
console.log(b1.toString());
// Set custom marks
var b2 = new Box({
w: 10
, h: 10
, stringify: false
, marks: {
nw: "╔"
, n: "══"
, ne: "╗"
, e: "║"
, se: "╝"
, s: "══"
, ... | // Dependencies
var Box = require("../lib");
// Create a simple box
var b1 = new Box("20x10");
console.log(b1.toString());
// Set custom marks
var b2 = new Box({
w: 10
, h: 10
, marks: {
nw: "╔"
, n: "══"
, ne: "╗"
, e: "║"
, se: "╝"
, s: "══"
, sw: "╚"
, w... |
Fix require for node v5 | const assert = require('assert');
const crypto = require('./config').crypto;
const config = require('./config').config;
describe("WebCrypto", () => {
it("get random values", () => {
var buf = new Uint8Array(16);
var check = new Buffer(buf).toString("base64");
assert.notEqual(new Buffer(cry... | const assert = require('assert');
const { crypto, config } = require('./config');
describe("WebCrypto", () => {
it("get random values", () => {
var buf = new Uint8Array(16);
var check = new Buffer(buf).toString("base64");
assert.notEqual(new Buffer(crypto.getRandomValues(buf)).toString("ba... |
Remove route54 provider because the driver is not finished yet.
git-svn-id: 9ad005ce451fa0ce30ad6352b03eb45b36893355@1340889 13f79535-47bb-0310-9956-ffa450edef68 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
Fix handling of hidden form field values via AJAX
See #3053 | <?php
namespace wcf\system\form\builder\field;
/**
* Implementation of a form field for a hidden input field that is not visible in the rendered form.
*
* @author Matthias Schmidt
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*... | <?php
namespace wcf\system\form\builder\field;
/**
* Implementation of a form field for a hidden input field that is not visible in the rendered form.
*
* @author Matthias Schmidt
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*... |
Store OpenSeadragon.Viewer instantiation object handle | //= require openseadragon
(function($) {
var __osd_counter = 0;
function generateOsdId() {
__osd_counter++;
return "Openseadragon" + __osd_counter;
}
function initOpenSeadragon() {
$('picture[data-openseadragon]').each(function() {
var $picture = $(this);
if (typeof $pictur... | //= require openseadragon
(function($) {
var __osd_counter = 0;
function generateOsdId() {
__osd_counter++;
return "Openseadragon" + __osd_counter;
}
function initOpenSeadragon() {
$('picture[data-openseadragon]').each(function() {
var $picture = $(this);
if (typeof $pictur... |
Hide (instead of fade out) badge on iPhone | $(document).ready(function() {
function updateAssessmentFormState() {
var numberOfQuestions = $('#assessment .legend').length;
var numberOfCheckedAnswers = $('#assessment input:checked').length;
var numberOfUnansweredQuestions = numberOfQuestions - numberOfCheckedAnswers;
var unansweredQuestionsBadge... | $(document).ready(function() {
function updateAssessmentFormState() {
var numberOfQuestions = $('#assessment .legend').length;
var numberOfCheckedAnswers = $('#assessment input:checked').length;
var numberOfUnansweredQuestions = numberOfQuestions - numberOfCheckedAnswers;
var unansweredQuestionsBadge... |
Fix browser conflicts for test suite | var env = require('./environment.js');
// A small suite to make sure the cucumber framework works.
exports.config = {
seleniumAddress: env.seleniumAddress,
framework: 'custom',
frameworkPath: '../index.js',
// Spec patterns are relative to this directory.
specs: [
'cucumber/*.feature'
],
multiCapa... | var env = require('./environment.js');
// A small suite to make sure the cucumber framework works.
exports.config = {
seleniumAddress: env.seleniumAddress,
framework: 'custom',
frameworkPath: '../index.js',
// Spec patterns are relative to this directory.
specs: [
'cucumber/*.feature'
],
multiCapa... |
Allow modules to set base dir name | <?php
namespace ATP;
class Module
{
protected $_moduleName = "";
protected $_moduleBaseDir = "vendor";
public function onBootstrap(\Zend\Mvc\MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new \Zend\Mvc\ModuleRouteListener();
$mo... | <?php
namespace ATP;
class Module
{
protected $_moduleName = "";
public function onBootstrap(\Zend\Mvc\MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new \Zend\Mvc\ModuleRouteListener();
$moduleRouteListener->attach($eventManager... |
Update to new alabaster-driven nav sidebar | from datetime import datetime
import os
import sys
import alabaster
# Alabaster theme
html_theme_path = [alabaster.get_path()]
# Paths relative to invoking conf.py - not this shared file
html_static_path = ['../_shared_static']
html_theme = 'alabaster'
html_theme_options = {
'description': "A Python implementati... | from datetime import datetime
import os
import sys
import alabaster
# Alabaster theme
html_theme_path = [alabaster.get_path()]
# Paths relative to invoking conf.py - not this shared file
html_static_path = ['../_shared_static']
html_theme = 'alabaster'
html_theme_options = {
'description': "A Python implementati... |
Add new fields to the task model | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... |
[Fix] Fix EventWeather not triggering properly | package me.deftware.mixin.mixins;
import me.deftware.client.framework.event.events.EventWeather;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.LightmapTextureManager;
import net.minecraft.client.render.WorldRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm... | package me.deftware.mixin.mixins;
import me.deftware.client.framework.event.events.EventWeather;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.WorldRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.inj... |
Update Django requirements for 1.8 | #!/usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(name='django-elect',
version='0.1',
description='A simple voting app for Django',
license='BSD',
author='Mason Malone',
author_email='mason.malone@gmail.com',
url='http:/... | #!/usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(name='django-elect',
version='0.1',
description='A simple voting app for Django',
license='BSD',
author='Mason Malone',
author_email='mason.malone@gmail.com',
url='http:/... |
Fix addAssets for production builds | const createConfig = require('./base')
const addAssets = require('./assets')
const addDevelopment = require('./development')
const addProduction = require('./production')
const addHot = require('./hot')
const addStory = require('./story')
/**
* Build Webpack configuration
* @param {Object} options - Options
* @para... | const createConfig = require('./base')
const addAssets = require('./assets')
const addDevelopment = require('./development')
const addProduction = require('./production')
const addHot = require('./hot')
const addStory = require('./story')
/**
* Build Webpack configuration
* @param {Object} options - Options
* @para... |
Add leading slash to path if not provided | var st = require('st')
, http = require('http')
, js = require('atomify-js')
, css = require('atomify-css')
, open = require('open')
module.exports = function (args) {
var mount = st(args.server.st || process.cwd())
, port = args.server.port || 1337
, launch = args.server.open
, path = args.serv... | var st = require('st')
, http = require('http')
, js = require('atomify-js')
, css = require('atomify-css')
, open = require('open')
module.exports = function (args) {
var mount = st(args.server.st || process.cwd())
, port = args.server.port || 1337
, launch = args.server.open
, path = args.serv... |
Check main thread before scheduling | /*
* Copyright 2016 FabricMC
*
* 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 agreed to in ... | /*
* Copyright 2016 FabricMC
*
* 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 agreed to in ... |
Revert "Minor - webpack client filename change"
This reverts commit 8a687defb70b7c4bab6c5aac3be8867d8efd7542. | const webpack = require('webpack')
const merge = require('webpack-merge')
const base = require('./webpack.base.config')
const path = require('path')
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin')
const config = merge(base, {
optimization: {
splitChunks: {
cacheGroups: {
co... | const webpack = require('webpack')
const merge = require('webpack-merge')
const base = require('./webpack.base.config')
const path = require('path')
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin')
const config = merge(base, {
output: {
path: path.resolve(__dirname, '../../dist'),
publ... |
Add svn:ignore to the list of standard properties. | package com.github.cstroe.svndumpgui.api;
public interface SvnProperty {
String DATE = "svn:date";
String AUTHOR = "svn:author";
String LOG = "svn:log";
String IGNORE = "svn:ignore";
String MIMETYPE = "svn:mime-type";
String MERGEINFO = "svn:mergeinfo";
/**
* Used in {@link com.github... | package com.github.cstroe.svndumpgui.api;
public interface SvnProperty {
String DATE = "svn:date";
String AUTHOR = "svn:author";
String LOG = "svn:log";
String MIMETYPE = "svn:mime-type";
String MERGEINFO = "svn:mergeinfo";
/**
* Used in {@link com.github.cstroe.svndumpgui.generated.SvnDu... |
Fix "Edit on GitHub" links
Using "master" seems to mess it up, see
https://github.com/readthedocs/readthedocs.org/issues/5518 | # -*- coding: utf-8 -*-
### General settings
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Firebase Admin SDK for PHP'
author = u'Jérôme Gamez'
copyright = u'Jérôme Gamez'
version = u'4.x'
html_title = u'Firebase Admin SDK for PHP Documentation'
html_short_tit... | # -*- coding: utf-8 -*-
### General settings
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Firebase Admin SDK for PHP'
author = u'Jérôme Gamez'
copyright = u'Jérôme Gamez'
version = u'4.x'
html_title = u'Firebase Admin SDK for PHP Documentation'
html_short_tit... |
Remove install_requires that are not on PyPI yet. | #!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
"bleach",
"jinja2",
"Django>=1.4",
"django-celery",
"django-jsonfield",
"django-model-utils",
"django-tastypie",
"docutils",
"isoweek",
"lxml",
]
setup(
name="crate.web",
version="0.1... | #!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
"bleach",
"jinja2",
"celery-haystack",
"Django>=1.4",
"django-celery",
"django-haystack",
"django-jsonfield",
"django-model-utils",
"django-tastypie",
"docutils",
"isoweek",
"lxml",
... |
BB-3192: Make default delete operation available only in main entity management grids
- cs updates | <?php
namespace Oro\Bundle\ActionBundle\Helper;
use Symfony\Component\HttpFoundation\RequestStack;
class RequestHelper
{
/** @var RequestStack */
protected $requestStack;
/** @var ApplicationsHelper */
protected $applicationsHelper;
/**
* @param RequestStack $requestStack
* @param App... | <?php
namespace Oro\Bundle\ActionBundle\Helper;
use Symfony\Component\HttpFoundation\RequestStack;
class RequestHelper
{
/** @var RequestStack */
protected $requestStack;
/** @var ApplicationsHelper */
protected $applicationsHelper;
/**
* @param RequestStack $requestStack
*/
publi... |
Move symlinked page field to "Other options" | """
This introduces a new page type, which has no content of its own but inherits
all content from the linked page.
"""
from django.db import models
from django.utils.translation import ugettext_lazy as _
from feincms._internal import monkeypatch_property
def register(cls, admin_cls):
cls.add_to_class('symlinke... | """
This introduces a new page type, which has no content of its own but inherits
all content from the linked page.
"""
from django.db import models
from django.utils.translation import ugettext_lazy as _
from feincms._internal import monkeypatch_property
def register(cls, admin_cls):
cls.add_to_class('symlinke... |
Update breadcrumb to support localization | (function () {
"use strict";
var app = angular.module('RbsChange');
app.config(['$provide', function ($provide)
{
$provide.decorator('RbsChange.UrlManager', ['$delegate', function ($delegate)
{
$delegate.module('Rbs_Plugins')
.route('Installed', 'Rbs/Plugins/Installed/', { 'templateUrl': 'Rbs/Plugins/... | (function () {
"use strict";
var app = angular.module('RbsChange');
app.config(['$provide', function ($provide)
{
$provide.decorator('RbsChange.UrlManager', ['$delegate', function ($delegate)
{
$delegate.model('Rbs_Plugins')
.route('Installed', 'Rbs/Plugins/Installed/', { 'templateUrl': 'Rbs/Plugins/i... |
Update with reference to global nav partial | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-hovers/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-hovers/tachyons-hovers.min.css', 'utf8')
var moduleObj = css... | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-hovers/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-hovers/tachyons-hovers.min.css', 'utf8')
var moduleObj = css... |
Refactor SimpleSectionView to inherit DetailView | from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.utils.translation import ugettext as _
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Sectio... | from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.views.generic import TemplateView
from django.utils.translation import ugettext as _
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Sect... |
engine: Improve log message on failure to connect to storage server
From now on log message will contain name and id of the relevant
storage domain a host failed to connect to.
Change-Id: Ife941b59766e699a046122abc74aaede366a2015
Signed-off-by: Sergey Gotliv <76a2e639c7812c7311d8d25c611b643bca4ae95e@redhat.com> | package org.ovirt.engine.core.bll.storage;
import org.ovirt.engine.core.common.businessentities.VDS;
import org.ovirt.engine.core.common.businessentities.StorageDomain;
import org.ovirt.engine.core.common.businessentities.StoragePool;
import org.ovirt.engine.core.utils.log.Log;
import org.ovirt.engine.core.utils.log.L... | package org.ovirt.engine.core.bll.storage;
import org.ovirt.engine.core.common.businessentities.VDS;
import org.ovirt.engine.core.common.businessentities.StorageDomain;
import org.ovirt.engine.core.common.businessentities.StoragePool;
import org.ovirt.engine.core.utils.log.Log;
import org.ovirt.engine.core.utils.log.L... |
Add polling loop to allow time for callback to be invoked | import os
import time
from chalice.cli.filewatch import stat
class FakeOSUtils(object):
def __init__(self):
self.initial_scan = True
def walk(self, rootdir):
yield 'rootdir', [], ['bad-file', 'baz']
if self.initial_scan:
self.initial_scan = False
def joinpath(self, *... | import os
from chalice.cli.filewatch import stat
class FakeOSUtils(object):
def __init__(self):
self.initial_scan = True
def walk(self, rootdir):
yield 'rootdir', [], ['bad-file', 'baz']
if self.initial_scan:
self.initial_scan = False
def joinpath(self, *parts):
... |
Use m.Count() even inside pointer-struct functions
This way the backing datastore can be more easily mucked with | package litetunes
import (
"errors"
"fmt"
)
// MemoryQueue is an in-memory implementation of the Queue interface
type MemoryQueue struct {
tracks []*Track
}
// NewMemoryQueue constructs a new MemoryQueue to use
func NewMemoryQueue() *MemoryQueue {
return &MemoryQueue{tracks: []*Track{}}
}
// Queue adds a new tr... | package litetunes
import (
"errors"
"fmt"
)
// MemoryQueue is an in-memory implementation of the Queue interface
type MemoryQueue struct {
tracks []*Track
}
// NewMemoryQueue constructs a new MemoryQueue to use
func NewMemoryQueue() *MemoryQueue {
return &MemoryQueue{tracks: []*Track{}}
}
// Queue adds a new tr... |
Add blacklist check for chat when a user sends a message | <?php
# Copyright (c) 2015 Jordan Turley, CSGO Win Big. All Rights Reserved.
session_start();
include 'default.php';
include 'SteamAuthentication/steamauth/userInfo.php';
$db = getDB();
if (!isset($_SESSION['steamid'])) {
echo jsonErr('You are not logged in.');
return;
}
$text = isset($_POST['text']) ? $_POST['tex... | <?php
# Copyright (c) 2015 Jordan Turley, CSGO Win Big. All Rights Reserved.
session_start();
include 'default.php';
include 'SteamAuthentication/steamauth/userInfo.php';
$db = getDB();
if (!isset($_SESSION['steamid'])) {
echo jsonErr('You are not logged in.');
return;
}
$text = isset($_POST['text']) ? $_POST['tex... |
[stargate] Fix infinite recursive loop bug
Submitted-by: Zhentao Huang <zhentao.huang@trendmicro.com.cn>
Signed-off-by: Andrew Purtell <apurtell@apache.org>
git-svn-id: 25ca64b629f24bdef6d1cceac138f74b13f55e41@943999 13f79535-47bb-0310-9956-ffa450edef68 | /*
* Copyright 2010 The Apache Software Foundation
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the ... | /*
* Copyright 2010 The Apache Software Foundation
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the ... |
Test if partition calls func once for each item | /* eslint-env node, jest */
const { partition, range } = require('iter-tools')
describe('partition', function () {
describe('evens and odds', function () {
const isEven = n => n % 2 === 0
it('empty iterable', function () {
const [evens, odds] = partition(isEven, [])
expect([
Array.from(... | /* eslint-env node, jest */
const { partition, range } = require('iter-tools')
describe('partition', function () {
describe('evens and odds', function () {
const isEven = n => n % 2 === 0
it('empty iterable', function () {
const [evens, odds] = partition(isEven, [])
expect([
Array.from(... |
Copy assets after dist folder has been created
The production build script fails when it tries to copy the content of the assets folder to a non-existing folder. | require('shelljs/global');
const package = require('../package.json');
const prodDependencies = Object.keys(package.jspm.dependencies);
const devDependencies = Object.keys(package.jspm.devDependencies);
const allDependencies = prodDependencies.concat(devDependencies);
const command = process.argv[2];
switch (command... | require('shelljs/global');
const package = require('../package.json');
const prodDependencies = Object.keys(package.jspm.dependencies);
const devDependencies = Object.keys(package.jspm.devDependencies);
const allDependencies = prodDependencies.concat(devDependencies);
const command = process.argv[2];
switch (command... |
Verify that the generated playlist contains the path to the item | # -*- coding: utf-8 -*-
"""Tests for the play plugin"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from mock import patch, ANY
from test._common import unittest
from test.helper import TestHelper
class PlayPluginTest(unittest.TestCase, TestHelper):... | # -*- coding: utf-8 -*-
"""Tests for the play plugin"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from mock import patch, Mock
from test._common import unittest
from test.helper import TestHelper
class PlayPluginTest(unittest.TestCase, TestHelper)... |
Disable CSS for ZEIT AMP theme | define([
'plugins/post-hash',
'plugins/status',
'plugins/predefined-types',
'theme/scripts/js/plugins/ampify',
'theme/scripts/js/plugins/button-pagination',
'theme/scripts/js/plugins/social-share',
// 'css!theme/liveblog',
'tmpl!theme/container',
'tmpl!theme/posts-list',
'tmpl!th... | define([
'plugins/post-hash',
'plugins/status',
'plugins/predefined-types',
'theme/scripts/js/plugins/ampify',
'theme/scripts/js/plugins/button-pagination',
'theme/scripts/js/plugins/social-share',
'css!theme/liveblog',
'tmpl!theme/container',
'tmpl!theme/posts-list',
'tmpl!theme... |
Add source-map to minified build | /* eslint-env node */
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
devtool: 'source-map',
entry: {
daypicker: './DayPicker.dist.js',
},
output: {
path: `${__dirname}/lib`,
filename: `[name]${isProduction ? '.min' : ''}.js`,
library: 'DayPicker',
libraryTar... | /* eslint-env node */
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
entry: {
daypicker: './DayPicker.dist.js',
},
output: {
path: `${__dirname}/lib`,
filename: `[name]${isProduction ? '.min' : ''}.js`,
library: 'DayPicker',
libraryTarget: 'umd',
},
extern... |
Update modules fixture to always include autoActivated modules in active list. | /**
* Modules datastore fixtures.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.... | /**
* Modules datastore fixtures.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.... |
Fix race condition on AppVeyor. Increase timeout a bit. | package markdown
import (
"fmt"
"strings"
"sync"
"testing"
"time"
)
func TestWatcher(t *testing.T) {
expected := "12345678"
interval := time.Millisecond * 100
i := 0
out := ""
stopChan := TickerFunc(interval, func() {
i++
out += fmt.Sprint(i)
})
// wait little more because of concurrency
time.Sleep(i... | package markdown
import (
"fmt"
"strings"
"sync"
"testing"
"time"
)
func TestWatcher(t *testing.T) {
expected := "12345678"
interval := time.Millisecond * 100
i := 0
out := ""
stopChan := TickerFunc(interval, func() {
i++
out += fmt.Sprint(i)
})
// wait little more because of concurrency
time.Sleep(i... |
Use comma on every line on multi-line lists | #!/usr/bin/env python
import setuptools
import samsungctl
setuptools.setup(
name=samsungctl.__title__,
version=samsungctl.__version__,
description=samsungctl.__doc__,
url=samsungctl.__url__,
author=samsungctl.__author__,
author_email=samsungctl.__author_email__,
license=samsungctl.__licen... | #!/usr/bin/env python
import setuptools
import samsungctl
setuptools.setup(
name=samsungctl.__title__,
version=samsungctl.__version__,
description=samsungctl.__doc__,
url=samsungctl.__url__,
author=samsungctl.__author__,
author_email=samsungctl.__author_email__,
license=samsungctl.__licen... |
Remove wrong link from Javadoc | /*
* Copyright (C) 2010-2014 Hamburg Sud and the 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/LICENSE-2.0
*
* Unless required by a... | /*
* Copyright (C) 2010-2014 Hamburg Sud and the 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/LICENSE-2.0
*
* Unless required by a... |
Add check for unsuccessful date checks | import os
from dateutil.parser import parse
from ...common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and re... | import os
from dateutil.parser import parse
from ...common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and re... |
Add regex for finding path params | 'use strict';
var resourcify = angular.module('resourcify', []);
function resourcificator ($http, $q) {
var $resourcifyError = angular.$$minErr('resourcify'),
requestOptions = ['query', 'get', '$get', '$save', '$update', '$delete'],
requestMethods = {
'query': 'GET',
'get': 'GET',
... | 'use strict';
var resourcify = angular.module('resourcify', []);
function resourcificator ($http, $q) {
var $resourcifyError = angular.$$minErr('resourcify'),
requestOptions = ['query', 'get', '$get', '$save', '$update', '$delete'],
requestMethods = {
'query': 'GET',
'get': 'GET',
... |
Refactor query out into instance with delegates the update | from stagecraft.apps.datasets.models import DataGroup, DataSet, DataType
class DataSetMassUpdate(object):
@classmethod
def update_bearer_token_for_data_type_or_group_name(cls, query, new_token):
cls(query).update(bearer_token=new_token)
def __init__(self, query_dict):
self.model_filter =... | from stagecraft.apps.datasets.models import DataGroup, DataSet, DataType
class DataSetMassUpdate():
@classmethod
def update_bearer_token_for_data_type_or_group_name(cls, query, new_token):
model_filter = DataSet.objects
if 'data_type' in query:
data_type = cls._get_model_instance_b... |
Make sure that we reference the config file using an absolute path... just in case...
git-svn-id: efba275c3291004ad656db059d43564e37a1fae9@1775 60fe80c7-c1f8-43be-bd32-c3e8feb7a3b0 | <?php
$sConfigFile = 'conf/production/config-itop.php';
$sStartPage = './pages/UI.php';
$sSetupPage = './setup/index.php';
/**
* Check that the configuration file exists and has the appropriate access rights
* If the file does not exist, launch the configuration wizard to create it
*/
if (file_exists(dir... | <?php
$sConfigFile = 'conf/production/config-itop.php';
$sStartPage = './pages/UI.php';
$sSetupPage = './setup/index.php';
/**
* Check that the configuration file exists and has the appropriate access rights
* If the file does not exist, launch the configuration wizard to create it
*/
if (file_exists($sC... |
Use main file name as umd library name | const HtmlWebPackPlugin = require("html-webpack-plugin")
const mainFile = "InfiniteAnyHeight.jsx"
module.exports = {
entry: {
main: __dirname + "/src/" + mainFile,
},
output: {
filename: "[name].js",
path: __dirname + "/dist",
library: mainFile.substring (0, mainFile.indexOf(".")),
libraryT... | const HtmlWebPackPlugin = require("html-webpack-plugin")
module.exports = {
entry: {
main: __dirname + "/src/InfiniteAnyHeight.jsx",
},
output: {
filename: "[name].js",
path: __dirname + "/dist",
library: "InfiniteAnyHeight",
libraryTarget: "umd",
},
devtool: "source-map",
module: {
... |
Adjust error color to be darker | // You still need to register Vuetify itself
// src/plugins/vuetify.js
import Vuetify from 'vuetify/lib'
import PbsLogo from '@/assets/PbsLogo.svg'
import GoogleLogo from '@/assets/GoogleLogo.svg'
import eCampLogo from '@/assets/eCampLogo.svg'
import i18n from '@/plugins/i18n'
import colors from 'vuetify/lib/util/colo... | // You still need to register Vuetify itself
// src/plugins/vuetify.js
import Vuetify from 'vuetify/lib'
import PbsLogo from '@/assets/PbsLogo.svg'
import GoogleLogo from '@/assets/GoogleLogo.svg'
import eCampLogo from '@/assets/eCampLogo.svg'
import i18n from '@/plugins/i18n'
class VuetifyLoaderPlugin {
install (V... |
Fix broken unit test under PHP 8 | <?php
declare(strict_types=1);
namespace Phpcq\Runner\Test\Config\Builder;
use Phpcq\Runner\Config\Builder\AbstractOptionBuilder;
use Phpcq\Runner\Config\Builder\ConfigOptionBuilderInterface;
use Phpcq\PluginApi\Version10\Configuration\Builder\OptionBuilderInterface;
use Phpcq\PluginApi\Version10\Exception\InvalidCo... | <?php
declare(strict_types=1);
namespace Phpcq\Runner\Test\Config\Builder;
use Phpcq\Runner\Config\Builder\AbstractOptionBuilder;
use Phpcq\Runner\Config\Builder\ConfigOptionBuilderInterface;
use Phpcq\PluginApi\Version10\Configuration\Builder\OptionBuilderInterface;
use Phpcq\PluginApi\Version10\Exception\InvalidCo... |
Improve some tests for calendar conversions. | // Copyright (C) 2020 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.absolute.prototype.todatetime
---*/
const values = [
[null, "null"],
[true, "true"],
["iso8601", "iso8601"],
[2020, "2020"],
[2n, "2"],
];
const absolute =... | // Copyright (C) 2020 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.absolute.prototype.todatetime
---*/
const values = [
[null, "null"],
[true, "true"],
["iso8601", "iso8601"],
[2020, "2020"],
[2n, "2"],
];
const absolute =... |
Change adaddress, etc to gaddress, etc in address filter |
(function() {
'use strict';
/**
* Generate a human-readable address string from a single museum object
*
* Can get fancy here and prioritize one of the three address types provided:
* source address, geocoded address, physical address
*
* For now, default to geocoded address sinc... |
(function() {
'use strict';
/**
* Generate a human-readable address string from a single museum object
*
* Can get fancy here and prioritize one of the three address types provided:
* source address, geocoded address, physical address
*
* For now, default to geocoded address sinc... |
Improve the query execution order. | from application import app
from flask.ext.restful import Api, Resource
import os
from subprocess import Popen as run, PIPE
from distutils.sysconfig import get_python_lib
from autoupdate import lib_path, db_path
api = Api(app)
fetch = '{:s}/hmmer/easel/miniapps/esl-afetch'.format(lib_path)
def db(query):
cmd = ... | from application import app
from flask.ext.restful import Api, Resource
import os
from subprocess import Popen as run, PIPE
from distutils.sysconfig import get_python_lib
from autoupdate import lib_path, db_path
api = Api(app)
fetch = '{:s}/hmmer/easel/miniapps/esl-afetch'.format(lib_path)
def db(query):
cmd = ... |
Index all scrolled models by perma id in entry state | import {watchCollection} from '../collections';
export function watchCollections({chapters, sections, contentElements, files}, {dispatch}) {
watchCollection(chapters, {
name: 'chapters',
attributes: ['id', 'permaId'],
keyAttribute: 'permaId',
includeConfiguration: true,
dispatch
});
watchColl... | import {watchCollection} from '../collections';
export function watchCollections({chapters, sections, contentElements, files}, {dispatch}) {
watchCollection(chapters, {
name: 'chapters',
attributes: ['id', 'permaId'],
includeConfiguration: true,
dispatch
});
watchCollection(sections, {
name: ... |
Fix for Connectivity status check
Updates connectivity status check to match best practice from
https://developer.android.com/training/monitoring-device-state/connectivity-monitoring.html#DetermineType | package org.commcare.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.provider.Settings;
/**
* @author Phillip Mates (pmates@dimagi.com)
*/
public class ConnectivityStatus {
public static boolean isAirplaneModeOn(Context context) {
... | package org.commcare.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.provider.Settings;
/**
* @author Phillip Mates (pmates@dimagi.com)
*/
public class ConnectivityStatus {
public static boolean isAirplaneModeOn(Context context) {
... |
Set initial focused option item | var $ = require('jquery');
module.exports = {
$doc: $(document),
setupDom: function () {
this.$el = $(this.element);
this.$el.addClass(this.options.classes.originalSelect);
// Setup wrapper
this.$wrapper = $('<div />', {
'class': this.options.classes.wrapper
});
// Setup select
this.$select = ... | var $ = require('jquery');
module.exports = {
$doc: $(document),
setupDom: function () {
this.$el = $(this.element);
this.$el.addClass(this.options.classes.originalSelect);
// Setup wrapper
this.$wrapper = $('<div />', {
'class': this.options.classes.wrapper
});
// Setup select
this.$select = ... |
Fix typo when setting up handler. | #
# Copyright (c) 2009 rPath, Inc.
#
# All Rights Reserved
#
from mint import amiperms
class AWSHandler(object):
def __init__(self, cfg, db):
self.db = db
self.amiPerms = amiperms.AMIPermissionsManager(cfg, db)
def notify_UserProductRemoved(self, event, userId, projectId, userlevel = None):
... | #
# Copyright (c) 2009 rPath, Inc.
#
# All Rights Reserved
#
from mint import amiperms
class AWSHandler(object):
def __init__(self, cfg, db):
self.db = db
self.amiPerms = amiperms.AMIPermissionsManager(cfg, db)
def notify_UserProductRemoved(self, event, userId, projectId, userlevel = None):
... |
Add option to select database by index. | /**
* Module dependencies.
*/
var redis = require('redis');
exports = module.exports = function(settings, logger) {
var config = settings.toObject();
if (!config.host) { throw new Error('Redis host not set in config'); }
var host = config.host;
var port = config.port || 6379;
var db = config.db;
var cl... | /**
* Module dependencies.
*/
var redis = require('redis');
exports = module.exports = function(settings, logger) {
var config = settings.toObject();
if (!config.host) { throw new Error('Redis host not set in config'); }
var host = config.host;
var port = config.port || 6379;
var client = redis.createClient(... |
Handle blog posts front page | <?php
// If blog posts configured for front page, pass on handling
if ( 'posts' == get_option( 'show_on_front' ) ) {
include( get_home_template() );
return;
}
?>
<?php get_header(); ?>
<main>
<!--Main layout-->
<div class="container">
<div class="row">
<!--Main column-->
<div class="col-md-12 col-lg-8 posts-co... | <?php get_header(); ?>
<main>
<!--Main layout-->
<div class="container">
<div class="row">
<!--Main column-->
<div class="col-md-12 col-lg-8 posts-col">
<?php
if ( is_active_sidebar( 'frontpage' ) ) {
dynamic_sidebar( 'frontpage' );
} elseif ( have_posts() ) {
while ( have_posts() ) {
the_pos... |
Increase item max to 500 | import devtools from '../devtools';
import { REALLY_BIG_NUMBER } from '../utils';
import merge from 'deepmerge';
import PineCone from '../sprites/object/PineCone';
const itemMax = 500;
let items = {
'wood-axe': {
value: true,
sellable: false,
},
bucket: {
value: false,
sellable: false,
},
... | import devtools from '../devtools';
import { REALLY_BIG_NUMBER } from '../utils';
import merge from 'deepmerge';
import PineCone from '../sprites/object/PineCone';
const itemMax = 50;
let items = {
'wood-axe': {
value: true,
sellable: false,
},
bucket: {
value: false,
sellable: false,
},
w... |
Fix test wasn't actually testing | let ivm = require('isolated-vm');
let isolate = new ivm.Isolate;
function makeContext() {
let context = isolate.createContextSync();
let global = context.globalReference();
global.setSync('ivm', ivm);
isolate.compileScriptSync(`
function makeReference(ref) {
return new ivm.Reference(ref);
}
function isRef... | let ivm = require('isolated-vm');
let isolate = new ivm.Isolate;
function makeContext() {
let context = isolate.createContextSync();
let global = context.globalReference();
global.setSync('ivm', ivm);
isolate.compileScriptSync(`
function makeReference(ref) {
return new ivm.Reference(ref);
}
function isRef... |
Check if field exists, not if it's empty | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.meta.base import MetaBase
class Meta(MetaBase):
name = 'Diesel Sweeties (web)'
language = 'en'
url = 'http://www.dieselsweeties.com/'
start_date = '2000-01-01'
rights = 'Richard Stevens'
class Crawler(CrawlerBase):
his... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.meta.base import MetaBase
class Meta(MetaBase):
name = 'Diesel Sweeties (web)'
language = 'en'
url = 'http://www.dieselsweeties.com/'
start_date = '2000-01-01'
rights = 'Richard Stevens'
class Crawler(CrawlerBase):
his... |
Comment out Analytics ui-router code | /* global*/
import config from './index.config';
import routerConfig from './index.route';
import runBlock from './index.run';
import HomeController from './home/home.controller';
import PortfolioIndexService from './home/portfolio-index.service';
angular.module('lazarus', ['ngAnimate', 'ngCookies', 'ngTouch', 'ngSa... | /* global*/
import config from './index.config';
import routerConfig from './index.route';
import runBlock from './index.run';
import HomeController from './home/home.controller';
import PortfolioIndexService from './home/portfolio-index.service';
angular.module('lazarus', ['ngAnimate', 'ngCookies', 'ngTouch', 'ngSa... |
Adjust JS document ready function | "use strict";
$(document).on("ready turbolinks:load", function() { //equivalent of $(document).ready()
console.log("JS loaded.")
addSpace();
var $grid = initMasonry();
// layout Masonry after each image loads
$grid.imagesLoaded().progress( function() {
$grid.masonry('layout');
});
});
function initMa... | "use strict";
$(document).on("turbolinks:load", function() { //equivalent of $(document).ready()
console.log("JS loaded.")
addSpace();
var $grid = initMasonry();
// layout Masonry after each image loads
$grid.imagesLoaded().progress( function() {
$grid.masonry('layout');
});
});
function initMasonry(... |
Use EventListenerInterface instead of EventListener. | <?php
namespace Crud\Core;
use Cake\Controller\Controller;
use Cake\Core\InstanceConfigTrait;
use Cake\Event\Event;
use Cake\Event\EventListenerInterface;
use Crud\Event\Subject;
/**
* Crud Base Class
*
* Implement base methods used in CrudAction and CrudListener classes
*
* Licensed under The MIT License
* For... | <?php
namespace Crud\Core;
use Cake\Controller\Controller;
use Cake\Core\InstanceConfigTrait;
use Cake\Event\Event;
use Cake\Event\EventListener;
use Crud\Event\Subject;
/**
* Crud Base Class
*
* Implement base methods used in CrudAction and CrudListener classes
*
* Licensed under The MIT License
* For full cop... |
Fix the language object (wasn't available before) | package ceylon.language;
import com.redhat.ceylon.common.Versions;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Object;
@Ceylon(major = 3) @Object
public final class language_ {
public java.lang.String getVersion() {
return Versions.CEYLON_VERSI... | package ceylon.language;
import com.redhat.ceylon.common.Versions;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Object;
@Ceylon(major = 3) @Object
public final class language_ {
public java.lang.String getVersion() {
return Versions.CEYLON_VERSI... |
Add _capnp for original Cython module. Meant for testing. | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people', 2)
alice ... | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people', 2)
alice ... |
Add settings support for tmdb keys | 'use strict';
// Load requirements
const parser = require('parse-torrent-name');
// Load libraries
const settings = __require('libs/settings');
// Create promise to resolve with dataset
module.exports = function(filename) {
return new Promise((resolve, reject) => {
// Variables
let source;
// No file... | 'use strict';
// Load requirements
const parser = require('parse-torrent-name');
// Create promise to resolve with dataset
module.exports = function(filename) {
return new Promise((resolve, reject) => {
// Variables
let source;
// No file provided
if ( filename === undefined ) {
return rejec... |
Snoop: Add host to ARP table if MAC not found
Signed-off-by: Claudio Matsuoka <ef7f691d9947ca9adbfeb1538a53a661ec9f041b@gmail.com> | package main
import (
"fmt"
"net"
"github.com/cmatsuoka/ouidb"
"github.com/mostlygeek/arp"
)
var db *ouidb.OuiDB
func init() {
db = ouidb.New("/etc/manuf")
if db == nil {
db = ouidb.New("manuf")
}
}
func getMAC(s string) (string, error) {
ifaces, err := net.Interfaces()
checkError(err)
for _, i := rang... | package main
import (
"fmt"
"net"
"github.com/cmatsuoka/ouidb"
"github.com/mostlygeek/arp"
)
var db *ouidb.OuiDB
func init() {
db = ouidb.New("/etc/manuf")
if db == nil {
db = ouidb.New("manuf")
}
}
func getMAC(s string) (string, error) {
ifaces, err := net.Interfaces()
checkError(err)
for _, i := rang... |
Use a fixed size of 100 bytes for the randomly generated data | 'use strict';
const chai = require('chai');
const crypto = require('crypto');
const lzo = require('../index');
const expect = chai.expect;
let data = crypto.randomBytes(100),
compressed;
describe('Compression', () => {
it('Should throw if nothing is passed', () =>
expect(() => lzo.compress()).to.throw() );
... | 'use strict';
const chai = require('chai');
const crypto = require('crypto');
const lzo = require('../index');
const expect = chai.expect;
let data = crypto.randomBytes(Math.floor(Math.random() * 500)),
compressed;
describe('Compression', () => {
it('Should throw if nothing is passed', () =>
expect(() => lzo.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.