Skip to content

Instantly share code, notes, and snippets.

View mcfunley's full-sized avatar

Dan McKinley mcfunley

View GitHub Profile
dmckinley@dmckinley $ hadoop fs -ls /logs.etsy.com/event_logs/2013_01_30 | awk '{ sum += $5 } END { print sum / 1024 / 1024 }'
74042.1
14 97954900
16 96457161
32 95590098
28 93552850
9 89226804
34 86835728
8 84536021
33 80861650
22 79238941
18 78353033
// Purchases: these cause a proliferation of events because there
// are a minimum of three entities in the system that people can
// be interested in that take part: the buyer, the shop, and the
// item.
//
// For consistency we'll generate all of these activities, but it
// wouldn't make sense to display all of them. People interested
// in an item would see (item, purchased_by, buyer). People
// interested in a shop would see (shop, sold_to, buyer), maybe
// aggregated to show several sales. People interested in a
(eval-when-compile (require 'cl))
(require 'w3m-load)
(require 'w3m)
(require 'dom)
(require 'php-mode)
(setq w3m-use-cookies t)
(defvar *url-handlers*
(require 'php-mode)
(defun progmode-defaults ()
(interactive)
(enable-tab-completion)
(column-number-mode t)
(linum-mode t)
(setq tab-width 4)
(setq c-basic-offset 4)
(column-marker-1 81)
#!/bin/bash
for f in `ls -la /etc/alternatives/ | grep java | cut -f 13 --delimiter=' '`
do
alt="/usr/java/jdk1.6.0_20/bin/$f";
if [ -f $alt ]; then
echo "installing $alt"
sudo alternatives --install /usr/bin/$f $f $alt 20000
fi
done
/**
* This method enables syntax such as the following:
*
* <pre>
* string should be theSameInstanceAs anotherObject
* ^
* </pre>
*/
def should(beWord: BeWord): ResultOfBeWordForAnyRef[String] = new ResultOfBeWordForAnyRef(left, true)
static long
string_hash(PyStringObject *a)
{
register Py_ssize_t len;
register unsigned char *p;
register long x;
if (a->ob_shash != -1)
return a->ob_shash;
>>> from BeautifulSoup import BeautifulSoup as soup
>>> s = soup('<div>hi<span>1.2</span></div>')
>>> ' '.join(s.findAll(text=True))
u'hi 1.2'
>>>
package com.etsy
/**
* <p>
* Handy extensions that can mostly be traced to Haskell derangement syndrome. To
* use, <pre>import com.etsy.Prelude._</pre>
* </p>
*/
object Prelude {