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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
# NAT interface routing | |
*nat | |
# Setup | |
:PREROUTING ACCEPT [0:0] | |
:INPUT ACCEPT [2:128] | |
:OUTPUT ACCEPT [2:120] | |
:POSTROUTING ACCEPT [2:120] | |
# Redirect port 80 to port 8080 |
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
export TOKEN=$( head -c 30 /dev/urandom | xxd -p ) | |
export POOL_SIZE=5 | |
export OVERPROVISION_FACTOR=2 | |
export CPU_SHARES=$(( (1024*${OVERPROVISION_FACTOR})/${POOL_SIZE} )) | |
export TMPNB_NODE=6df651e0-4701-411d-b11c-3cbfe73b86d7-n1 | |
export DOCKER_HOST=tcp://104.130.0.38:2376 | |
docker run -d \ | |
-P \ | |
-h spark.tmpnb-oreilly.com \ |
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
import express from 'express'; | |
const app = express(); | |
if (IS_DEV) { | |
require('piping')(); | |
} | |
//express routes, etc. | |
export default app; |
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 | |
if [[ -z $(grep dockerhost /etc/hosts) ]] | |
then | |
echo `/sbin/ip route|awk '/default/ { print $3 }'` dockerhost >> /etc/hosts | |
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
/** | |
* allows you to wrap or insert an html tag over a selection/range using rangy | |
* @param iframe the CKEditor iframe html element | |
* @param tagName string representation of the tag, such as 'a' for anchor | |
* @param withNodeFunc function to allow outside modification of the element before injecting/wrapping | |
*/ | |
function wrapOrInsert(iframe, tagName, withNodeFunc) { | |
var iframedoc = iframe.contentDocument || iframe.contentWindow.document, | |
tag = iframedoc.createElement(tagName), | |
selection = rangy.getIframeSelection(iframe), |
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
# show top top 10 most consuming processes | |
ps -A --sort -rss -o comm,pmem,pcpu | head -n 11 | |
# show total size of folder | |
du -ch | grep total | |
# show remaning space left on HD | |
df -h | |
# show subfolders of current dir and their size |
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
word | count | |
---|---|---|
trump | 5931 | |
great | 5331 | |
will | 5309 | |
that | 4523 | |
with | 3974 | |
have | 3529 | |
this | 2831 | |
they | 2481 | |
president | 2435 |
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
""" | |
jQuery templates use constructs like: | |
{{if condition}} print something{{/if}} | |
This, of course, completely screws up Django templates, | |
because Django thinks {{ and }} mean something. | |
Wrap {% verbatim %} and {% endverbatim %} around those | |
blocks of jQuery templates and this will try its best |
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
# DOCKER-VERSION 0.4.8 | |
# am facing issue | |
# https://github.com/dotcloud/docker/issues/1123 | |
FROM ubuntu:12.04 | |
MAINTAINER Deepak Kannan "deepak@codemancers.com" | |
RUN apt-get -y install python-software-properties |
OlderNewer