- Make sure you have yo installed:
npm install -g yo
- Run:
yo webapp
- Install grunt-contrib-jade:
npm install grunt-contrib-jade --save-dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DOM sugar | |
// ================================================================== | |
// Modified version of Neil Jenkins' "Sugared DOM" <https://gist.github.com/3524145> | |
// | |
// Usage | |
// ------------------------------------------------------------------ | |
// var make = domsugar(document); | |
// | |
// make( 'p.foo#bar', { hidden: true }, [ make( 'span' ) ] ); | |
// => <p class="foo" id="bar" hidden><span></span></p> |
git diff --name-only | uniq | xargs mvim
When git encounters a merge conflict, e.g. during a rebase, it drops you back into the shell with a dirty working directory. I like this one-liner for opening all files with a merge conflict in MacVim.
Once you're in Vim, you can then switch between the files with :n
and :prev
, or another favourite: :w | n
(save current file and open the next command line-supplied file).
UPDATE: see below for a version that works with real terminal commands.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Vlad Niculae <vlad@vene.ro> | |
# Makes use of memory_profiler from Fabian Pedregosa | |
# available at https://github.com/fabianp/memory_profiler | |
from IPython.core.magic import Magics, line_magic, magics_class | |
class MemMagics(Magics): | |
@line_magic | |
def memit(self, line='', setup='pass'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# node.js using PPA (for statsd) | |
sudo apt-get install python-software-properties | |
sudo apt-add-repository ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs npm | |
# Install git to get statsd | |
sudo apt-get install git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command! -range -nargs=* CheckRegexpEscapes :call CheckRegexpEscapes(<f-args>) | |
" call with either no arguments or a:1 for escape character + | |
" an argument for each character to be escaped | |
" e.g. CheckRegexpEscapes('\\','(',')','_') -> | |
" checks that you put in '\\' behind each of '(',')','_',')' | |
" and prompts you to change it | |
" always asks to substitute | |
function! CheckRegexpEscapes(...) | |
" NonEscapedCharRegexp: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matplotcolors= ['b','g','r','c','m','y','k'] | |
defaultcolorlist = ["#00af64","#0b61a4","#ff9200","#ff4900","#9c02a7"] | |
defaultcolorlist.extend(matplotcolors) | |
from collections import defaultdict | |
class DefaultColor(defaultdict): | |
""" defaultdict that returns sequential elements of a list(if not specified, a color) each time it is | |
called Note that if input list is len(1) it will always return the same | |
value""" | |
def __init__(self,colorlst = defaultcolorlist): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function actual_path() { | |
if [ [ -z "$1" ] -a [ -d $1 ] ]; then | |
echo $(cd $1 && test `pwd` = `pwd -P`) | |
return 0 | |
else | |
return 1 | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
# Simple password generation in Ruby. | |
# | |
# Generate reasonably secure random passwords of any chosen length, | |
# designed to be somewhat easy for humans to read and remember. | |
# Each password has a capitalized letter and a digit. | |
# | |
# Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Dependencies: Apache POI Library from http://poi.apache.org/ | |
*/ | |
package poi_excels; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.logging.Level; |
NewerOlder