Skip to content

Instantly share code, notes, and snippets.

View patrickandre's full-sized avatar

Patrick patrickandre

  • NYC
View GitHub Profile
body {
width: 422px;
border: 1px solid green;
}
p:first-child {
border: 2px solid blue;
float: left;
width: 100px;
}
body {
width: 422px;
border: 1px solid green;
}
p:first-child {
border: 2px solid blue;
float: left;
width: 100px;
}
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@patrickandre
patrickandre / gist:3715142
Created September 13, 2012 15:36
html: html5 template
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
@patrickandre
patrickandre / ST2 Shortcuts
Created September 13, 2012 15:38 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| *⌘T* | go to file |
| *⌘⌃P* | go to project |
| *⌘R* | go to methods |
| *⌃G* | go to line |
| *⌘KB* | toggle side bar |
| *⌘⇧P* | command prompt |
index page...
@patrickandre
patrickandre / styles.css
Created September 13, 2012 16:07
style default
body {
color: #000;
background-color: #fff;
}
@patrickandre
patrickandre / core.test.js
Created October 11, 2012 19:20 — forked from drewwells/core.test.js
RequireJS and QUnit sitting in a tree
//Wait for relevant code bits to load before starting any tests
define(['core.js'], function( core ) {
module("Core Tests");
test("Test core methods", function(){
expect(2);
equals( 1, 1, "A trivial test");
ok( true, "Another trivial test");
});
window.NR = window.NR || {};
window.NR.myModule = (function () {
"use strict";
function initialize() {
// your initialization code here
}
function anotherMethod() {
// its function body here