Skip to content

Instantly share code, notes, and snippets.

@hhuuggoo
hhuuggoo / build.py
Created October 12, 2012 01:39
Simple script to watch and build your coffeescript files.
"""
Grunt.js was too complex for me. after adding a third project,
we ran into some wierd timer.js errors and gave up.
This python solution is pretty straightforward
and works well enough.
"""
import subprocess
import sys
import time
from watchdog.observers import Observer
// This file was generated by modules-webmake (modules for web) project.
// See: https://github.com/medikoo/modules-webmake
(function (modules) {
var getModule, getRequire, require;
getModule = (function (wrap) {
return function (scope, tree, path, fullpath) {
var name, dir, exports, module, fn, isDir;
path = path.split('/');
name = path.pop();
import sys
#url = "http://localhost:5006/bokeh/doc/line/show"
url = "http://10.10.0.121:5006/bokeh/doc/line/show"
def start():
app_created = False
app = QtCore.QCoreApplication.instance()
if app is None:
app = QtGui.QApplication(sys.argv)
app_created = True
return app
@hhuuggoo
hhuuggoo / gist:c256a82178253dbd3d4e
Last active August 29, 2015 14:01
conda deploy command

###Conda Deploy Conda deploy command is a command used to auto-tag and deploy multiple packages. The idea would be to make it a one step operation to auto-tag a bunch of packages, and build a bunch of packages which point to the versions that were just tagged

Usage

conda deploy deploy.yaml

deploy.yaml contains

project1:
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]
@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
@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 / 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]
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 / 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