Skip to content

Instantly share code, notes, and snippets.

View rch's full-sized avatar

Ryan C. Hill rch

View GitHub Profile
@rch
rch / sqoop-import-list.sh
Last active December 28, 2022 19:50
Sqoop Utils
#!/usr/bin/env bash
export DB_TYPE=
export DB_HOST=
export DB_PORT=
export DB_NAME=
# e.g. jdbc:mysql://database.example.com/
export DB_URI=jdbc:$DB_TYPE:thin:@$DB_HOST:$DB_PORT:$DB_NAME
import numpy as np
def basic_way(filename):
with open(filename, 'r') as f:
lst = [line.split(',') for line in f]
return np.array(lst)
def another_way(filename):
return np.genfromtxt(filename, delimiter=',')
@rch
rch / ref.py
Created July 21, 2019 21:49
references
class A:
def __init__(self, n):
self.v = n
def add(self, n):
self.v += n
x = A(3)
@rch
rch / from-application.conf
Last active August 27, 2018 18:18
Kamon 1.x StatsD Configuration
kamon {
environment.service = app
show-aspectj-missing-warning = yes
modules {
kamon-statsd.auto-start = true
kamon-system-metrics.auto-start = true
kamon-log-reporter.auto-start = true
@rch
rch / atom_clojure_setup.md
Created January 19, 2017 04:59 — forked from jasongilman/atom_clojure_setup.md
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@rch
rch / mesos-chronos-linux.md
Created January 2, 2017 22:09 — forked from diegopacheco/mesos-chronos-linux.md
How to Install Mesos / Chronos on Ubuntu Linux 16.04 LTS?
#
# Install Java 8
#
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz"
tar -xzvf jdk-8u45-linux-x64.tar.gz
rm -rf jdk-8u45-linux-x64.tar.gz

#
# Install Maven 3

Keybase proof

I hereby claim:

  • I am rch on github.
  • I am rch (https://keybase.io/rch) on keybase.
  • I have a public key whose fingerprint is A3B0 E05E E2D0 0714 B2A4 B31B B8CD 8934 7577 F749

To claim this, I am signing this object:

@rch
rch / app.js
Last active August 29, 2015 14:15
metadata reconfigure example
Ext.require([
'Ext.data.*',
'Ext.tree.*',
'Ext.grid.*',
'Ext.container.*',
]);
Ext.application({
name : 'Main',
#!/usr/bin/env python
import re
from collections import OrderedDict
class Name(object):
def __init__(self, raw):
if raw is None:
self._first = ''
@rch
rch / example.py
Created February 3, 2014 20:37
Lepl Example
>>> value = Token(UnsignedReal())
>>> symbol = Token('[^0-9a-zA-Z \t\r\n]')
>>> number = Optional(symbol('-')) + value >> float
>>> add = number & ~symbol('+') & number > sum
>>> add.parse('12+30')
[42.0]
>>> add.parse('12 + -30')
[-18.0]