Skip to content

Instantly share code, notes, and snippets.

View TexRx's full-sized avatar
🏠
Working from home

Bobbie Tables TexRx

🏠
Working from home
View GitHub Profile
@TexRx
TexRx / gist:2010372
Created March 10, 2012 05:35
HTML: Starting Template
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
</body>
@TexRx
TexRx / gist:2010430
Created March 10, 2012 05:39
CSS: Image Replacement
/* image replacement technique */
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@TexRx
TexRx / gist:2010435
Created March 10, 2012 05:44
JavaScript: PubSub
/* @paul_irish Pub/Sub
Works in modern browsers + IE9
Use Modernizr ployfill for function.bind */
var o = $( {} );
$.subscribe = o.on.bind(o);
$.unsubscribe = o.off.bind(o);
$.publish = o.trigger.bind(o);
@TexRx
TexRx / app.js
Created March 19, 2012 18:32 — forked from pixelhandler/app.js
Develop a RESTful API Using Node.js With Express and Mongoose - See: http://pixelhandler.com/blog/2012/02/09/develop-a-restful-api-using-node-js-with-express-and-mongoose/
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
@TexRx
TexRx / mercurial.ini
Created March 22, 2012 17:54
Hg: Default Configuration
# Generated by TortoiseHg setting dialog
[ui]
editor = notepad
username = <username and email here>
ignore = ~/.hgignore
merge = beyondcompare3
#merge = diffmerge
[diff]
@TexRx
TexRx / urls.js
Created March 26, 2012 22:34
Node: Basic Template
var mongoose = require('mongoose');
module.exports = {
}
@TexRx
TexRx / gist:2221053
Created March 27, 2012 22:35 — forked from shripadk/gist:652819
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@TexRx
TexRx / OpenFolderWithSublime.reg
Created March 30, 2012 02:21
REG: Open With Sublime
Windows Registry Editor Version 5.00
// adds a registry entry to add a right-click context menu-option
// for a folder so that you can open the folder (it's contents) in sublime in folder view
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\open_with_Sublime]
@="Open Folder With Sublime"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\open_with_Sublime\command]
@="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\" \"%1\""
@TexRx
TexRx / Get-SpecialPath.ps1
Created March 30, 2012 02:22
PS: Get-SpecialPath
# STEP 0: Declare input parameter
Param([switch]$AsDrive)
# STEP 1: Define hash for paths
$csidl = @{
"Personal" = 0x0005;
"LocalAppData" = 0x001c;
"InternetCache" = 0x0020;
"Cookies" = 0x0021;
"History" = 0x0022;
@TexRx
TexRx / gist:2772809
Created May 23, 2012 01:54 — forked from karlseguin/gist:2724327
Collects all the IDs and classes from a given element down (like document.body)
function scan(parent) {
var found = {classes: {}, ids: []};
var unexamined = [parent];
while (unexamined.length > 0) {
parent = unexamined.pop();
var nodeLength = parent.childNodes.length;
for(var i = 0; i < nodeLength; ++i) {
node = parent.childNodes[i];
if (node.nodeType != 1) { continue; }