Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
#!/bin/sh -e
export DEBIAN_FRONTEND=noninteractive
HOSTNAME=${1}
DOMAINNAME=${2}
PUPPET_MANIFEST=${3}
PUPPETMASTER_IP=${4}
FQDN=${HOSTNAME}.${DOMAINNAME}
# Build
IMAGEID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1) && sudo docker build -t $IMAGEID .
# Run new container
CONTAINER_ID=$(sudo docker run -t -d -p 0.0.0.0:81:80 $IMAGEID)
# Login into running container
FULL_CONTAINER_ID=$(sudo docker ps -a -notrunc -q | grep -F $CONTAINER_ID) && sudo lxc-attach -n $FULL_CONTAINER_ID /bin/bash
# Container stdout

JavaScript Templates Engines

A quick comparison/ benchmark between Hogan, Dust, doT and underscore

Presentation and Readability

Hogan.js

Developed by Twitter (same team as Bootstrap), use exactly the same syntax as Mustache, but more performant and more stuff available server side.

My name is {{ name }}

@fearphage
fearphage / nginx.conf
Created February 15, 2014 03:48 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
[
{
"use_channel":true,
"allow_empty_post_data":true,
"app_id":"edaded98-5119-4c8a-afc1-de722da03562",
"url":"http://chromecast.redbull.tv/receiver.php",
"dial_enabled":true
},
{
"use_channel":true,
#!/bin/sh
#
# Shell script that configures mate-terminal to use solarized theme
# colors. (I simply replaced in the original script every occurence
# of "gnome-terminal" with "mate-terminal" and every occurcence
# of "gconftool-2" with "mateconftool-2"; reverse these changes if
# using gnome and rename the script to its original name: "solarize"
#
# Written for Ubuntu 11.10, untested on anything else. (actually tested
# also on ArchLinux, seems to work fine here, tweak it to your needs :)
#!/bin/sh
#
# Shell script that configures gnome-terminal to use solarized theme
# colors. Written for Ubuntu 11.10, untested on anything else.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Adapted from these sources:
# https://gist.github.com/1280177
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

@fearphage
fearphage / dbg.js
Created December 9, 2013 16:30 — forked from hallvors/dbg.js
// post serialized no-script clone back to debugger
if(true){ // this is just to be able to toggle the dumping off easily
(function noscriptDump(){
var clone = document.documentElement.cloneNode(true);
var elms = clone.getElementsByTagName('script')
while(elms.length){
elms[elms.length-1].parentNode.removeChild(elms[elms.length-1]);
}
var html = clone.outerHTML;
var x = new XMLHttpRequest();