Skip to content

Instantly share code, notes, and snippets.

View frockenstein's full-sized avatar

Jason Finneyfrock frockenstein

View GitHub Profile
@frockenstein
frockenstein / test.html
Created March 8, 2012 15:48
HTML: Template
<!DOCTYPE html>
<head>
<title>test</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(function() {
});
@frockenstein
frockenstein / global.js
Created March 8, 2012 15:53
JS: Global Pub Sub
var global = {
// pub sub lifted from http://jsperf.com/pub-sub-implementations/13
cache: {},
publish: function(topic, args) {
var self = this;
if (self.cache[topic]) {
var currentCache = self.cache[topic],
currentArgs = args || [];
@frockenstein
frockenstein / tricks.css
Created March 8, 2012 15:59
CSS: Tricks
/* image replacement in lieu of text-indent */
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@frockenstein
frockenstein / codetests
Created June 20, 2012 15:15
Code Tests
// C#
int totalrows = 1000;
int processed = 0;
while (processed < totalrows)
{
processRow();
// bug: infinite loop - we never increment processed var
}
// SqlClient
@frockenstein
frockenstein / .profile
Created August 13, 2012 13:20
profile
alias ..="cd .."
alias st="git status"
alias flush='dscacheutil -flushcache && echo "cache flushed"'
alias bs='git cia "bs"'
alias df='git diff --color --color-words --abbrev'
alias restart='sudo apachectl -k restart && echo "apache restarted"'
alias tit=git
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
// linqpad example
void Main()
{
Car.Go();
Honda accord = new Honda("accord");
Honda.Go(); // throws an error here - ref to non-static method
}
public class Car
{
@frockenstein
frockenstein / trycatch.php
Created April 3, 2013 12:38
php try catch
<?php
$start = microtime(true);
$loops = 10000000;
$herpes = new stdClass;
for ($i = 0; $i < $loops; $i++) {
try {
$herpes->mouthsores = true;
@frockenstein
frockenstein / GreasemonkeyUpload.js
Last active December 17, 2015 13:49
Greasemonkey Image Upload
// ==UserScript==
// @name test upload
// @namespace namespace
// @description description
// @include https://post.craigslist.org/*
// @version 1
// @grant all
// ==/UserScript==
$ = unsafeWindow.jQuery;