Skip to content

Instantly share code, notes, and snippets.

View dmyers's full-sized avatar

Derek Myers dmyers

View GitHub Profile
@duanecilliers
duanecilliers / wp-bootstrap-walker-class.php
Created February 13, 2012 14:45
Extended Walker Class for Twitter Bootsrap Navigation Wordpress Integration
<?php
class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_lvl( &$output, $depth ) {
//In a child UL, add the 'dropdown-menu' class
$indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class=\"dropdown-menu\">\n";
@nanobox-io
nanobox-io / gist:1756086
Last active September 30, 2015 08:58
Deploy Hook Available Executables
awk
bunzip2
bzcat
bzip2
cat
chown
cp
curl
cut
date
@boucher
boucher / gist:1750368
Created February 6, 2012 07:07 — forked from saikat/gist:1084146
Stripe sample checkout form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">
@ziadoz
ziadoz / awesome-php.md
Last active May 8, 2025 07:37
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts
@joshthewhite
joshthewhite / jquery.timedbind.js
Created December 5, 2011 19:23
Timed Bind Plugin for JQuery
/**
* Attaches a handler to an event the fires after a given time interval.
*
* Usage:
* $('input[type="text"]').timedBind('keyup', function (e) {
* var $el = $(e.target);
* alert($el.val());
* });
*/
(function($) {
@avargas
avargas / gist:1356141
Created November 10, 2011 20:40
MongoDB Tail (Graylog2 messages)
<?php
function bash_color($string, $color='white', $background='black') {
$colored_string = "";
$_color['black'] = '0;30';
$_color['dark_gray'] = '1;30';
$_color['blue'] = '0;34';
$_color['light_blue'] = '1;34';
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@Andrzej
Andrzej / bson2sql.rb
Created October 10, 2011 19:16
Convert BSON file into SQL, useful for fast copy data from MongoDB to MySQL (mongodump => bson2sql => import to mysql)
require "bson"
def make_insert(table_name, bson)
columns = ["id",*bson["value"].keys] * ", "
values = ["'#{bson["_id"]}'",*bson["value"].values.map{|value| value.is_a?(Numeric) ? value : "'#{value}'"}] * ", "
return "insert into #{table_name} (#{columns}) values (#{values});"
end
file_name = ARGV.first
file=File.new(file_name)
@defunkt
defunkt / gitio
Created September 11, 2011 08:11
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]