Skip to content

Instantly share code, notes, and snippets.

@chrsr
chrsr / simple-gulp.js
Created June 22, 2017 06:38
gulp boilerplate
var gulp = require("gulp");
var jasmine = require("gulp-jasmine");
var eslint = require("gulp-eslint");
gulp.task("lint", function () {
return gulp.src(["file.js", "./path/**/*.js"])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
});
@chrsr
chrsr / pacemaker-timestamp
Created December 8, 2016 00:35
pacemaker-timestamp
23234234
function getUrlParam(param) {
return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURI(param).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
}
@chrsr
chrsr / A-Pen-by-Chris-Roberts.markdown
Last active December 22, 2015 06:29
A Pen by Chris Roberts.
@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 / 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 / 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 / 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 / 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 / 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>