Skip to content

Instantly share code, notes, and snippets.

Avatar

AlexanderAllen AlexanderAllen

  • New York, NY
View GitHub Profile
@AlexanderAllen
AlexanderAllen / bash-named-param
Created Jan 15, 2016 — forked from caruccio/bash-named-param
Named parameters in bash
View bash-named-param
# Do you like python named parameters (kvargs) ?
# Well, you can have it in bash too!!
$ function myfunc() { local $*; echo "foo=$foo, bar=$bar"; }
$ myfunc bar=world foo=hello
foo=hello, bar=world
View akamai_debug_headers.txt
Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no
View debug js
(function ($) {
Drupal.behaviors.nvc_hack = {
attach: function (context, settings) {
alert('attach working foo');
}
};
// Code to be run on page load, and
// on ajax load added here
@AlexanderAllen
AlexanderAllen / php.ini
Last active Apr 28, 2016
Enabling XDebug on Acquia Dev Desktop - WINDOWS 8.1 - php.ini for PHP 5.5.x
View php.ini
;zend_extension="C:\Program Files (x86)\DevDesktop\php5_5\ext\php_xdebug.dll"
; On windows the name of this thing is different from what suggested on the original .ini.
zend_extension="C:\Program Files (x86)\DevDesktop\php5_5\ext\php_xdebug-2.3.2-5.5-vc11.dll"
xdebug.cli_color=1
xdebug.idekey="DD"
xdebug.remote_host="localhost"
xdebug.remote_enable=1
@AlexanderAllen
AlexanderAllen / README.md
Created May 9, 2016 — forked from trinitronx/README.md
A shell script to install latest Ansible via pip + dependencies
View README.md

omnibus-ansible

Install latest Ansible via pip + dependencies via a shell script

This file is used to install ansible in test kitchen when you set in the kitchen.yaml file

require_ansible_omnibus: true

By default test kitchen will always download and use the latest version of this install file.

WARNING: AS SOON AS YOU MERGE CODE HERE IT IS INSTANTLY AVAILABLE TO EVERYONE DOING OMNIBUS KITCHEN ANSIBLE INSTALLS:

@AlexanderAllen
AlexanderAllen / README.md
Created Sep 22, 2016 — forked from ralphschindler/README.md
Docker (For Mac) De-facto Host Address Alias (10.254.254.254) - "The 10254 Trick".
View README.md

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254

Installation

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

sudo curl -o /Library/LaunchDaemons/com.ralphschindler.docker_10254_alias.plist https://gist.githubusercontent.com/ralphschindler/535dc5916ccbd06f53c1b0ee5a868c93/raw/com.ralphschindler.docker_10254_alias.plist
@AlexanderAllen
AlexanderAllen / 0_reuse_code.js
Created Nov 21, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View cache.ts
/**
* @file: cache.ts
*/
// Import levelup dependencies manually.
var levelup = require('levelup')
var leveljs = require('level-js')
var ttl = require('level-ttl')
// Instantiate store.
var db = levelup(leveljs('/tmp/mydb.db'))
View php7-cli.core:alpine-3.11.Dockerfile
FROM alexanderallen/php7-fpm.core:alpine-3.11 as core
ENV \
SSH_PRIVATE_KEY="/root/.ssh/id_rsa" \
LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8" \
LANGUAGE="en_US.UTF-8" \
TERM="xterm" \
# Register the COMPOSER_HOME environment variable.
COMPOSER_HOME=/composer \
View php7-cli.drush9:alpine-3.11.Dockerfile
#
# Build stage optimized with Composer packages for Drupal development.
#
FROM alexanderallen/php7-cli.core:alpine-3.11 as drush9
# Specifies which composer.json file to use for build.
ARG DRUSH_VERSION
RUN \
cd /tmp \
&& apk add --no-cache \
You can’t perform that action at this time.