This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @date 2017-09-26 | |
* @file CacheAwareGeocoder.php | |
* @author Patrick Mac Gregor <[email protected]> | |
*/ | |
namespace Dreipc\Geocoder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Redmine hide useless colors | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author pmg | |
// @include https://redmine.3pc.de* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests; | |
use GuzzleHttp\Client; | |
use GuzzleHttp\HandlerStack; | |
use GuzzleHttp\Handler\MockHandler; | |
use GuzzleHttp\Middleware; | |
use GuzzleHttp\Psr7\Response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://tc39.github.io/ecma262/#sec-array.prototype.includes | |
if (!Array.prototype.includes) { | |
Object.defineProperty(Array.prototype, 'includes', { | |
value: function(searchElement, fromIndex) { | |
if (this == null) { | |
throw new TypeError('"this" is null or not defined') | |
} | |
// 1. Let O be ? ToObject(this value). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof Object.assign !== 'function') { | |
Object.assign = function(target) { | |
'use strict' | |
if (target == null) { | |
throw new TypeError('Cannot convert undefined or null to object') | |
} | |
target = Object(target) | |
for (var index = 1; index < arguments.length; index++) { | |
var source = arguments[index] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor: AcceptanceTester | |
modules: | |
enabled: | |
- \Helper\Acceptance | |
- WebDriver: | |
host: phantomjs | |
#host: localhost | |
port: 8910 | |
#port: 4444 | |
#url: 'http://localhost:8080' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# @Author: Patrick Mac Gregor | |
# @Date: 2018-05-24 | |
# @Last Modified by: Patrick Mac Gregor | |
# @Last Modified time: 2018-05-24 | |
import sys | |
from jinja2 import Template | |
from inspect import cleandoc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no <USER>@<HOST> lxc exec <CONTAINER_NAME> -- sudo -u www-data -I <PATH-TO-REMOTE-DEPLOY-SH> $REVISION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First you need to make sure that “foo” is listening to the network and has a password set, so get a remote shell on it and run: | |
lxc config set core.https_address [::]:8443 | |
lxc config set core.trust_password something-secure | |
# Now on your local LXD, we just need to make it visible to the network so we can transfer containers and images from it: | |
lxc config set core.https_address [::]:8443 | |
# Now that the daemon configuration is done on both ends, you can add “foo” to your local client with: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myArray | |
.map(item => { | |
// ... | |
}) | |
// Get rid of bad values | |
.filter(Boolean); |