As configured in my dotfiles.
start new:
tmux
start new with session name:
function uuid() { | |
var uuid = "", i, random; | |
for (i = 0; i < 32; i++) { | |
random = Math.random() * 16 | 0; | |
if (i == 8 || i == 12 || i == 16 || i == 20) { | |
uuid += "-" | |
} | |
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16); | |
} |
# On build host (has internet access): Download and install NodeJS and NPM | |
wget http://nodejs.org/dist/node-v0.4.10.tar.gz | |
tar xvzf node-v0.4.10.tar.gz | |
cd node-v0.4.11 | |
./configure | |
make | |
sudo make install | |
wget http://npmjs.org/install.sh | |
sudo sh ./install.sh |
(comment You will want just about everything in your hive/lib dir included in your Classpath) | |
(ns myproj.core | |
(:import [org.apache.hadoop.hive.service HiveClient] | |
[org.apache.thrift.transport TSocket] | |
[org.apache.thrift.protocol TBinaryProtocol])) | |
(defn send-hive | |
"Creates a new socket and Hive client connection, runs the query, pulls the result, and closes the connection. | |
Eventually modify to split and parse according to schema of result. |
#!/usr/bin/env python | |
"""Functions to convert IPv4 address to integer and vice-versa. | |
Written by Christian Stigen Larsen, http://csl.sublevel3.org | |
Placed in the public domain by the author, 2012-01-11 | |
Example usage: | |
$ ./ipv4 192.168.0.1 3232235521 | |
192.168.0.1 ==> 3232235521 |
As configured in my dotfiles.
start new:
tmux
start new with session name:
<?php | |
class ReconnectingPDO | |
{ | |
protected $dsn, $username, $password, $pdo, $driver_options; | |
public function __construct($dsn, $username = "", $password = "", $driver_options = array()) | |
{ | |
$this->dsn = $dsn; | |
$this->username = $username; | |
$this->password = $password; |
package coolcode | |
import java.io.File | |
import java.util.Properties | |
import org.scalatra.ScalatraServlet | |
class StaticFileServlet extends ScalatraServlet { | |
get("/*") { | |
val resourcePath = getResourcePath |
import org.junit.Before; | |
import org.junit.Test; | |
import sun.misc.Unsafe; | |
import sun.reflect.ReflectionFactory; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Modifier; | |
import static org.junit.Assert.assertEquals; |
import logging | |
import subprocess | |
import time | |
import sys | |
import win32con | |
import win32gui_struct | |
import os | |
try: | |
import winxpgui as win32gui | |
except ImportError: |