Skip to content

Instantly share code, notes, and snippets.

View timc3's full-sized avatar

Tim Child timc3

View GitHub Profile
@timc3
timc3 / docstring.py
Created August 23, 2011 13:36
DocString django template tag for organizing documentation into django templates
"""
DocString node.
An example of a docstring django template tag. For example add to builtins by including in an imported file::
from django.template import add_to_builtins
add_to_builtins('appname.templatetags.docstring')
"""
from django.template import (Library, Node)
@timc3
timc3 / gist:2259914
Created March 31, 2012 06:18
Sublime text ipdb trace
<snippet>
<content><![CDATA[
import ipdb; ipdb.set_trace()
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ipdb</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
@timc3
timc3 / nesting.js
Created February 12, 2013 10:31 — forked from geddski/nesting.js
function nestCollection(model, attributeName, nestedCollection) {
//setup nested references
for (var i = 0; i < nestedCollection.length; i++) {
model.attributes[attributeName][i] = nestedCollection.at(i).attributes;
}
//create empty arrays if none
nestedCollection.bind('add', function (initiative) {
if (!model.get(attributeName)) {
model.attributes[attributeName] = [];
@timc3
timc3 / cpu.js
Created February 25, 2013 12:42
Hubot CPU usage script written in Javascript instead of coffeescript nonsense
// Description:
// Report the top 5 local CPU processes
//
// Dependencies:
//
// Configuration:
// None
//
// Commands:
// hubot cpu usage ? - show the top 5 processes
mkdir -p /opt/cantemo/portal/portal_themes/demo/templates/
yum install rubygems gcc-c++ ruby-devel
gem install less
gem install therubyracer
cd /opt/cantemo/portal/portal_media/less/
cp portal-core.less portal-demo.less

Keybase proof

I hereby claim:

  • I am timc3 on github.
  • I am timchild (https://keybase.io/timchild) on keybase.
  • I have a public key whose fingerprint is C9EB 34EF 9C70 198E 2828 5D3E 8A46 1172 B333 13E0

To claim this, I am signing this object:

@timc3
timc3 / vimrc
Last active December 6, 2015 10:16
"NeoBundle Scripts-----------------------------
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle'))
" Let NeoBundle manage NeoBundle
@timc3
timc3 / cassandra-311.conf
Created December 4, 2017 09:51
Cassandra 3.11 CollectD for Stackdriver configuration
# This is the monitoring configuration for Cassandra 3.11
# Taken and modified from Google Stackdrivers Cassandra 2.2.x configuration.
# Look for CASSANDRA_HOST and CASSANDRA_PORT to adjust your configuration file.
LoadPlugin java
<Plugin "java">
JVMARG "-Djava.class.path=/opt/stackdriver/collectd/share/collectd/java/collectd-api.jar:/opt/stackdriver/collectd/share/collectd/java/generic-jmx.jar"
LoadPlugin "org.collectd.java.GenericJMX"
<Plugin "GenericJMX">
<MBean "cassandra_storageservice-load">