Skip to content

Instantly share code, notes, and snippets.

@nataliaking
nataliaking / imgcmp.py
Created March 29, 2017 16:10 — forked from attilaolah/imgcmp.py
Fast image comparison with Python
import math
import Image
import Levenshtein
class BWImageCompare(object):
"""Compares two images (b/w)."""
_pixel = 255
#! /usr/bin/python3
import argparse
from operator import attrgetter
import os
import sys
from github import Github
def main():
@nataliaking
nataliaking / crawler.md
Created December 5, 2016 05:32 — forked from typehorror/crawler.md
Simple Website Crawler (in python)

Simple Website Crawler

The following gist is an extract of the article Building a simple crawler. It allows crawling from a URL and for a given number of bounce.

Basic Usage

from crawler import Crawler
crawler = Crawler()
crawler.crawl('http://techcrunch.com/')

displays the urls

@nataliaking
nataliaking / test_numpy.py
Created December 5, 2016 05:06 — forked from osdf/test_numpy.py
Testing numpy and scipy setups
#!/usr/bin/env python
import numpy
import sys
import timeit
try:
import numpy.core._dotblas
print 'FAST BLAS'
except ImportError:
print 'slow blas'
@nataliaking
nataliaking / slack_history.py
Created November 14, 2016 19:41 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
# that your user participates in, downloads the complete history for
# those converations and writes each conversation out to seperate json files.
#
# This user centric history gathering is nice because the official slack data exporter
# only exports public channels.
@nataliaking
nataliaking / iterm2.md
Created August 2, 2016 04:07
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [

Keybase proof

I hereby claim:

  • I am nataliaking on github.
  • I am natalia (https://keybase.io/natalia) on keybase.
  • I have a public key whose fingerprint is ABAE E186 73C9 78D7 3CC7 5672 C028 CE83 CC9E 2C41

To claim this, I am signing this object:

@nataliaking
nataliaking / Test.java
Created July 14, 2016 23:07 — forked from nogweii/Test.java
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");
@nataliaking
nataliaking / apache-logs-hive.sql
Created March 24, 2016 18:24 — forked from emk/apache-logs-hive.sql
Apache log analysis with Hadoop, Hive and HBase
-- This is a Hive program. Hive is an SQL-like language that compiles
-- into Hadoop Map/Reduce jobs. It's very popular among analysts at
-- Facebook, because it allows them to query enormous Hadoop data
-- stores using a language much like SQL.
-- Our logs are stored on the Hadoop Distributed File System, in the
-- directory /logs/randomhacks.net/access. They're ordinary Apache
-- logs in *.gz format.
--
-- We want to pretend that these gzipped log files are a database table,
@nataliaking
nataliaking / watch.sh
Created February 8, 2016 16:38 — forked from mikesmullin/watch.sh
watch is a linux bash script to monitor file modification recursively and execute bash commands as changes occur
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <mike@smullindesign.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#