Skip to content

Instantly share code, notes, and snippets.

@hhuuggoo
hhuuggoo / SETUP.md
Created April 7, 2019 16:24
How Hugo sets up AWS kubernetes clusters
@hhuuggoo
hhuuggoo / emacs
Created January 24, 2018 14:19
emacs
(add-to-list 'load-path "/Users/hugo/.emacs.d/lisp")
(add-to-list 'auto-mode-alist '("\\.ini\\'" . python-mode))
(require 'ido)
(require 'uniquify)
(require 'pbcopy)
(require 'etags-select)
(require 'find-file-in-tags)
(require 'cython-mode)
(add-to-list 'auto-mode-alist '("\\.pyx\\'" . cython-mode))
;;;###autoload
@hhuuggoo
hhuuggoo / meta.yaml
Created April 15, 2015 15:26
simplest conda recipe for pure python package (without setuptools!)
package:
name: examplepackage
version: "1.0"
@hhuuggoo
hhuuggoo / gunicorn
Created November 21, 2014 02:08
gunicorn
from os.path import join, dirname
from blaze import resource
from blaze.server import Server
@hhuuggoo
hhuuggoo / build.py
Last active August 29, 2015 14:08
building a bunch of conda packages
import os
from os.path import join, getctime, dirname
import glob
import subprocess
stocks1=['AAPL', 'BRCM', 'INTC', 'GOOG']
stocks2 = stocks2
time_range=[dt.datetime(2011,1,1), dt.datetime(2014,1,1)]
## interact automatically generates widgets for the input. We can also allow the user to
## specify pass in actual widgets later. In a bokeh-server application, we would actually have
## to clone the widgets each time a new user browsed to the page
@interact(stocks1=stocks1, stocks2=stocks2, time_range=time_range):
def create(stocks1, stocks2, time_range, selection=None):
data = filter(data, stocks1, stocks2, time_range, selection)
@hhuuggoo
hhuuggoo / colormaps.py
Created October 10, 2014 18:32
colormaps
from matplotlib.colors import rgb2hex
import matplotlib.cm as cm
greys = [cm.Greys_r(x) for x in range(255)]
greys = [rgb2hex(x) for x in greys]
@hhuuggoo
hhuuggoo / scraper.py
Created October 7, 2014 01:49
sa scraping
import requests
import sys
import datetime as dt
import os
from os.path import exists, join
import cPickle as pickle
from pyquery import PyQuery as PQ
from dateutil.parser import parse as _dparse
def dparse(input_string):
@hhuuggoo
hhuuggoo / keys
Last active August 29, 2015 14:06
keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC33Y3DWoppUdDG2ZV6Hcmpp+KmprqTQREPWfw3kBQiiZKPraDtlE7jiUKlc1UPdt44K9lTQAXmaqI7vrbK4L6T/PJG+qu/7Li6/IY3vXbIeHAo90FtQo2IrKNaTKmiolc7T0SfjBzWggIeM/Zs+0DI7qSbvV6cy5wU8XDbtcDKcfl1Bzs59rQ47lStWkTv/QZC0DxUWlyL48c66GUM4KuMbqCsdif/2Ku74cghcbPOfXbep/EFrEbNiaypGM+ZQ3xG1xhddYXBfwTksLjt89+Z7Ul5iImyqsgUZcfY/ClMMy0JljL2ZZVnDxof4SreKAfvc3r5C01o5cbA+D6pnh7v hugoshi@boingy
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpv11Ur+/2hEQztXj2rUprPA8h73qWmuQdzqTf04vcdLzeZDAYUJEUtExUnNjVrEt/gdmAi335if6Zjhwzs6nNWfw3ClU3zVwz0eNlFiU+oKaQrLbnuXhQlnIo3MTPlKu6bdbTc/DsXtMed4K+JwuE9m9BkLgrIl+2V2z4kslZcp3X695i68b9HlmXPNu1lYBS1MziMcwSpPLulfxyR5eJkqYHxlW0+BaYfENWmcvF+fhf3igQujtZ6IrGa3zjWrXtG6vv1vmlG3Gw4oq597c5bCRgaCqcUXdAcKmisbOHBvVPdbCHFL7dsQZ0p0CEm4dL16MD+zFksScEUm5DIONR
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3RGRLo/2BQvWa/Y3tFsYzmAhj0ifvxXptj05gJJhLHDo6PqrgKC5ZABdb5lGAGTNBOUe9yGeQQAE72Ucnh8Uz4DnnyYeaSFAGppjoJZtgQBG6NoypnNnvhtPhPxW/JI+L3nbvN1XUFtS/TO5TXSnxRkzetBXQBreQVAkAvT53OH6DtgInk7bnvj7AlgL+n6Bvj+jP3SmdCM7F4j
class Demo(HBox):
extra_generated_classes = [["Demo", "Demo", "VBox"]]
plot = Instance(Plot)
AR_select = Instance(Select)
@classmethod
def create(cls):
obj = cls()
obj.plot = make_plot(you define this function)
obj.AR_select = Select(name='ar_method', value='cube', options=['cube', 'best'])
obj.children = [obj.AR_select, obj.plot]