Skip to content

Instantly share code, notes, and snippets.

View remcoder's full-sized avatar
👓
software engineer -- obsessed with 3d printing

Remco Veldkamp remcoder

👓
software engineer -- obsessed with 3d printing
View GitHub Profile
@remcoder
remcoder / facebook.loadonce.js
Last active December 16, 2015 14:49
Facebook.loadOnce is simple wrapper for the official Facebook JS SDK for promise-based lazy-loading.
/*global $ */
/*
_______ _______ _______ _______ _______ _______ _______ ___ _
| || _ || || || _ || || || | | |
| ___|| |_| || || ___|| |_| || _ || _ || |_| |
| |___ | || || |___ | || | | || | | || _|
| ___|| || _|| ___|| _ | | |_| || |_| || |_
| | | _ || |_ | |___ | |_| || || || _ |
@remcoder
remcoder / typescript.sublime-build
Created October 1, 2012 19:48
Sublime Text 2 build system for Typescript
{
"selector": "source.ts",
"cmd": ["tsc", "$file"],
"file_regex": "^(.+?) \\((\\d+),(\\d+)\\)(: .+)$",
"line_regex": "\\((\\d+),(\\d+)\\)",
"osx": {
"path": "/usr/local/bin:/opt/local/bin"
@remcoder
remcoder / QueryString.js
Created April 18, 2012 14:39
access querystring params from javascript
// adapted from: http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript
// wrapped it in a module and only exposing a getter function make the datastructure immutable
// usage: var bla = QueryString.get('loginEnabled')
var QueryString = (function () {
var urlParams = {};
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
@remcoder
remcoder / build_less.py
Created July 24, 2011 13:06
Compile LESS to CSS automatically whenever a file is modified
#!/usr/bin/env python
# determines filename and extension, then delegates compiling the LESS files to lessc via a shell command
import sys, os.path
from subprocess import call
src = sys.argv[1]
base,ext = os.path.splitext(src)
@remcoder
remcoder / heart.less
Created February 10, 2011 22:28
heart shape in LESS css
.love {
.heart(hotpink, 200px);
.transform-rotate(15deg);
}
.heart(@color: red, @size: 100px) {
position: relative;
width: @size;
height: 90px;