Skip to content

Instantly share code, notes, and snippets.

View laustdeleuran's full-sized avatar

Laust Deleuran laustdeleuran

View GitHub Profile
@laustdeleuran
laustdeleuran / dabblet.css
Created August 8, 2012 15:58
Graph colors
.box {
overflow:hidden;
margin:2em;
border-bottom:1px solid #333;
width:1350px;
}
.graph {
float:left;
text-align:center;
height:100px;
@laustdeleuran
laustdeleuran / function-declaration.js
Created May 30, 2012 08:59
Function expressions vs Function declarations
// This is a function declaration
function foo(){};
@laustdeleuran
laustdeleuran / grids.css
Created March 8, 2012 09:17
Why I don't like grid systems
.grid-1{ width:4.167% }
.grid-2{ width:10.417% }
.grid-3{ width:16.667% }
.grid-4{ width:22.917% }
/* etc */
@laustdeleuran
laustdeleuran / one.js
Created March 1, 2012 09:52
Multi file gist
alert("hello world");
@laustdeleuran
laustdeleuran / snook-rem-example.css
Created February 21, 2012 22:17
Jonathan Snook og Snook.cas first REM example
html { font-size: 62.5%; }
body { font-size: 1.4rem; } /* =14px */
h1 { font-size: 2.4rem; } /* =24px */
/* From http://snook.ca/archives/html_and_css/font-size-with-rem */
@laustdeleuran
laustdeleuran / em-vs-rems-typography-module.css
Created February 21, 2012 22:05
Typographic module (simplified)
.entry {
margin: 0;
padding: 0;
overflow: hidden;
width: auto;
font-size: 1.5em;
line-height: 1.333333333333333em;
position: relative;
}
.entry .entry {
@laustdeleuran
laustdeleuran / em-inheritance.html
Created February 21, 2012 21:45
EM inheritance
<style>
body { font-size:62.5%; /* Resetting font size to around 10px to make working with EMs easier */ }
div { font-size:1.5em; }
</style>
<div>This text is 15px font size at the base zoom level, but
<div> this text will be around 22.5px at the base zoom level
(varying between 22px and 23px depending on the browser
you're using.</div>
</div>
@laustdeleuran
laustdeleuran / reference-scoped-func.js
Created February 6, 2012 16:57
Referencing scoped functions in the global namespace
(function(){
// Internal vars and functions
var s = 1,
t = 3,
internalFunction = function(){
return s+t;
},
externalFunction = function(){
return internalFunction();
};
@laustdeleuran
laustdeleuran / anon-function.js
Created February 6, 2012 16:53
Anonymous function
(function(){
// Safe, scoped JavaScript here. Phew.
})();
@laustdeleuran
laustdeleuran / scoped-vars.js
Created February 6, 2012 16:38
Scoped variables example
var globalScope = "I'm in the global scope";
var scopedFunction = function(){
var localScope = "I'm not in the global scope";
console.log(localScope);
};
console.log(globalScope);
// Outputs "I'm in the global scope"