Skip to content

Instantly share code, notes, and snippets.

@Zoramite
Zoramite / maintenance.sh
Created March 14, 2012 21:25
Git Maintenance Commands
# Verifies the connectivity and validity of the objects in the database
git fsck —unreachable
# Manage reflog information
git reflog expire —expire=0 —all
# Pack unpacked objects in a repository
git repack -a -d -l
# Prune all unreachable objects from the object database
@Zoramite
Zoramite / winstonLogLevel.js
Created March 8, 2012 20:29
Testing changing the level of logging on the default logger for winston.
var winston = require('winston');
winston.cli();
console.log('Winston at level %s', winston.level);
winston.level = 'warn';
console.log('Winston at level %s', winston.level);
@Zoramite
Zoramite / p2p.js
Created February 18, 2012 19:41
Example of using Node.js to parse P2PXML.com file.
// Usage: node p2p.js
var xml2object = require('xml2object'); // npm install xml2object
var filename = 'prosper.xml';
// Create a parser to look for Loan objects in the xml file
var parser = new xml2object(filename, ['Loan']);
// Handle any errors
@Zoramite
Zoramite / jquery.groupedAjax.js
Created February 14, 2012 21:17
jQuery ajax grouping with Deferred objects.
(function($){
var requests = {};
$(function(){
// Determine which data you need and call the getData()...
// Stubbing in some example data...
// This is a unique request and would make an ajax call
getData({
foo: 'bar'
@Zoramite
Zoramite / index1.htm
Created November 16, 2011 19:25
jQuery plugin definition with optional support for RequireJS
<!doctype html>
<html lang="en">
<head>
<title>Test Execute Order</title>
</head>
<body>
<script src="//requirejs.org/docs/release/1.0.1/minified/require.js"></script>
<script>
require.config({
@Zoramite
Zoramite / setenv.sh
Created November 8, 2011 18:11
Railo JVM JAVA_OPTS
JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx1424m -XX:MaxPermSize=512m -XX:NewSize=64m -XX:MaxNewSize=64m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC"; export JAVA_OPTS;
@Zoramite
Zoramite / bubbles.txt
Created September 30, 2011 16:16
Homemade Bubbles
Homemade Bubbles:
1 1/2 quarts of water
1/2 cup light corn syrup
1 cup liquid dish soap
Add water and corn syrup and stir until completely mixed. Slowly stir in dish soap. Store in an airtight container.
@Zoramite
Zoramite / index.cfm
Created August 21, 2011 00:40
cfscript missing { after if statement outputs text instead of parsing as component
<cfset test = createObject('component', 'test') />
<cfoutput>#test.test()#</cfoutput>
@Zoramite
Zoramite / index.cfm
Created August 13, 2011 02:46
Testing cfscript tag attribute override variables
<cfscript>
template = {
test: 'true'
};
include template="test.cfm";
writeDump(template); // Outputs: test.cfm
</cfscript>
@Zoramite
Zoramite / index.cfm
Created July 16, 2011 00:44
Railo Method Not Defined When Using Shared Scopes Test
<cfif not structKeyExists(application, 'openIDConsumer') or structKeyExists(url, 'reinit')>
<cfset application.openIDConsumer = createObject('java', 'org.openid4java.consumer.ConsumerManager', expandPath('./openid4java.jar')).init() />
</cfif>
<cfset openIDConsumer = application.openIDConsumer />
<cfset discoveries = openIDConsumer.discover('https://www.google.com/accounts/o8/id') />
<cfset discovered = openIDConsumer.associate(discoveries) />