Skip to content

Instantly share code, notes, and snippets.

@tbonemalone
tbonemalone / gist:2041859
Created March 15, 2012 04:26
css: image replacement
.ir {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@tbonemalone
tbonemalone / gist:2041923
Created March 15, 2012 04:35
st2-snippet: jquery cdn
<snippet>
<content><![CDATA[
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>jquery</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
@tbonemalone
tbonemalone / gist:2051193
Created March 16, 2012 17:10
st2-snippet: console.log
<snippet>
<content><![CDATA[
console.log($1);
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>log</tabTrigger>
</snippet>
@tbonemalone
tbonemalone / gist:2051529
Created March 16, 2012 18:01
html: base doc template
<! doctype html >
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="" />
</head>
@tbonemalone
tbonemalone / gist:2165036
Created March 22, 2012 22:17
django: import User
<snippet>
<content><![CDATA[
from django.contrib.auth.models import User
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>import user</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
@tbonemalone
tbonemalone / gist:2187257
Created March 24, 2012 19:49
javascript: remove commas from string of numbers
// simple remove commas from string of numbers
str.replace(/,?\s/, "");
@tbonemalone
tbonemalone / gist:2208322
Created March 26, 2012 18:14
php: turn on error reporting
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
?>
@tbonemalone
tbonemalone / gist:2223132
Created March 28, 2012 02:50
js: underscore-js-1.3.1
// Underscore.js 1.3.1
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore
(function() {
@tbonemalone
tbonemalone / gist:2233199
Created March 29, 2012 04:01
css: normalize.css
/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
/* =============================================================================
HTML5 display definitions
========================================================================== */
/*
* Corrects block display not defined in IE6/7/8/9 & FF3
*/
@tbonemalone
tbonemalone / gist:2501622
Created April 26, 2012 18:20
js: validate email
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\
".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA
-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}