Skip to content

Instantly share code, notes, and snippets.

View stephenmac7's full-sized avatar

Stephen McIntosh stephenmac7

  • Neptune Beach, Florida
View GitHub Profile
@stephenmac7
stephenmac7 / freq.rb
Last active September 11, 2015 00:58
Lemma Frequency
# Gem Depends: ve, docopt
# System Depends: mecab, mecab-ipadic-utf-8
require 'csv'
require 've'
require 'docopt'
doc = <<DOCOPT
Lemma Frequency Report.
Usage:
@stephenmac7
stephenmac7 / MainActivityTest.java
Created June 3, 2015 15:34
Android bug reproduction code
package com.example.stephen.myapplication;
import android.test.ActivityInstrumentationTestCase2;
import android.test.TouchUtils;
import android.widget.TextView;
/**
* Created by stephen on 15/06/03.
*/
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> {
@stephenmac7
stephenmac7 / filterit.hs
Created February 17, 2015 22:33
Word filter to create fancy polyatomic ion mnemonics (http://www2.ucdsb.on.ca/tiss/stretton/database/Mneumonics.html)
import System.Environment (getArgs)
import Data.List (isPrefixOf, partition)
import Data.Char (toLower)
checkWord :: String -> Int -> Int -> String -> Bool
checkWord begin vowels consonants s = isPrefixOf begin s && vowels == vCount && consonants == cCount
where isVowel = flip elem "aeiou"
(vCount, cCount) = let (vs, cs) = partition isVowel s in (length vs, length cs)
main = do
@stephenmac7
stephenmac7 / recursive-backtracking.rs
Created July 5, 2014 01:28
Recursive Backtracking - Rust
/*
* recursive backtracking translated from the ruby at
* http://weblog.jamisbuck.org/2010/12/27/maze-generation-recursive-backtracking
*/
use std::io::stdio::print;
use std::io::stdio::println;
// Height and width, change these for a different maze size
// (sorry, it's not a command line argument, as that would
@stephenmac7
stephenmac7 / dabblet.css
Created March 25, 2014 00:22 — forked from iamstarkov/dabblet.css
Untitled
div.container {
width: 60%;
height: 60%;
background-color: hsl(0, 0%, 92%);
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
#!/usr/bin/env python3
import os
import sys
import re
try:
from urllib.parse import unquote
except ImportError:
from urllib import unquote
adfly_url = sys.argv[1]