Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?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"; |
awk | |
bunzip2 | |
bzcat | |
bzip2 | |
cat | |
chown | |
cp | |
curl | |
cut | |
date |
<!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"> |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
/** | |
* 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($) { |
<?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'; |
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
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) |
#!/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] |