Skip to content

Instantly share code, notes, and snippets.

@chrsr
chrsr / LICENSE.txt
Created October 19, 2011 02:52 — forked from p01/LICENSE.txt
Music SoftSynth
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@chrsr
chrsr / validation.js
Created January 31, 2012 00:37
Inline validate.js usage
input.addEventListener('blur', function () {
var errors = document.getElementById("errors");
validator.validateField(this);
errors.innerHTML = validator.errors[0] || "";
});
@chrsr
chrsr / validatejs-success.js
Created March 9, 2012 05:46
Successful validatejs example
validatejs = new FormValidator(form, rules, function(errors, events) {
if (errors.length > 0) {
// show errors
event.preventDefault(); // + ie6 equivalent
} else {
// do stuff before form submission
return true;
}
});
@chrsr
chrsr / chrome_dev_strange.html
Created May 10, 2012 06:32
Strange Chrome Dev Tools margin behaviour...
<!DOCTYPE html>
<html>
<body>
<div style="width: 100px; height: 100px; margin-right: 30px; background: blue;">
<div style="width: 50px; height: 50px; margin: 0; background: red;">
</div>
</div>
@chrsr
chrsr / ie_click.html
Created May 10, 2012 06:36
IE7/8 element click stack
<!DOCTYPE html>
<html>
<body>
<div style="position: relative; width:500px; height:500px;">
<div style="position: relative;">
<img style="position: relative;" src="http://placedog.com/400/300" onclick="alert('image')">
</div>
@chrsr
chrsr / simple server
Created February 19, 2013 04:13
Simple python server
# Simple Python Server
# --------------------------------------------------
function server() {
local port="${1:-8000}"
open "http://localhost:${port}/"
python -m SimpleHTTPServer "$port"
}
@chrsr
chrsr / script.js
Created March 13, 2013 22:00
A CodePen by Chris Roberts.
var myobjs = [
{position: null},
{position: null},
{position: 5},
{position: 1},
{position: null},
{position: 6},
{position: 3},
{position: 10},
{position: 2},
@chrsr
chrsr / script.js
Last active December 14, 2015 22:18
A CodePen by Chris Roberts.
var myobjs = [
{position: null},
{position: null},
{position: 5},
{position: 1},
{position: null},
{position: 6},
{position: 3},
{position: 10},
{position: 2},
@chrsr
chrsr / LESS-example
Last active December 17, 2015 09:39
// http://less2css.org/
/* CSS Comments */
// Vs Silent Comments
/* Importing */
@import 'my-mixins.css';
@chrsr
chrsr / A-Pen-by-Chris-Roberts.markdown
Last active December 22, 2015 06:29
A Pen by Chris Roberts.