text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Reduce number of entries shown on index
from django.contrib.auth.decorators import login_required from django.http import Http404 from django.shortcuts import render, get_list_or_404 from django.db.models import Q from .models import Entry @login_required def overview(request, category="Allgemein"): entries = Entry.objects.all().order_by('-created')[:5...
from django.contrib.auth.decorators import login_required from django.http import Http404 from django.shortcuts import render, get_list_or_404 from django.db.models import Q from .models import Entry @login_required def overview(request, category="Allgemein"): entries = Entry.objects.all().order_by('-created') ...
Fix lifecycle events to satisfy recommendations
import ClickOutsideMixin from './mixin'; import Component from '@ember/component'; import { next, cancel } from '@ember/runloop'; import $ from 'jquery'; export default Component.extend(ClickOutsideMixin, { clickOutside(e) { if (this.isDestroying || this.isDestroyed) { return; } const exceptSelec...
import ClickOutsideMixin from './mixin'; import Component from '@ember/component'; import { on } from '@ember/object/evented'; import { next, cancel } from '@ember/runloop'; import $ from 'jquery'; export default Component.extend(ClickOutsideMixin, { clickOutside(e) { if (this.isDestroying || this.isDestroyed) ...
Add TOPLEVEL pos to unify node pos interface
import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script string and retu...
import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script string and retu...
Move the notification on the about page below the text so that when the page loads, the text gets loaded first, then the notification content and then Vue renders it as a notification
@extends('layout') @section('content') @component('partials.header') @slot('theme') is-dark @endslot @slot('subtitle') About section @endslot @endcomponent <div class="section"> <div class="container"> <div class="content column i...
@extends('layout') @section('content') @component('partials.header') @slot('theme') is-dark @endslot @slot('subtitle') About section @endslot @endcomponent <Notification v-show="showNotifcation" type="info" :timer="false" @close="showNotifcation = fa...
Sort plg: fix caret pos after 'delete empty lines'
import os from cudatext import * def get_ini_fn(): return os.path.join(app_path(APP_DIR_SETTINGS), 'cuda_sort.ini') def ed_set_text_all(lines): ed.set_text_all('\n'.join(lines)+'\n') def ed_get_text_all(): n = ed.get_line_count() if ed.get_text_line(n-1)=='': n-=1 return [ed.get_text_line(i) for ...
import os from cudatext import * def get_ini_fn(): return os.path.join(app_path(APP_DIR_SETTINGS), 'cuda_sort.ini') def ed_set_text_all(lines): ed.set_text_all('\n'.join(lines)+'\n') def ed_get_text_all(): n = ed.get_line_count() if ed.get_text_line(n-1)=='': n-=1 return [ed.get_text_line(i) for ...
Remove usage of deprecated Collection
<?php namespace Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\Validator; use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** @ODM\Document(collection="DoctrineMongoDBBundle_Tests_Validator_Document") */ class Document { /** @ODM\Id(strategy="none") */ protected $id; /** @ODM\Field(type="string") */ ...
<?php namespace Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\Validator; use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** @ODM\Document(collection="DoctrineMongoDBBundle_Tests_Validator_Document") */ class Document { /** @ODM\Id(strategy="none") */ protected $id; /** @ODM\Field(type="string") */ ...
Fix new docs ESLint rule violation.
/** * 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....
Allow mixing the loaded WAV file from stereo to mono.
import numpy as np from scipy.io import wavfile def normalize(samples): max_value = np.max(np.abs(samples)) return samples / max_value if max_value != 0 else samples def save_wav(samples, filename, fs=44100, should_normalize=False, factor=((2**15))-1): ''' Saves samples in given sampling frequency to ...
import numpy as np from scipy.io import wavfile def normalize(samples): max_value = np.max(np.abs(samples)) return samples / max_value if max_value != 0 else samples def save_wav(samples, filename, fs=44100, should_normalize=False, factor=((2**15))-1): ''' Saves samples in given sampling frequency to ...
Disable minificiation when preprocessing is enabled
import * as t from 'babel-types' import { useMinify, useCSSPreprocessor } from '../utils/options' import { isStyled, isHelper } from '../utils/detectors' const minify = (linebreak) => { const regex = new RegExp(linebreak + '\\s*', 'g') return (code) => code.split(regex).filter(line => line.length > 0).map((lin...
import * as t from 'babel-types' import { useMinify } from '../utils/options' import { isStyled, isHelper } from '../utils/detectors' const minify = (linebreak) => { const regex = new RegExp(linebreak + '\\s*', 'g') return (code) => code.split(regex).filter(line => line.length > 0).map((line) => { return line....
Add license info (retroactively applied to all commits).
#!/usr/bin/env python # Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop) import io import setuptools with io.open('README.txt', encoding='utf-8') as readme: long_description = readme.read() with io.open('CHANGES.txt', encoding='utf-8') as changes: long_description += '\n\n' + changes.read()...
#!/usr/bin/env python # Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop) import io import setuptools with io.open('README.txt', encoding='utf-8') as readme: long_description = readme.read() with io.open('CHANGES.txt', encoding='utf-8') as changes: long_description += '\n\n' + changes.read()...
Remove dependency on default parameters in JS Apparently it's only supported by Firefox, source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/default_parameters This issue was brought up in #3.
'use strict'; app.factory('Product', function($http) { function getUrl(id) { id = typeof id !== 'undefined' ? id : ''; return 'http://127.0.0.1:8000/api/products/' + id + '?format=json'; } return { get: function(id, callback) { return $http.get(getUrl(id)).success(callback); }, query:...
'use strict'; app.factory('Product', function($http) { function getUrl(id = '') { return 'http://127.0.0.1:8000/api/products/' + id + '?format=json'; } return { get: function(id, callback) { return $http.get(getUrl(id)).success(callback); }, query: function(page, page_size, callback) { ...
Make Webpack logs a bit less verbose.
/* * `server` task * ============= * * Creates a Browsersync Web server instance for live development. Makes use of * some Webpack middlewares to enable live reloading features. */ import browsersync from 'browser-sync'; import webpackDevMiddleware from 'webpack-dev-middleware'; import webpackHotMiddleware from ...
/* * `server` task * ============= * * Creates a Browsersync Web server instance for live development. Makes use of * some Webpack middlewares to enable live reloading features. */ import browsersync from 'browser-sync'; import webpackDevMiddleware from 'webpack-dev-middleware'; import webpackHotMiddleware from ...
Change the default kns table
package org.aksw.kbox.kibe; import java.net.MalformedURLException; import java.net.URL; import org.aksw.kbox.kns.CustomKNSServerList; import org.aksw.kbox.kns.KNSServerListVisitor; public class DefaultKNSServerList extends URLKNSServerList { // Default KNS table URL private final static String DEFAULT_KNS_TABLE_...
package org.aksw.kbox.kibe; import java.net.MalformedURLException; import java.net.URL; import org.aksw.kbox.kns.CustomKNSServerList; import org.aksw.kbox.kns.KNSServerListVisitor; public class DefaultKNSServerList extends URLKNSServerList { // Default KNS table URL private final static String DEFAULT_KNS_TABLE_...
Insert empty line at to fix patch. gyptest-link-pdb.py was checked in without a blank line. This appears to cause a patch issue with the try bots. This CL is only a whitespace change to attempt to fix that problem. SEE: patching file test/win/gyptest-link-pdb.py Hunk #1 FAILED at 26. 1 out of 1 hunk FAILED -- savin...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that the 'Profile' attribute in VCLinker is extracted properly. """ import TestGyp import os import sys if sys.platform == ...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that the 'Profile' attribute in VCLinker is extracted properly. """ import TestGyp import os import sys if sys.platform == ...
Update selector for removing li Also remove console.log
$('#title').addClass('redtitle'); var json = { "room":{ "name":"FangDev", "members":"Salgat:1452401384430,Fangfang2:1452401457085", "messages":[ "Salgat: I love you more xiaobei", "Fangfang: I love you Laobei" ] } }; function removeMessages(){ $('#messages').find('l...
$('#title').addClass('redtitle'); var json = { "room":{ "name":"FangDev", "members":"Salgat:1452401384430,Fangfang2:1452401457085", "messages":[ "Salgat: I love you more xiaobei", "Fangfang: I love you Laobei" ] } }; function removeMessages(){ $('li').remove(); } f...
Use color suggested by @xavijam
module.exports = { COLORS: [ '#F24440', '#11A579', '#3969AC', '#E73F74', '#80BA5A', '#E68310', '#008695', '#CF1C90', '#f97b72', '#A5AA99' ], /** * Returns a color given a letter * @param {String} Letter. eg: 'a', 'b', 'c', etc. * @return {String} Hex color code: ...
module.exports = { COLORS: [ '#7F3C8D', '#11A579', '#3969AC', '#E73F74', '#80BA5A', '#E68310', '#008695', '#CF1C90', '#f97b72', '#A5AA99' ], /** * Returns a color given a letter * @param {String} Letter. eg: 'a', 'b', 'c', etc. * @return {String} Hex color code: ...
Change default logging level to INFO+
<?php include('../src/common.php'); use Monolog\Logger; use Monolog\Handler\StreamHandler; use unreal4u\Telegram\Types\Update; use unreal4u\Telegram\Types\InlineQueryResultArticle; use unreal4u\Telegram\Methods\AnswerInlineQuery; use unreal4u\TgLog; $parsedRequestUri = trim($_SERVER['REQUEST_URI'], '/'); if (array_k...
<?php include('../src/common.php'); use Monolog\Logger; use Monolog\Handler\StreamHandler; use unreal4u\Telegram\Types\Update; use unreal4u\Telegram\Types\InlineQueryResultArticle; use unreal4u\Telegram\Methods\AnswerInlineQuery; use unreal4u\TgLog; $parsedRequestUri = trim($_SERVER['REQUEST_URI'], '/'); if (array_k...
Use build-in method to get user homedir instead of eval on sh
// +build !windows package main import ( "errors" "os" "os/user" "path/filepath" ) func configFile() (string, error) { dir, err := homeDir() if err != nil { return "", err } return filepath.Join(dir, ".terraformrc"), nil } func configDir() (string, error) { dir, err := homeDir() if err != nil { retur...
// +build !windows package main import ( "bytes" "errors" "os" "os/exec" "path/filepath" "strings" ) func configFile() (string, error) { dir, err := homeDir() if err != nil { return "", err } return filepath.Join(dir, ".terraformrc"), nil } func configDir() (string, error) { dir, err := homeDir() if ...
Add prop to disable submit
import React, {PropTypes, Component} from 'react'; import {View} from 'react-native'; export default class Form extends Component { _listeners = []; static PropTypes = { onSuccess: PropTypes.func, onFail: PropTypes.func, submitButton: PropTypes.element.isRequired } static childContextTypes = { ...
import React, {PropTypes, Component} from 'react'; import {View} from 'react-native'; export default class Form extends Component { _listeners = []; static PropTypes = { onSuccess: PropTypes.func, onFail: PropTypes.func, submitButton: PropTypes.element.isRequired } static childContextTypes = { ...
Set user.email_address.verified as true when user changed his password
from django.contrib.sessions.models import Session from django.dispatch import receiver from django.utils.translation import ugettext as _ from account.models import EmailAddress from account.signals import email_confirmation_sent, password_changed, user_signed_up from board.models import Board, Notification from boar...
from django.contrib.sessions.models import Session from django.dispatch import receiver from django.utils.translation import ugettext as _ from account.signals import email_confirmation_sent, user_signed_up from board.models import Board, Notification from board.utils import treedict @receiver(email_confirmation_sen...
Fix extracted star coordinates from 1- to 0-based indexing Note that center of first pixel is 0, ie. edge of first pixel is -0.5
# -*- coding: utf-8 -*- """ Created on Mon Dec 25 15:19:55 2017 @author: vostok """ import os import tempfile from astropy.io import fits def extract_stars(input_array): (infilehandle, infilepath) = tempfile.mkstemp(suffix='.fits') os.close(infilehandle) fits.writeto(infilepath, \ input...
# -*- coding: utf-8 -*- """ Created on Mon Dec 25 15:19:55 2017 @author: vostok """ import os import tempfile from astropy.io import fits def extract_stars(input_array): (infilehandle, infilepath) = tempfile.mkstemp(suffix='.fits') os.close(infilehandle) fits.writeto(infilepath, \ input...
Remove dependency on six for simplekv.
#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='simplekv', version='0.9.4.dev1', description=('A key-value storage for binary data, support many ' ...
#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='simplekv', version='0.9.4.dev1', description=('A key-value storage for binary data, support many ' ...
Adjust test outcome to new nub source numbers
package org.gbif.checklistbank.nub.source; import org.gbif.api.vocabulary.Rank; import org.gbif.checklistbank.nub.model.SrcUsage; import java.util.List; import java.util.UUID; import org.junit.Test; import static org.junit.Assert.assertEquals; public class ClasspathUsageSourceTest { /** * integration test wi...
package org.gbif.checklistbank.nub.source; import org.gbif.api.vocabulary.Rank; import org.gbif.checklistbank.nub.model.SrcUsage; import java.util.List; import java.util.UUID; import org.junit.Test; import static org.junit.Assert.assertEquals; public class ClasspathUsageSourceTest { /** * integration test wi...
Make context name for a filter form configurable
from django.views.generic.list import MultipleObjectMixin __all__ = ('FilterFormMixin',) class FilterFormMixin(MultipleObjectMixin): """ Mixin that adds filtering behaviour for Class Based Views. Changed in a way that can play nicely with other CBV simply by overriding the get_queryset(self) and get_...
from django.views.generic.list import MultipleObjectMixin __all__ = ('FilterFormMixin',) class FilterFormMixin(MultipleObjectMixin): """ Mixin that adds filtering behaviour for Class Based Views. Changed in a way that can play nicely with other CBV simply by overriding the get_queryset(self) and get_...
Allow newer versions of chardet
from setuptools import setup from distutils.core import Command import os import sys import codecs class TestCommand(Command): description = "Run tests" user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): import subprocess...
from setuptools import setup from distutils.core import Command import os import sys import codecs class TestCommand(Command): description = "Run tests" user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): import subprocess...
Fix text color for account disabled page
{{-- Copyright (c) ppy Pty Ltd <contact@ppy.sh>. This file is part of osu!web. osu!web is distributed with the hope of attracting more community contributions to the core ecosystem of osu!. osu!web is free software: you can redistribute it and/or modify it under the terms of the Affero GNU General...
{{-- Copyright (c) ppy Pty Ltd <contact@ppy.sh>. This file is part of osu!web. osu!web is distributed with the hope of attracting more community contributions to the core ecosystem of osu!. osu!web is free software: you can redistribute it and/or modify it under the terms of the Affero GNU General...
Fix for periodic task scheduler (3)
__author__ = 'onur' from celery import Celery import direnaj_api.config.server_celeryconfig as celeryconfig app_object = Celery() app_object.config_from_object(celeryconfig) @app_object.task def deneme(x, seconds): print "Sleeping for printing %s for %s seconds.." % (x, seconds) import time time.sleep(...
__author__ = 'onur' from celery import Celery import direnaj_api.config.server_celeryconfig as celeryconfig app_object = Celery() app_object.config_from_object(celeryconfig) @app_object.task def deneme(x, seconds): print "Sleeping for printing %s for %s seconds.." % (x, seconds) import time time.sleep(...
Handle also .pm and .pl file types
"use babel"; fs = require('fs-plus') /** * This class provides the file-icons service API implemented by tree-view * Please see https://github.com/atom/tree-view#api */ module.exports = class Perl6FileIconsProvider { iconClassForPath(filePath) { extension = path.extname(filePath) if (fs.isSymbolicLinkS...
"use babel"; fs = require('fs-plus') /** * This class provides the file-icons service API implemented by tree-view * Please see https://github.com/atom/tree-view#api */ module.exports = class Perl6FileIconsProvider { iconClassForPath(filePath) { extension = path.extname(filePath) if (fs.isSymbolicLinkS...
Remove no longer needed comments
'use strict'; var _ = require('lodash'); var glimpse = require('glimpse'); var processMessages = function(messages) { return { messages: messages, groupedById: _.groupBy(messages, 'context.id') }; }; // republish Found Summary (function () { function republishFoundSummary(messages) { ...
'use strict'; var _ = require('lodash'); var glimpse = require('glimpse'); var processMessages = function(messages) { return { messages: messages, groupedById: _.groupBy(messages, 'context.id') }; }; // republish Found Summary (function () { function republishFoundSummary(messages) { ...
WebApp-4b: Sort tasks by createdAt timestamp
// simple-todos.js // TODO: Add tasks from console to populate collection // On Server: // db.tasks.insert({ text: "Hello world!", createdAt: new Date() }); // On Client: // Tasks.insert({ text: "Hello world!", createdAt: new Date() }); Tasks = new Mongo.Collection("tasks"); if (Meteor.isClient) { // This code onl...
// simple-todos.js // TODO: Add tasks from console to populate collection // On Server: // db.tasks.insert({ text: "Hello world!", createdAt: new Date() }); // On Client: // Tasks.insert({ text: "Hello world!", createdAt: new Date() }); Tasks = new Mongo.Collection("tasks"); if (Meteor.isClient) { // This code onl...
Update /admin/debug/clear with new logging semantics
// Copyright (c) 2015 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
// Copyright (c) 2015 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
Use the DefaultScheduler if none is assigned Fixes #1
let scheduler = null export function setScheduler (customScheduler) { scheduler = customScheduler } export function getScheduler () { if (!scheduler) { scheduler = new DefaultScheduler() } return scheduler } class DefaultScheduler { constructor () { this.updateRequests = [] this.frameRequested ...
let scheduler = null export function setScheduler (customScheduler) { if (customScheduler) { scheduler = customScheduler } else { scheduler = new DefaultScheduler() } } export function getScheduler () { return scheduler } class DefaultScheduler { constructor () { this.updateRequests = [] th...
Use HTTPS in homepage URL
import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status ::...
import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status ::...
Update ps test: add All option
package dockercommand import ( "testing" "github.com/stretchr/testify/assert" ) func TestShortDockerPs(t *testing.T) { docker, err := NewDockerForTest() if err != nil { t.Fatalf("err: %s", err) } containers, err := docker.Ps(&PsOptions{All: true}) if err != nil { t.Fatalf("err: %s", err) } assert.NotEm...
package dockercommand import ( "testing" "github.com/stretchr/testify/assert" ) func TestShortDockerPs(t *testing.T) { docker, err := NewDockerForTest() if err != nil { t.Fatalf("err: %s", err) } containers, err := docker.Ps(&PsOptions{}) if err != nil { t.Fatalf("err: %s", err) } assert.NotEmpty(t, co...
Update Dockstore link to release 0.0.6.
'use strict'; /** * @ngdoc service * @name dockstore.ui.WebService * @description * # WebService * Constant in the dockstore.ui. */ angular.module('dockstore.ui') .constant('WebService', { API_URI: 'http://localhost:8080', API_URI_DEBUG: 'http://localhost:9000/tests/dummy-data', GITHUB_AUTH_URL: '...
'use strict'; /** * @ngdoc service * @name dockstore.ui.WebService * @description * # WebService * Constant in the dockstore.ui. */ angular.module('dockstore.ui') .constant('WebService', { API_URI: 'http://localhost:8080', API_URI_DEBUG: 'http://localhost:9000/tests/dummy-data', GITHUB_AUTH_URL: '...
Migrate usage of the TokenGrant in the sample
package de.rheinfabrik.heimdalldroid.network.oauth2; import de.rheinfabrik.heimdall2.OAuth2AccessToken; import de.rheinfabrik.heimdall2.grants.OAuth2RefreshAccessTokenGrant; import de.rheinfabrik.heimdalldroid.network.TraktTvApiFactory; import de.rheinfabrik.heimdalldroid.network.models.RefreshTokenRequestBody; import...
package de.rheinfabrik.heimdalldroid.network.oauth2; import de.rheinfabrik.heimdall2.OAuth2AccessToken; import de.rheinfabrik.heimdall2.grants.OAuth2RefreshAccessTokenGrant; import de.rheinfabrik.heimdalldroid.network.TraktTvApiFactory; import de.rheinfabrik.heimdalldroid.network.models.RefreshTokenRequestBody; import...
Bump new dev version to 0.3.0
import os __version__ = (0, 3, 0, 'alpha', 1) def get_fancypages_paths(path): """ Get absolute paths for *path* relative to the project root """ return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)] def get_required_apps(): return [ 'django_extensions', # used for imag...
import os __version__ = (0, 1, 1, 'alpha', 1) def get_fancypages_paths(path): """ Get absolute paths for *path* relative to the project root """ return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)] def get_required_apps(): return [ 'django_extensions', # used for imag...
Make deps an explicit dependency
Package.describe({ summary: 'Display the connection status with the server' }) Package.on_use(function(api, where) { api.use([ 'meteor', 'deps', 'underscore', 'templating' ], 'client') api.use(['tap-i18n'], ['client', 'server']) api.add_files('package-tap.i18n', ['client', 'server']) api...
Package.describe({ summary: 'Display the connection status with the server' }) Package.on_use(function(api, where) { api.use([ 'meteor', 'underscore', 'templating' ], 'client') api.use(['tap-i18n'], ['client', 'server']) api.add_files('package-tap.i18n', ['client', 'server']) api.add_files([...
Add validation id for staging tests.
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.application.validation; import java.util.Optional; /** * Ids of validations that can be overridden * * @author bratseth */ public enum ValidationId { indexingChange(...
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.application.validation; import java.util.Optional; /** * Ids of validations that can be overridden * * @author bratseth */ public enum ValidationId { indexingChange(...
Revert "$this->app->share deprecated in 5.4" This reverts commit 3297ab6d4c36bbe8e15701bae370177e9bb91e81.
<?php namespace Cornford\Bootstrapper; use Illuminate\Support\ServiceProvider; class BootstrapServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = true; /** * Bootstrap the application events. * * @return void */ pu...
<?php namespace Cornford\Bootstrapper; use Illuminate\Support\ServiceProvider; class BootstrapServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = true; /** * Bootstrap the application events. * * @return void */ pu...
Replace the 'Customize' Tab with 'Install'
<?php /* Tab Menu */ $tabs = array( array( 'url'=>"index.php", 'label'=>"Home" ), array( 'url'=>"impulserecreations.user.js", 'label'=>"Install" ), //array( 'url'=>"customize", 'label'=>"Customize" ), array( 'url'=>"http://www.impulsecreations.net/", 'label'=>"Impulse Creations" ) ); if ( DEBUG_LVL >= 1 ) { $tabs ...
<?php /* Tab Menu */ $tabs = array( array( 'url'=>"index.php", 'label'=>"Home" ), array( 'url'=>"customize", 'label'=>"Customize" ), array( 'url'=>"http://www.impulsecreations.net/", 'label'=>"Impulse Creations" ) ); if ( DEBUG_LVL >= 1 ) { $tabs []= array( 'url'=>"debug", 'label'=>"[ debug ]" ); } ?> <div class="...
Use expanded style in rendered css
let fs = require('fs'); let mkdirp = require('mkdirp'); let sass = require('node-sass'); sass.render({ file: 'sass/matter.sass', indentedSyntax: true, outputStyle: 'expanded', }, function (renderError, result) { if (renderError) { console.log(renderError); } else { mkdirp('dist/css', function (mkdirE...
let fs = require('fs'); let mkdirp = require('mkdirp'); let sass = require('node-sass'); sass.render({ file: 'sass/matter.sass', }, function (renderError, result) { if (renderError) { console.log(renderError); } else { mkdirp('dist/css', function (mkdirError) { if (mkdirError) { console.log...
Fix error when docs isn't set
var express = require('express'); var router = express.Router(); var Fact = require('../db').Fact; var missingFact = { id: "missingfact", text: "I'm sorry, I can't remember that fact:(" } // API information routes router.get('/', function(req, res, next) { res.render('api', { title: 'Fun Facts API' }); }); rou...
var express = require('express'); var router = express.Router(); var Fact = require('../db').Fact; // API information routes router.get('/', function(req, res, next) { res.render('api', { title: 'Fun Facts API' }); }); router.get('/v1/', function(req, res, next) { res.render('api-v1', { title: 'Fun Facts API v1' ...
Change entity create to call set event
import * as ecsChanges from './changes'; const ECSController = { [ecsChanges.ENTITY_CREATE]: (change, store, notify) => { const { id, template } = change.data; // Manipulate change data to include entity data let entity = store.state.create(id); change.data.entity = entity; for (let name in templ...
import * as ecsChanges from './changes'; const ECSController = { [ecsChanges.ENTITY_CREATE]: (change, store, notify) => { const { id, template } = change.data; // Manipulate change data to include entity data change.data.entity = store.state.create(id, template); notify(change); }, [ecsChanges.EN...
Add default handler for other routes that are not cached
importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js'); workbox.core.skipWaiting(); workbox.precaching.precacheAndRoute([]); workbox.precaching.precache(['/offline/']); const persistentPages = ['/', '/blog/', '/events/', '/projects/']; const persistentPagesStrategy = new workbox.stra...
importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js'); workbox.core.skipWaiting(); workbox.precaching.precacheAndRoute([]); workbox.precaching.precache(['/offline/']); const persistentPages = ['/', '/blog/', '/events/', '/projects/']; const persistentPagesStrategy = new workbox.stra...
Fix unit test case error
/******************************************************************************* * Copyright (c) 2004 Actuate Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is availabl...
/******************************************************************************* * Copyright (c) 2004 Actuate Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is availabl...
Add log statement if REST API can't be accessed
import requests import json from subprocess import Popen, PIPE import tempfile import os import sys config = {} with open ('../config/conversion.json') as fp: config = json.load(fp) def to_cml(inchi): request = requests.get('%s/service/chemical/cjson/?q=inchi~eq~%s' % (config['baseUrl'], inchi)) if request.st...
import requests import json from subprocess import Popen, PIPE import tempfile import os config = {} with open ('../config/conversion.json') as fp: config = json.load(fp) def to_cml(inchi): request = requests.get('%s/service/chemical/cjson/?q=inchi~eq~%s' % (config['baseUrl'], inchi)) if request.status_code =...
Rewrite render string method to support newer Twig engine
<?php namespace CodeGen; use Twig_Loader_String; use Twig_Environment; use Closure; class Utils { static $stringloader = null; static $twig; static public function renderStringTemplate($templateContent, array $args = array(), Twig_Environment $env = null) { if (!$env) { $env = n...
<?php namespace CodeGen; use Twig_Loader_String; use Twig_Environment; use Closure; class Utils { static $stringloader = null; static $twig; static public function renderStringTemplate($templateContent, array $args = array()) { if (!self::$stringloader) { self::$stringloader = new...
Fix problem with exception classes
<?php namespace SBLayout\Model\Page; use SBLayout\Model\Application; use SBLayout\Model\PageForbiddenException; use SBLayout\Model\PageNotFoundException; use SBLayout\Model\Page\Content\Contents; /** * Defines a page displaying arbitrary contents in one or more content sections. */ class ContentPage extends Page { ...
<?php namespace SBLayout\Model\Page; use SBLayout\Model\Application; use SBLayout\Model\Page\Content\Contents; /** * Defines a page displaying arbitrary contents in one or more content sections. */ class ContentPage extends Page { /** A content object storing properties of the content sections of a page */ public ...
Taskwiki: Update tasks and evaluate viewports on saving
import sys import re import vim from tasklib.task import TaskWarrior, Task # Insert the taskwiki on the python path sys.path.insert(0, vim.eval("s:plugin_path") + '/taskwiki') from regexp import * from task import VimwikiTask from cache import TaskCache """ How this plugin works: 1.) On startup, it reads all t...
import sys import re import vim from tasklib.task import TaskWarrior, Task # Insert the taskwiki on the python path sys.path.insert(0, vim.eval("s:plugin_path") + '/taskwiki') from regexp import * from task import VimwikiTask from cache import TaskCache """ How this plugin works: 1.) On startup, it reads all t...
Print what we're doing, and make executable
#!/usr/bin/env node var rimraf = require('rimraf') var fs = require('fs') var childProcess = require('child_process') var walkSync = require('./') rimraf.sync('benchmark.tmp') var directories = 100, files = 1000 function createDirWithFiles(dir) { fs.mkdirSync(dir) for (var i = 0; i < files; i++) { fs.writeFi...
#!/usr/bin/env node var rimraf = require('rimraf') var fs = require('fs') var childProcess = require('child_process') var walkSync = require('./') rimraf.sync('benchmark.tmp') function createDirWithFiles(dir) { fs.mkdirSync(dir) for (var i = 0; i < 1000; i++) { fs.writeFileSync(dir + '/' + i, 'foo') } } cr...
:art: Clean up boolean cell styles
import React from 'react'; import { Dropdown, Icon, Menu, Button } from 'antd'; import { func, number, string, any } from 'prop-types'; const { Item } = Menu; const BooleanCell = ({ children, onChange, row, column }) => ( <div css={{ width: 250, height: 42, }} > <Dropdown trigger={['click']} css={...
import React from 'react'; import { Dropdown, Icon, Menu, Button } from 'antd'; import { func, number, string, any } from 'prop-types'; const { Item } = Menu; const BooleanCell = ({ children, onChange, row, column }) => ( <div css={{ width: 250, height: 42, }} > <Dropdown trigger={['click']} css={...
Set localhost as default proxy
var webpack = require('webpack'); var path = require('path'); var loaders = require('./webpack.loaders'); module.exports = { entry: [ 'webpack/hot/only-dev-server', './src/index.jsx' // Your appʼs entry point ], devtool: process.env.WEBPACK_DEVTOOL || 'source-map', output: { path: __dirname + '/build', pub...
var webpack = require('webpack'); var path = require('path'); var loaders = require('./webpack.loaders'); module.exports = { entry: [ 'webpack/hot/only-dev-server', './src/index.jsx' // Your appʼs entry point ], devtool: process.env.WEBPACK_DEVTOOL || 'source-map', output: { path: __dirname + '/build', pub...
Add general text message for feedback form
import Ember from "ember"; const { getOwner } = Ember; export default Ember.Service.extend({ i18n: Ember.inject.service(), convert: function(values) { var offerId = values.offer.id; var msg = values.body; var url_with_text = msg.slice(msg.indexOf("[") + 1, msg.indexOf("]")); var url_text_begin = u...
import Ember from 'ember'; const { getOwner } = Ember; export default Ember.Service.extend({ i18n: Ember.inject.service(), convert: function(values) { var offerId = values.offer.id; var msg = values.body; var url_with_text = msg.slice(msg.indexOf("[") + 1, msg.indexOf("]")); var url_text_begin = u...
Add python_requires to help pip When old Python versions are dropped, this will help pip install the right version for people still running those old Python versions. For more info on how this works: * https://hackernoon.com/phasing-out-python-runtimes-gracefully-956f112f33c4 * https://github.com/pypa/python-pac...
import sys import os from os.path import join from setuptools import setup # Also in twarc.py __version__ = '1.4.0' if sys.version_info[0] < 3: dependencies = open(join('requirements', 'python2.txt')).read().split() else: dependencies = open(join('requirements', 'python3.txt')).read().split() if __name__ ==...
import sys import os from os.path import join from setuptools import setup # Also in twarc.py __version__ = '1.4.0' if sys.version_info[0] < 3: dependencies = open(join('requirements', 'python2.txt')).read().split() else: dependencies = open(join('requirements', 'python3.txt')).read().split() if __name__ ==...
Fix fucking creazy bug :((((
<?php namespace Morilog\Acl\Console\Commands; use Illuminate\Console\Command; use Illuminate\Contracts\Config\Repository; use Morilog\Acl\Managers\Interfaces\RoleManagerInterface; class AddDefaultRoles extends Command { protected $signature = 'morilog:acl:add-roles'; protected $description = 'Insert default ...
<?php namespace Morilog\Acl\Console\Commands; use Illuminate\Console\Command; use Illuminate\Contracts\Config\Repository; use Morilog\Acl\Managers\Interfaces\RoleManagerInterface; class AddDefaultRoles extends Command { protected $signature = 'morilog:acl:add-roles'; protected $description = 'Insert default ...
Fix location coordinate field naming
module.exports = (function() { var config = require('config'); var mongoose = require('mongoose'); var db = mongoose.connection; var schemas = {}; var eventSchema = new mongoose.Schema({ 'category': String, 'coordinates': { 'latitude': Number, 'longitude': Number }, 'name': Strin...
module.exports = (function() { var config = require('config'); var mongoose = require('mongoose'); var db = mongoose.connection; var schemas = {}; var eventSchema = new mongoose.Schema({ 'category': String, 'coordinates': { 'latitude': Number, 'longitude': Number }, 'name': Strin...
Remove Textarea Label, Use Frig Version Instead
let React = require("react") let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js") let {div, textarea} = React.DOM let cx = require("classnames") export default class extends React.Component { static displayName = "Frig.friggingBootstrap.Text" static defaultProps = Object.assign(require(".....
let React = require("react") let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js") let {div, textarea} = React.DOM let cx = require("classnames") export default class extends React.Component { static displayName = "Frig.friggingBootstrap.Text" static defaultProps = Object.assign(require(".....
Comment how to port to new Base64 encoder in Java 8 and 9
package net.bettyluke.tracinstant.data; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import net.bettyluke.tracinstant.prefs.SiteSettings; public final class AuthenticatedHttpRequester { private AuthenticatedHttpRequester() {} public static Input...
package net.bettyluke.tracinstant.data; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import net.bettyluke.tracinstant.prefs.SiteSettings; public final class AuthenticatedHttpRequester { private AuthenticatedHttpRequester() {} public static Input...
Change port and do make clean build
const path = require('path'); const merge = require('webpack-merge'); const exec = require('child_process').exec; const FilewatcherPlugin = require('filewatcher-webpack-plugin'); const WatchPlugin = require('webpack-watch-files-plugin').default; const ShellPlugin = require('webpack-shell-plugin'); const common = requir...
const path = require('path'); const merge = require('webpack-merge'); const exec = require('child_process').exec; const FilewatcherPlugin = require('filewatcher-webpack-plugin'); const WatchPlugin = require('webpack-watch-files-plugin').default; const ShellPlugin = require('webpack-shell-plugin'); const common = requir...
Add default step for setting (per hour)
<?php return [ 'App\Models\Business' => [ 'start_at' => ['type' => 'time', 'value' => '08:00:00'], 'finish_at' => ['type' => 'time', 'value' => '19:00:00'], 'show_map' => ['type' => 'bool', 'value' => false], 'show_postal...
<?php return [ 'App\Models\Business' => [ 'start_at' => ['type' => 'time', 'value' => '08:00:00'], 'finish_at' => ['type' => 'time', 'value' => '19:00:00'], 'show_map' => ['type' => 'bool', 'value' => false], 'show_postal...
Fix defaults for undefined options
'use strict'; var chalk = require('chalk'); var path = require('path'); function WebpackKarmaDieHardPlugin(options) { if (typeof(options) === "undefined") { options = {}; } chalk.enabled = options.colors !== false } WebpackKarmaDieHardPlugin.prototype.apply = function(compiler) { compiler.plugin('done', ...
'use strict'; var chalk = require('chalk'); var path = require('path'); function WebpackKarmaDieHardPlugin(options) { if (typeof(options) === undefined) { options = {}; } chalk.enabled = options.colors !== false } WebpackKarmaDieHardPlugin.prototype.apply = function(compiler) { compiler.plugin('done', fu...
Replace usage of Math.sqrt in with Math.log LogFontScalar.java was (erroneously?) using Math.sqrt instead of Math.log to compute the leftSpan.
package com.kennycason.kumo.font.scale; /** * Created by kenny on 6/30/14. */ public class LogFontScalar implements FontScalar { private final int minFont; private final int maxFont; public LogFontScalar(final int minFont, final int maxFont) { this.minFont = minFont; this.maxFont = maxF...
package com.kennycason.kumo.font.scale; /** * Created by kenny on 6/30/14. */ public class LogFontScalar implements FontScalar { private final int minFont; private final int maxFont; public LogFontScalar(final int minFont, final int maxFont) { this.minFont = minFont; this.maxFont = maxF...
Rename anonymous to make the styling more like others
/** * Helper functions that are used in the other modules to reduce the number of times * that code for common tasks is rewritten * * (c) 2013, Greg Malysa <gmalysa@stanford.edu> * Permission to use granted under the terms of the MIT License. See LICENSE for details. */ /** * Retrieves the name for a function, ...
/** * Helper functions that are used in the other modules to reduce the number of times * that code for common tasks is rewritten * * (c) 2013, Greg Malysa <gmalysa@stanford.edu> * Permission to use granted under the terms of the MIT License. See LICENSE for details. */ /** * Retrieves the name for a function, ...
Fix import of 'reverse' for Django>1.9
from django import VERSION as DJANGO_VERSION from django import template from django.conf import settings if DJANGO_VERSION[0] == 1 and DJANGO_VERSION[1] <= 9: from django.core.urlresolvers import reverse else: from django.urls import reverse register = template.Library() @register.simple_tag(takes_context=T...
from django import template from django.conf import settings from django.core.urlresolvers import reverse register = template.Library() @register.simple_tag(takes_context=True) def active_link(context, viewname, css_class=None, strict=None): """ Renders the given CSS class if the request path matches the pat...
Use the app string version of foreign keying. It prevents a circular import.
from django.db import models class Activity(models.Model): group = models.CharField(max_length=4) grouptype = models.TextField() groupdetail = models.TextField() details = models.TextField() disabled = models.BooleanField() time = models.DecimalField(decimal_places=2, max_digits=10) unique_...
from django.db import models class Activity(models.Model): group = models.CharField(max_length=4) grouptype = models.TextField() groupdetail = models.TextField() details = models.TextField() disabled = models.BooleanField() time = models.DecimalField(decimal_places=2, max_digits=10) unique_...
[fix] Use middleware db for the query
<?php use Hubzero\Content\Migration\Base; /** * Migration script for com_tools to specify display ranges assigned to a hub, * i.e., the range used on an execution host. **/ class Migration20180703151011ComTools extends Base { /** * Up **/ public function up() { if (!$mwdb = $this->getMWDBO()) { $t...
<?php use Hubzero\Content\Migration\Base; /** * Migration script for com_tools to specify display ranges assigned to a hub, * i.e., the range used on an execution host. **/ class Migration20180703151011ComTools extends Base { /** * Up **/ public function up() { if (!$mwdb = $this->getMWDBO()) { $t...
BLD: Add support for *.pyi data-files to `np.testing._private`
#!/usr/bin/env python3 def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('testing', parent_package, top_path) config.add_subpackage('_private') config.add_subpackage('tests') config.add_data_files('*.pyi') config.add_...
#!/usr/bin/env python3 def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('testing', parent_package, top_path) config.add_subpackage('_private') config.add_subpackage('tests') config.add_data_files('*.pyi') return conf...
Cut fbcode_builder dep for thrift on krb5 Summary: [Thrift] Cut `fbcode_builder` dep for `thrift` on `krb5`. In the past, Thrift depended on Kerberos and the `krb5` implementation for its transport-layer security. However, Thrift has since migrated fully to Transport Layer Security for its transport-layer security and...
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import specs.folly as folly import specs.fizz as fizz import specs.rsocket as rsocket import spec...
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import specs.folly as folly import specs.fizz as fizz import specs.rsocket as rsocket import spec...
bracket-push: Add test for proper nesting This rules out solutions that simply count the number of open/close brackets without regard for whether they are properly nested. I submitted a solution (in another language track) that would have failed this test and did not realize it until looking at others' solutions. It ...
var bracket = require('./bracket_push'); describe('bracket push', function() { it('checks for appropriate bracketing in a set of brackets', function() { expect(bracket('{}')).toEqual(true); }); xit('returns false for unclosed brackets', function() { expect(bracket('{{')).toEqual(false); }); xit('re...
var bracket = require('./bracket_push'); describe('bracket push', function() { it('checks for appropriate bracketing in a set of brackets', function() { expect(bracket('{}')).toEqual(true); }); xit('returns false for unclosed brackets', function() { expect(bracket('{{')).toEqual(false); }); xit('re...
Make jpeg extension allowed for image component
export function isImageURL(url) { return (/^http.+(jpg|gif|png|svg|jpeg)$/i).test(url || ""); } export function checkStatus(response) { if (response.status >= 200 && response.status < 300) { return response; } const error = new Error(response.statusText); error.response = response; ret...
export function isImageURL(url) { return (/^http.+(jpg|gif|png|svg)$/i).test(url || ""); } export function checkStatus(response) { if (response.status >= 200 && response.status < 300) { return response; } const error = new Error(response.statusText); error.response = response; return r...
Fix weird terminal output format Signed-off-by: Lei Jitang <9ac444d2b5df3db1f31aa1c6462ac8e9e2bde241@huawei.com>
// +build linux,cgo package term import ( "syscall" "unsafe" ) // #include <termios.h> import "C" type Termios syscall.Termios // MakeRaw put the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. func MakeRaw(fd uintptr)...
// +build linux,cgo package term import ( "syscall" "unsafe" ) // #include <termios.h> import "C" type Termios syscall.Termios // MakeRaw put the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. func MakeRaw(fd uintptr)...
Handle empty values for FieldtypeDatetime.
<?php namespace ProcessWire\GraphQL\Field\Traits; use Youshido\GraphQL\Config\Field\FieldConfig; use Youshido\GraphQL\Execution\ResolveInfo; use Youshido\GraphQL\Field\InputField; use Youshido\GraphQL\Type\Scalar\StringType; use ProcessWire\GraphQL\Utils; use ProcessWire\NullPage; use ProcessWire\FieldtypeDatetime; ...
<?php namespace ProcessWire\GraphQL\Field\Traits; use Youshido\GraphQL\Config\Field\FieldConfig; use Youshido\GraphQL\Execution\ResolveInfo; use Youshido\GraphQL\Field\InputField; use Youshido\GraphQL\Type\Scalar\StringType; use ProcessWire\GraphQL\Utils; use ProcessWire\NullPage; use ProcessWire\FieldtypeDatetime; ...
Remove spl converter, was only an experiment with Gangnam Style.
var abc = require('./converters/abc'), fs = require('fs'), p = require('path'), converters = { abc: abc }; function Playlist() { this.songs = []; } Playlist.prototype.load = function (dir) { var files = fs.readdirSync(dir), self = this; files.forEach(function (file) { console.log('Converting %s',...
var abc = require('./converters/abc'), fs = require('fs'), p = require('path'), spl = require('./converters/spl'), converters = { abc: abc, spl: spl }; function Playlist() { this.songs = []; } Playlist.prototype.load = function (dir) { var files = fs.readdirSync(dir), self = this; files.forEach(fun...
[Discord] Use string methods for encode and decode caesar functions To determine (in)valid characters to encode and decode
def encode_caesar(message, key): encoded_message = "" for character in message: if not character.isalpha() or not character.isascii(): encoded_message += character continue shifted = ord(character) + int(key) if character.islower() and shifted > ord('z') or character.isupper() and shifted > ord('Z'): ...
def encode_caesar(message, key): encoded_message = "" for character in message: if not ('a' <= character <= 'z' or 'A' <= character <= 'Z'): # .isalpha() ? encoded_message += character continue shifted = ord(character) + int(key) if character.islower() and shifted > ord('z') or character.isupper() and sh...
Change readme to md to match.
#!/usr/bin/env python from setuptools import setup, find_packages import re # get version from __init__.py INITFILE = "toytree/__init__.py" CUR_VERSION = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", open(INITFILE, "r").read(), re.M).group(1) # run setup setup( name="to...
#!/usr/bin/env python from setuptools import setup, find_packages import re # get version from __init__.py INITFILE = "toytree/__init__.py" CUR_VERSION = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", open(INITFILE, "r").read(), re.M).group(1) # run setup setup( name="to...
Fix lang entries on emailer sub_nav
<ul class="nav nav-pills"> <li <?php echo $this->uri->segment(4) == '' ? 'class="active"' : '' ?>> <a href="<?php echo site_url(SITE_AREA .'/settings/emailer') ?>"><?php echo lang('bf_context_settings'); ?></a> </li> <li <?php echo $this->uri->segment(4) == 'template' ? 'class="active"' : '' ?>> <a href="<?php e...
<ul class="nav nav-pills"> <li <?php echo $this->uri->segment(4) == '' ? 'class="active"' : '' ?>> <a href="<?php echo site_url(SITE_AREA .'/settings/emailer') ?>"><?php echo lang('bf_context_settings'); ?></a> </li> <li <?php echo $this->uri->segment(4) == 'template' ? 'class="active"' : '' ?>> <a href="<?php e...
Update use composer install of twitterOaUth
<?php require "vendor/autoload.php"; use Abraham\TwitterOAuth\TwitterOAuth; require_once('twitterbotclass.php'); set_time_limit(0); ignore_user_abort(); function run($tweets){ global $bot; foreach($tweets->statuses as $tweet){ if(!$bot->inblacklist($tweet->user->id_str)){ ...
<?php require_once('twitteroauth-master/twitteroauth/twitteroauth.php'); require_once('twitterbotclass.php'); set_time_limit(0); ignore_user_abort(); function run($tweets){ global $bot; foreach($tweets->statuses as $tweet){ if(!$bot->inblacklist($tweet->user->id_str)){ ...
Fix secondary display toast placement on Android 11
/* Copyright 2017 Braden Farmer * * 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 i...
/* Copyright 2017 Braden Farmer * * 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 i...
Move construction method accessor to interface.
/* Copyright © 2016 Matthew Champion All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the follow...
/* Copyright © 2016 Matthew Champion All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the follow...
Move API key to environment variable
from os import environ import unittest import googlemaps from pyrules2.googlemaps import driving_roundtrip COP = 'Copenhagen, Denmark' MAD = 'Madrid, Spain' BER = 'Berlin, Germany' LIS = 'Lisbon, Portugal' KM = 1000 class Test(unittest.TestCase): def setUp(self): try: key = environ['GOOGLE_M...
import unittest import googlemaps from pyrules2.googlemaps import driving_roundtrip COP = 'Copenhagen, Denmark' MAD = 'Madrid, Spain' BER = 'Berlin, Germany' LIS = 'Lisbon, Portugal' KM = 1000 class Test(unittest.TestCase): def setUp(self): # TODO: Sane way to import key with open('/Users/nhc/gi...
Add logging to script test
from gevent import monkey monkey.patch_all() # noqa import sys import time from ethereum import slogging from raiden.network.transport import UDPTransport from raiden.network.sockfactory import socket_factory class DummyProtocol(object): def __init__(self): self.raiden = None def receive(self, da...
from gevent import monkey monkey.patch_all() # noqa import sys import time from raiden.network.transport import UDPTransport from raiden.network.sockfactory import socket_factory class DummyProtocol(object): def __init__(self): self.raiden = None def receive(self, data): print data if __...