This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="javascript:(function(){s=document.createElement('script');s.src='https://gist.github.com/raw/707529/bookmarklet.js?'+Math.random();document.body.appendChild(s);})();">Drag this to your bookmark bar</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.log = -> | |
log.history = log.history or [] | |
log.history.push arguments | |
if @console | |
arguments.callee = arguments.callee.caller | |
console.log Array::slice.call(arguments) | |
((b) -> | |
c = -> | |
d = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(",") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getExceptionTraceAsString(Exception $exception) | |
{ | |
$rtn = ''; | |
foreach ($exception->getTrace() as $count => $frame) | |
{ | |
$args = ''; | |
if (isset($frame['args'])) | |
{ | |
$args = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import httplib, urllib, sys, os, json | |
# Define the parameters for the POST request and encode them in | |
# a URL-safe format. | |
if len(sys.argv) <= 1: | |
print 'Usage: ' + sys.argv[0] + ' FILES...' | |
sys.exit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Simple shell script to copy a file to the Dropbox | |
# public folder and get its URL. | |
# | |
# The URL of the last file copied also stays on the | |
# X clipboard. | |
# | |
# Symlink the script as dropmv to move the file to the | |
# public folder instead of copying it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Demo</title> | |
</head> | |
<body> | |
<h1>PHP Mongo Test</h1> | |
<?php | |
$services = getenv("VCAP_SERVICES"); | |
echo "<h2>VCAP_SERVICES</h2>"; | |
echo "<p>" . $services . "</p>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all = {}; $('#vm-playlist-video-list-ol li').each(function(){ | |
var self = $(this), | |
id = self.attr('id').substring(9), | |
title = self.find('a.vm-video-title-content').text(), | |
url = self.find('a.vm-video-title-content').attr('href').split('&',1), | |
user = self.find('a.yt-user-name').text(), | |
time = self.find('.video-time').text(); | |
all[id] = { | |
id: id, | |
user: user, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
due to the open_basedir restriction, $tgtPath must be something like the following path param: | |
http://<your domain>.aws.af.cm/ls.php?path=/var/vcap.local/dea/apps/f-0-21341234123412abcdefgc75cc0f96b9/app/ | |
to discover what are the allowed paths, try supplying any path, e.g. '/' then view the error logs via: | |
af logs <your app name> | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
OlderNewer