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 May 1, 2024 19:14
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)...

@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
@zerowidth
zerowidth / paginated_collection.js
Created November 18, 2010 22:04
first whack at pagination with backbone.js
// includes bindings for fetching/fetched
PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
this.page = 1;
},
fetch: function(options) {
options || (options = {});
this.trigger("fetching");
@al3x
al3x / newpost.rb
Created April 22, 2009 23:50
Handy new post script for Jekyll blogs or similar
#!/usr/bin/env ruby
unless ARGV[0]
puts 'Usage: newpost "the post title"'
exit(-1)
end
date_prefix = Time.now.strftime("%Y-%m-%d")
postname = ARGV[0].strip.downcase.gsub(/ /, '-')
post = "/Users/al3x/src/al3x.github.com/_posts/#{date_prefix}-#{postname}.textile"
@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
<?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;