Skip to content

Instantly share code, notes, and snippets.

@roxlu
roxlu / Blur.cpp
Created November 25, 2012 22:21
Blur shader 2 passing, ping pong attachments
#include <Blur.h>
#define ASSERT_BLUR_SETUP() { \
if(!is_setup) { \
printf("ERROR: not setup.\n"); \
return; \
} \
}
Blur::Blur()
@johnpolacek
johnpolacek / responsive-viewport
Created November 16, 2012 18:57
Responsive Viewport
<script language="javascript">
// set viewport to zoom to 1200px wide on viewports > 640px wide
var viewPortTag = document.createElement('meta');
viewPortTag.id = 'viewport';
viewPortTag.name = 'viewport';
if (screen.width > 640) {
viewPortTag.content = 'width=1200';
} else {
viewPortTag.content = 'width=device-width';
}
@buchanansc
buchanansc / Custom.css
Created September 11, 2012 01:07
Custom.css - WebKit Inspector styles for Google Chrome
/**
* Custom.css
* WebKit Inspector styles for Google Chrome
*
* by Scott Buchanan <[email protected]>
* http://wafflesnatcha.github.com
*
* Fugue Icons by Yusuke Kamiyamane
* http://p.yusukekamiyamane.com
*/
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 30, 2025 00:48
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@tony4d
tony4d / p4merge4git.md
Created August 24, 2012 19:00
Setup p4merge as a visual diff and merge tool for git
@subelsky
subelsky / casperjs_example.js
Created August 8, 2012 18:51
Webscraping with CasperJS, PhantomJS, jQuery, and XPath
var system = require('system');
if (system.args.length < 5) {
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code.");
phantom.exit();
}
var account = system.args[1];
var username = system.args[2];
var password = system.args[3];
@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@esilvas
esilvas / mountain-lion-brew-setup.markdown
Created July 30, 2012 00:24 — forked from myobie/mountain-lion-brew-setup.markdown
Fix Homebrew after Mountain Lion Upgrade

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@varemenos
varemenos / getparam.js
Created April 29, 2012 03:50 — forked from alkos333/gist:1771618
JQuery - GET URL Parameter value
// Given a query string "?to=email&why=because&first=John&Last=smith"
// getUrlVar("to") will return "email"
// getUrlVar("last") will return "smith"
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}