Skip to content

Instantly share code, notes, and snippets.

import React from 'react';
import classnames from 'classnames';
/*
This would be a page level component. It handles loading all data.
a) The orphan data is triggered by componentWillMount which is part of the React component
life cycle called once as the component loads
b) video search data is loaded when there is a new search preformed 1) When an orphan is
selected, including selecting the first orphan when the data is first loaded 2) When the
from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
import json
from datetime import datetime, time, date, timedelta
from client import slack_client as sc
get_updates = False
earliest_request_time = time(hour=9, minute=30)
dump_time = time(hour=22, minute=30)
'use strict';
var swiz = require('swiz'),
Chain = swiz.Chain,
Valve = swiz.Valve,
o = swiz.struct.Obj,
f = swiz.struct.Field;
Valve.addChainValidator('isHigh', 'description', function(value, baton, callback) {
if(value > baton) {
ddunlop-MacBook-pro:glimpse-chef daviddunlop (mburns/berkshelf)$ ./bootstrap.py -H ord-glimpse-preprod-ddunlop-test.gl.k1k.me -e preprod
Vendoring cookbooks from Berksfile Berksfile to directory cookbooks...
== Executing plugin 'install_omnibus_chef' on ord-glimpse-preprod-ddunlop-test.gl.k1k.me ==
Reading package lists... 0%
Reading package lists... 100%
Reading package lists... Done
@ddunlop
ddunlop / .raxrc
Created September 12, 2014 17:25
[credentials]
username=
api_key=
[api]
url=https://monitoring.api.rackspacecloud.com/v1.0
[auth_api]
url=https://identity.api.rackspacecloud.com/v2.0
@ddunlop
ddunlop / gist:1299550
Created October 19, 2011 20:22
Stats js call decoding
javascript:(function() { var keys = { fps: 'Cookie', op: 'Operation', sh: 'Screen Height', sw: 'Screen Width', ch: 'Channel', se: 'Section', ti: 'Tickers', pt: 'Page Type', i: 'Content ID', su: 'URL', re: 'referrer', au: 'Author', at: 'Author Type', pa: 'Partner' }; var el = document.getElementById('pzndiv'); if(el) { el = el.firstChild; var url = el.src; var parts = url.split("?", 2); var url = parts[0], query = parts[1], html = ""; html += "<div>location: "+url +"</div>"; html += "<div><h3 style='color:white;margin:1em 0;'>Params</h3><ul>"; var qparams = query.split('&'), params = {}; for(var i = 0; i< qparams.length; i++) { var param = qparams[i].split('=', 2); var key = param[0]; if(keys.hasOwnProperty(key)) { key = keys[key]; } html += "<li><em>" + key + "</em> - " + decodeURI(param[1]); } html += "</ul>"; show(html); } else { show("Can't find a stats call on this page"); } function show(html) { var style = { cursor: 'pointer', textAlign: 'left', listStyle: 'none', font: 'bold 15px "Lucida Grande"', bac
javascript:void(window.open("","dp_debugger","width=600,height=600,location=0,menubar=0,status=1,toolbar=0,resizable=1,scrollbars=1").document.write("<script language=\"JavaScript\" id=dbg src=\"http://www.digitalpulse.omniture.com/dp/debugger.js\"></"+"script>"));
@ddunlop
ddunlop / .gitignore
Created June 3, 2011 10:48
A basic .gitignore to use
*.swp
.DS_Store
._*
@ddunlop
ddunlop / fail.js
Created November 29, 2010 10:05
node.js client.request generating EADDRINUSE
var http = require('http'),
util = require('util');
var delta = 0, total = 0;
var server = http.createClient(8000, '127.0.0.1');
(function get() {
var request = server.request('/404', {host:'127.0.0.1'});
request.end();
@ddunlop
ddunlop / gist:659756
Created November 2, 2010 15:18
gitorious install on centos 5.5
as root
$ yum update
$ shutdown -r 0
back as root
$ cd /usr/local/src
$ wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
$ rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm