Skip to content

Instantly share code, notes, and snippets.

.version-5-7-0 {display: none}
.tile {background-color: grey}
.weather {background-color: #a20025;}
.clock {background-color: #607d8b;}/*blue gray*/
.presence {background-color: #3f51b5;}/*indigo*/
.lock {background-color: #f44336;/*red*/}
.hello-home {background-color: #9c27b0;}/*purple*/
.switch, .dimmer, .momentary, .light, .dimmerLight, .themeLight {background-color: #4caf50;} /*green*/
.contact {background-color: #e91e63;}/*pink*/
@jterrace
jterrace / git-annex-gcs.sh
Last active September 8, 2021 22:09
An example of how to use Google Cloud Storage with git-annex
# Initialize git and git-annex
$ mkdir annex-gcs-test
$ cd annex-gcs-test/
$ git init
Initialized empty Git repository in /Users/jterrace/annex-gcs-test/.git/
$ git annex init "my machine"
init my machine ok
(Recording state in git...)
# Set up AWS credentials
@ndabas
ndabas / README.md
Last active October 5, 2015 18:07 — forked from jterrace/lang-llvm.js
LLVM plugin for google-code-prettify

LLVM plugin for google-code-prettify

lang-llvm.js adds LLVM assembly language syntax highlighting support to google-code-prettify. I wrote this in response to a question on StackOverflow.

Usage

See the google-code-prettify README for instructions on how to setup google-code-prettify. Then:

  1. Include lang-llvm.js in your HTML head tag, after prettify.js. This file is now included in the official google-code-prettify distribution.
  2. Markup your LLVM code like this:
@Sepero
Sepero / slash_middleware.py
Created March 26, 2012 09:17 — forked from gregplaysguitar/slash_middleware.py
Remove slashs in django - like APPEND_SLASH but opposite.
""" Author contact: sepero 111 @ gmail . com """
from django import http
from django.utils.http import urlquote
from django.core import urlresolvers
class RemoveSlashMiddleware(object):
"""
This middleware works like django's built in APPEND_SLASH, but in reverse. Eg
@endemics
endemics / getswap.sh
Created September 6, 2011 15:20
get swap usage for all running processes
#!/bin/bash
# Get current swap usage for all running processes
# based on http://northernmost.org/blog/find-out-what-is-using-your-swap/
# by Erik Ljungstrom 27/05/2011
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`