Skip to content

Instantly share code, notes, and snippets.

@akeemw
akeemw / 0_reuse_code.js
Created September 23, 2016 20:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
"scripts": {
"postinstall": "find node_modules/ -name '*.info' -type f -delete"
}
/*
* Classes that represent max widths at the largest size of the grid
* Can be used in situations where you have a single non-full size column in a row
*/
@for $i from 1 through $total-columns {
.grid-max-#{$i} {
max-width: ($row-width - $column-gutter) * (grid-calc($i, $total-columns) / 100%);
}
}
#!/usr/bin/env bash
# Sexy bash prompt by twolfson
# https://github.com/twolfson/sexy-bash-prompt
# Forked from gf3, https://gist.github.com/gf3/306785
# Determine what type of terminal we are using for `tput`
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
@akeemw
akeemw / prepare-commit-msg
Last active January 26, 2016 15:53 — forked from shytikov/commit-msg
Usage: Add "prepare-commit-msg" to your repos ".git/hooks"
#!/bin/sh
#
# Automatically adds branch name and branch description to every commit message.
# Unless we are on the master or develop branch.
#
NAME=$(git branch | grep '*' | sed 's/* //')
DESCRIPTION=$(git config branch."$NAME".description)
TEXT=$(cat "$1" | sed '/^#.*/d')
@akeemw
akeemw / jQuery HTML5 placeholder fix.js
Last active December 14, 2015 16:19 — forked from hagenburger/jQuery HTML5 placeholder fix.js
A fork of a fork found elsewhere on the Interwebs. Major difference here from other forks is that the .blur() is removed because it causes issues with JS validation scripts.
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
var input = document.createElement("input");
if(('placeholder' in input) == false) {
$('[placeholder]')
.each(function(){
var i = $(this);
if(i.val() == '' || i.val() == i.attr('placeholder')) {
if(this.type=='password') {
#aliiases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
@akeemw
akeemw / .vimrc
Created August 13, 2012 21:00
vimrc
set nocompatible
set bs=2
syntax on
filetype on
au BufNewFile,BufRead *.module set filetype=php
au BufNewFile,BufRead *.inc set filetype=php
@akeemw
akeemw / .bashrc
Created August 11, 2012 03:24
Bashrc
PS1="[\u@\h:\w ] $ "
alias "ls=ls --color=auto"