Skip to content

Instantly share code, notes, and snippets.

View aculich's full-sized avatar
😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG

Aaron Culich aculich

😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG
View GitHub Profile
@aculich
aculich / WCEnumerator.hs
Created July 10, 2011 05:17 — forked from ivant/Makefile
wc using Data.Enumerator
{-# LANGUAGE ScopedTypeVariables, ViewPatterns, OverloadedStrings #-}
import Control.Applicative
import Control.Exception (SomeException)
import Control.Monad (when, mapM)
import Control.Monad.Trans (lift)
import Data.Char (ord)
import Data.Enumerator hiding (map, mapM, length, filter, foldl')
import Data.List (foldl')
import Data.Word (Word8, Word64)
import qualified Data.ByteString as SB
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@aculich
aculich / AWS.js
Last active August 29, 2015 14:19 — forked from zircote/AWS.js
/**=
* User: zircote
* Date: 16/10/2013
* Time: 08:59
*/
var SERVICE_HOST = 'http://aws.amazon.com'
var data_sources = {
"linux-od": {
@aculich
aculich / Switch to User.scpt
Last active September 11, 2018 03:27 — forked from oschrenk/Switch to User.scpt
switch-to-user script
--This script MUST be named "Switch to <User>.scpt", where <User> is the name of the user to switch to.
--You must first make a password item (a.k.a. a key) for the other user's password using Keychain Access,
--and call it "<user>", where "<user>" is the other user's name.the field "Kind" must be "User Login" (without quotes).
--The script assumes that you make this key in your login.keychain, which is the default one.
--The first time you run this script, you will be prompted to allow Keychain Scripting to access the password of the key.
--This script requires "Enable access for assistive devices" to be enabled in the Universal Access system preference pane.
set username to word -1 of my findReplace(".scpt", "", (path to me as text))
-- Invoke Fast User Switching. The `id -ur username` part gets the uid number that corresponds to the username and substitutes it at the end of the CGSession command
@aculich
aculich / aws_repoint_to_my_ip.sh
Last active October 26, 2015 21:36 — forked from hibernado/aws_repoint_to_my_ip.sh
Repoint AWS EC2 Security Group inbound access to my current IP address
#!/bin/bash
# Summary:
# Bash script repoints all inbound access for a given AWS EC2 security group
# to your current IP addr(v4) as provided by ifconfig.me/ip
# To use this script:
# Pass the name of a security group as a command line argument
# e.g. $ aws_repoint_to_my_ip.sh SECURITYGROUPNAME
@aculich
aculich / pricing.txt
Created July 3, 2016 21:09 — forked from thbkrkr/pricing.txt
Amazon AWS vs Google Compute Engine (GCE) vs DigitalOcean vs OVH RunAbove
------------
Amazon (http://calculator.s3.amazonaws.com/index.html)
------------
type price CPU RAM Disk I/O EBS opt.
t2.micro 10$ 1 1.0 -- Low --
t1.micro 15$ 1 0.6 -- Very Low --
t2.small 10$ 1 2.0 -- Low --
m1.small 34$ 1 1.7 1 x 160 Low --
t2.medium 41$ 2 4.0 -- Low --
m3.medium 56$ 1 3.7 SSD 1 x 4 Moderate --
@aculich
aculich / gmailaccount.py
Created February 25, 2017 02:32 — forked from tyleha/gmailaccount.py
A simple IMAP manager class for Gmail
from imaplib import IMAP4_SSL
import email as em
from email.utils import parsedate, parsedate_tz
from email.parser import HeaderParser
class GmailAccount(object):
def __init__(self, username=None, password=None, folder=None):
self.username = username
self.password = password
self.folder = folder
@aculich
aculich / jupyter_notebook_config.py
Last active September 11, 2018 03:17 — forked from masnick/jupyter_notebook_config.py
jupyter notebook script_post_save
# Based off of https://github.com/jupyter/notebook/blob/master/docs/source/extending/savehooks.rst
import io
import os
from notebook.utils import to_api_path
_script_exporter = None
_html_exporter = None
def script_post_save(model, os_path, contents_manager, **kwargs):