Skip to content

Instantly share code, notes, and snippets.

View booyaa's full-sized avatar
🏠
Dayjob

Mark Sta Ana booyaa

🏠
Dayjob
View GitHub Profile
@xtender
xtender / gist:4374641
Created December 25, 2012 18:24
Simple example for returning columns from column position #M to #N
with t_cols_M_to_N as (
select
x1.n
,x2.*
from
xmltable( 'for $r in /ROWSET/*
return $r'
passing
dbms_xmlgen.getxmltype(
-- you can change query here:
@amatsuda
amatsuda / gist:4158531
Created November 28, 2012 01:44
headers, cookies, and params usage in my controllers
% rake stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 4327 | 3478 | 110 | 361 | 3 | 7 |
| Helpers | 384 | 331 | 0 | 35 | 0 | 7 |
| Models | 2912 | 2177 | 84 | 226 | 2 | 7 |
| Libraries | 281 | 230 | 8 | 39 | 4 | 3 |
| Model specs | 3096 | 2663 | 0 | 0 | 0 | 0 |
| Controller specs | 1005 | 783 | 0 | 3 | 0 | 259 |
@ekashida
ekashida / trello-poller.js
Created November 2, 2012 17:11
trello progress poller for google drive spreadsheets
/*global UrlFetchApp:true,Utilities:true,SpreadsheetApp:true*/
var KEY = <API_KEY>,
TOKEN = <TOKEN>,
BOARD = <BOARD_ID>,
BLACKLIST_RE = /stories/i; // list column names to ignore using regex alternation
function trelloFetch(request) {
'use strict';
var url = 'https://api.trello.com/1/' + request + '?key=' + KEY + '&token=' + TOKEN,
@jfautley
jfautley / gist:3945009
Created October 24, 2012 09:13 — forked from mdengler/gist:3944990
fixperms.sh
awk -F: '($3 >= 1000) { printf("%s:%s:%s:%s\n", $1, $3, $4, $6) }' /etc/passwd | while read line; do
UNAME=$(echo $line | cut -d: -f1)
USERID=$(echo $line | cut -d: -f2)
GRPID=$(echo $line | cut -d: -f3)
HMDIR=$(echo $line | cut -d: -f4)
echo "Changing user [$UNAME] with home [$HMDIR] to [$USERID:$GRPID]"
#chown -R $USERID:$GRPID $HMDIR
done
@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@burin
burin / gist:3840737
Created October 5, 2012 16:06
Full screen web app in iPhone 5 (save to home screen)
<!-- standard viewport tag to set the viewport to the device's width
, Android 2.3 devices need this so 100% width works properly and
doesn't allow children to blow up the viewport width-->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<!-- width=device-width causes the iPhone 5 to letterbox the app, so
we want to exclude it for iPhone 5 to allow full screen apps -->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" />
<!-- provide the splash screens for iPhone 5 and previous -->
<link href="assets/splashs/splash_1096.png" rel="apple-touch-startup-image" media="(device-height: 568px)">
<link href="assets/splashs/splash_iphone_2x.png" rel="apple-touch-startup-image" sizes="640x960" media="(device-height: 480px)">
@creationix
creationix / .gitignore
Created August 8, 2012 18:56
ddns + nat forwarding
node_modules
secrets.js
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
@JerrySievert
JerrySievert / make
Created July 18, 2012 03:40
Redis on Raspberry Pi
jerry@pi:/tmp/redis-2.4.15$ make -j 2
cd src && make all
make[1]: Entering directory `/tmp/redis-2.4.15/src'
MAKE hiredis
MAKE jemalloc
make[2]: Entering directory `/tmp/redis-2.4.15/deps/hiredis'
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
checking for xsltproc... no
checking for gcc... gcc
checking whether the C compiler works... yes