Skip to content

Instantly share code, notes, and snippets.

View luwes's full-sized avatar
🙇‍♂️

Wesley Luyten luwes

🙇‍♂️
View GitHub Profile
@luwes
luwes / _mixins.scss
Created October 1, 2013 07:43
Sass mixins
@mixin prefixed($property, $value) {
@each $prefix in "-webkit-", "-moz-", "-ms-", "-o-", "" {
#{$prefix}#{$property}: #{$value};
}
}
@mixin transition($props) {
@include prefixed('transition', $props);
}
@luwes
luwes / populate.js
Last active December 23, 2015 17:59
Populate - Tiny Javascript Template Function, http://luwes.co/populate-tiny-javascript-template-function/
String.prototype.populate = function(obj, funcs) {
return this.replace(/\{\{\s*([^|\s}]+)\|?([^\s}]*)\s*\}\}/g, function(match, key, mods) {
var str = obj[key];
if (typeof str !== "undefined") {
if (funcs && mods) {
var arr = mods.split('|');
for (var i = 0; i < arr.length; i++) {
var mod = arr[i].split(':')[0];
var par = arr[i].split(':')[1];
var args = par ? par.split(',') : [];
@luwes
luwes / sub.js
Last active December 23, 2015 10:09
Sub JavaScript library Very limited substitute for jQuery to include in small projects so you have no dependencies Browser support IE8+
/**
* Sub JavaScript library v0.2
* Very limited substitute for jQuery to include
* in small projects so you have no dependencies
* Browser support IE8+
*
* Includes code snippets from
* http://jquery.com/
* http://underscorejs.org/
*
#!/usr/bin/env bash
# Written by William Ting for the following blog post:
# http://williamting.com/posts/2012/04/18/set-up-python-and-django-on-dreamhost/
rcfile="${HOME}/.bashrc"
version="2.7.8"
setuptools_version="2.7"
tmp_dir="${HOME}/tmp-${RANDOM}"
if [[ ${#} == 0 ]]; then