Skip to content

Instantly share code, notes, and snippets.

@blumonkey
blumonkey / vac.sh
Last active September 16, 2023 15:50
vac: A simple bash command that activates virtualenv
# This setup defines a new command `vac` that activates a virtualenv. You can also add autocompletion to this command.
# Prereq: All venv directories must be in the same place, I place mine under `~/venvs`
# Function to activate virtualenv. Place this in your `.bashrc` file.
```
vac() {
# activates a virutalenv environment
# eg: vactivate llama_farm
source "$HOME/venvs/$1/bin/activate"
}
@blumonkey
blumonkey / .conkyrc
Last active October 25, 2023 03:40
conky config
conky.config = {
background = true,
update_interval = 1.5,
cpu_avg_samples = 2,
net_avg_samples = 2,
out_to_console = false,
override_utf8_locale = true,
double_buffer = true,
no_buffers = true,
text_buffer_size = 32768,
@blumonkey
blumonkey / hmm-example.py
Created August 25, 2015 15:59
Python Code to train a Hidden Markov Model, using NLTK
__author__ = 'ssbushi'
# Import the toolkit and tags
import nltk
from nltk.corpus import treebank
# Train data - pretagged
train_data = treebank.tagged_sents()[:3000]
print train_data[0]
@blumonkey
blumonkey / cors-proxy.js
Last active August 29, 2015 14:23
[NODEJS] Simple CORS proxy that works within a corporate Proxy
var http = require('http');
var url = require('url');
var request = require('request');
/*
Start server by `nodejs thisfile.js`
Usage: goto "localhost:1337?url=http://www.google.com" to proxify google
*/
//Custom set the PORT, or you can use one defined in the env.
http.createServer(onRequest).listen(1337);