add-apt-repository ppa:dhor/myway
apt-get update
apt-get install UfRaw
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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// Sassy-validation (v0.4.0) | |
// ---- | |
@import "sassy-validation"; | |
Sassy-validation { | |
is-measure: val(10px, 'measure'); |
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
sudo apt-get install nautilus | |
#extension open in terminal | |
sudo apt-get install nautilus-open-terminal | |
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
// Writing JS for everything is great and all, but I don't want to see JS | |
// inline in my Jade templates. Thankfully, there are ways of abstrating it | |
// into mixins! | |
// Want some Rails-like helpers? | |
mixin link_to(name, href) | |
- href = href || "#" | |
a(href="#{href}")= name | |
// How about a single editing point for a class name? |
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/sh | |
# usage: | |
# 1- First argument: String seed | |
# 2- Second argument: Hash length | |
# $hashify "my string seed" 10 | |
LENGTH_STRING=${2:-8} | |
SEED_STRING=$1 | |
md5 <<< ${SEED_STRING} | base64 | awk -v lenstr="$LENGTH_STRING" '{print substr ($0, 10, lenstr)}' |
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 python | |
''' | |
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library. | |
Features: | |
* Map URI patterns using regular expressions | |
* Map any/all the HTTP VERBS (GET, PUT, DELETE, POST) | |
* All responses and payloads are converted to/from JSON for you |
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 | |
# brew install rtmpdump | |
# brew install ffmpeg | |
# brew install youtube-dl | |
# brew install imagemagick | |
ID='c5kuYfTCGLg' # YouTube video ID, i.e. https://www.youtube.com/watch?v={ID} | |
# fetch the video file with youtube-dl |
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/sh | |
# kill all proccess with name provided | |
if [ ! -z "${1}" ] | |
then | |
kill -9 $(ps aux | grep "${1}" | awk '{print $2}') | |
else | |
echo "Please provide an process name to kill all related process" | |
fi | |
exit |
Original post from: http://codesnippets.joyent.com/posts/show/1826
array=( foo babar baz )
array=( "${array[@]//ba/TT}" )
echo "${orig[@]}"$'\n'"${array[@]}"
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 | |
# Script used to setup elasticsearch. Can be run as a regular user (needs sudo) | |
ES_USER="elasticsearch" | |
ES_GROUP="$ES_USER" | |
ES_HOME="/usr/local/share/elasticsearch" | |
ES_CLUSTER="clustername" | |
ES_DATA_PATH="/var/data/elasticsearch" | |
ES_LOG_PATH="/var/log/elasticsearch" | |
ES_HEAP_SIZE=1024 |
OlderNewer