Skip to content

Instantly share code, notes, and snippets.

View caseypugh's full-sized avatar
🤡
🤡🤡🤡🤡🤡🤡🤡🤡🤡

CPU caseypugh

🤡
🤡🤡🤡🤡🤡🤡🤡🤡🤡
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Generates Gource config file from git submodules, starts Gource.
# Place to /usr/local/bin and run at the main repository root.
#
# (c) 2010 Mikael Lammentausta
# License is the same as Gource (GPLv3)
import os
import re
@jamiew
jamiew / pimp_prompt.sh
Created January 21, 2011 17:55
put this in your .bashrc/.bash_profile... works with both git and svn
parse_git_branch() {
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return
printf "${1:-(%s)}" "${ref#refs/heads/}"
}
parse_svn_revision() {
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //')
[ "$REV" ] || return
[ "$(svn st)" ] && DIRTY=' *'
echo "(r$REV$DIRTY)"
@caseypugh
caseypugh / gifplayer.as
Created September 23, 2011 18:26
GIFPlayer - How to resize an animated GIF
// See http://www.bytearray.org/?p=95
// Insert into GIFPlayer.as
import flash.geom.Rectangle;
public function resize(w:Number, h:Number):void
{
for (var i = 0; i < aFrames.length; i++) {
aFrames[i].resize(w, h);
}
}
@caseypugh
caseypugh / vhx_hipchat.php
Created November 22, 2011 23:17
Send your VHX shares to HipChat
<?
///
// Sample usage:
// php vhx_hipchat.php staff myroom authtoken
//
// Screenshot: http://sht.tl/xeT
//
$vhx_user = $argv[1]; // staff
@vlado
vlado / gist:1877457
Last active April 3, 2018 08:36
Postgres on macos or OSX - Fix
# ** ERROR 1 **
# FATAL: lock file "postmaster.pid" already exists
# HINT: Is another postmaster (PID 4646) running in data directory "/usr/local/var/postgres"?
#
# ** ERROR 2 **
# Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
#
# To fix one of this errors:
cat /usr/local/var/postgres/postmaster.pid # pid is the number on first line
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@jayrobinson
jayrobinson / flag.html
Created May 29, 2012 19:51
An American Flag Made with CSS
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>An American Flag Made with CSS</title>
<meta name="author" content="Jay Robinson, http://jayrobinson.org">
<style type="text/css">
class ApplicationController
after_filter :set_access_control_headers
def set_access_control_headers
# Any domain
# headers['Access-Control-Allow-Origin'] = '*'
# Specific domain
@caseypugh
caseypugh / vhx-asana-theme.css
Created July 15, 2012 18:03
A dark CSS theme for Asana
body {
background: #191919 !important;
font-family: Arial !important;
}
#project_header { background: #fff !important; }
#header {
background: #191919 url('http://vhx.tv/images/vhx-logo-crystal.png') 25px 60px no-repeat !important;
padding-top: 20px !important;
height: 120px;
@AngryAnt
AngryAnt / Build.sh
Created September 30, 2012 07:21
Example code for "Downloading the hydra" blog post on AngryAnt.com
mcs -target:library -out:MyAssembly.dll -r:/Applications/Unity/Unity.app/Contents/Frameworks/UnityEngine.dll MyAssembly.cs