Skip to content

Instantly share code, notes, and snippets.

View adion's full-sized avatar

André Dion adion

View GitHub Profile
@adion
adion / Gruntfile.js
Last active February 16, 2019 12:12
Example Gruntfile for grunt-contrib-watch with livereload.
'use strict';
var
LIVERELOAD_PORT = 35729,
lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }),
mountFolder = function( connect, dir ) {
return connect.static(require('path').resolve(dir));
};
module.exports = function( grunt ) {
#!/bin/bash
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@adion
adion / px2em
Created February 19, 2013 17:14
A simple shell script used for converting pixel units to relative ems. It assumes a baseline of 16px if one isn't provided.
#!/bin/bash
baseline=16 # px
em=0
px=0
float_scale=3 # floating point precision for bc
function px2em()
{
local result=$(echo "scale=$float_scale; $px / $baseline" | bc -q 2>/dev/null)
@adion
adion / .bashrc
Created July 26, 2012 18:15
André's dot files
### .aliases
# save some typing with often-used common options
alias vi='vim'
alias ls='ls -hF'
alias la='ls -Al'
alias ll='la'
alias mkdir='mkdir -p'
# shitcan Mac OS meta files
@adion
adion / dabblet.css
Created June 7, 2012 11:42
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
#test { width: 100px; height: 100px; background-color: red; }