Skip to content

Instantly share code, notes, and snippets.

View funkatron's full-sized avatar

Ed Finkler funkatron

View GitHub Profile
@ralphschindler
ralphschindler / README.md
Last active September 30, 2023 19:28
Docker For Mac Host Address Alias To Enable PHP XDebug (10.254.254.254 Trick)

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.

Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host.

Installation Of IP Alias (This survives reboot)

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

@ikwattro
ikwattro / bash.sh
Last active August 29, 2015 14:21
Simple sed script to deactivate neo4j auth
#!bin/bash
sed -i.bak 's/^\(dbms\.security\.auth_enabled=\).*/\1false/' ./conf/neo4j-server.properties
body {
font-family: "Pet Me", monospace;
font-size: .9em;
}
.color_block {
float:left; width:100px; height:100px; padding:10px;
}
@funkatron
funkatron / xdebug_codebug_setup.txt
Last active September 8, 2016 19:21
Settings for XDebug and Codebug so PHP debugging actually fucking works
Codebug config======================
Paths
LOCAL REMOTE
/local/path/to/php/app /server/path/to/php/app
xdebug config=======================
root@ed:/vagrant/projects/acp/frontend/app# more /etc/php5/fpm/conf.d/20-xdebug.ini
; configuration for php xdebug module
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
<?php
// generate skip values
$skips = array();
for ($x=0; $x < 900; $x++) {
$skips[] = $x;
}
$skip = $skips[array_rand($skips)];
@tanob
tanob / gist:945821
Created April 28, 2011 04:46
AppleScript to open a new tab in iTerm2 from Finder
-- Stefan van den Oord, 2010-12-29
-- The "cd to" command for iTerm2
-- Original from: http://code.google.com/p/iterm2/wiki/AppleScript
-- Modified to open a new tab instead of a new window
tell application "Finder"
set _cwd to POSIX path of ((folder of (front window)) as alias)
end tell
tell application "iTerm"
@funkatron
funkatron / spaz_api_methods.txt
Created March 29, 2011 03:45
Simple docs for Spaz Web APIs
# https://github.com/funkatron/Spaz-Web-APIs
#
# Avatar methods
#
# basic structure
# http://api.getspaz.com/avatar/:service/:username.:format
# :service is currently "identi.ca" or "twitter.com"
# :username is the username
# :format is "json", "xml" or "js" (jsonp. sorta). JSON is default
#
@clayhinson
clayhinson / update_frapi_core.sh
Created March 17, 2011 18:37
updates frapi core while preserving a symlink to a self-managed custom/ folder
#!/bin/bash
#assumes working copy is a fork & upstream is set to git@github.com:frapi/frapi.git
# temporarily move custom symlink
mv src/frapi/custom src/frapi/custom_symlink &&
# reset any changes (i.e. deletion of custom folder)
git reset --hard &&
@StanAngeloff
StanAngeloff / yoke.js
Created February 23, 2011 15:50
A drop-in, quick and dirty alternative to Sprockets
#!/usr/bin/env node
var fs = require('fs'),
path = require('path'),
options = {
verbose: false,
directories: ['.']
};
var includeFollowing = false;