This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First Brainf*** Interpreter in Swift | |
import Cocoa | |
func input() -> String { | |
var keyboard = NSFileHandle.fileHandleWithStandardInput() | |
var inputData = keyboard.availableData | |
return NSString(data: inputData, encoding:NSUTF8StringEncoding) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First Topological Sort in Apple's new language Swift | |
// Updated on 10/30/2016 to account for the newest version of Swift (3.0) | |
// Michael Recachinas | |
enum TopologicalSortError : Error { | |
case CycleError(String) | |
} | |
/// Simple helper method to check if a graph is empty | |
/// - parameters: | |
/// - dependency_list: a `Dictionary<String, [String]>` containing the graph structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# vim:sw=4:sts=4:et | |
import bs4 | |
import urllib2 | |
import httplib | |
import datetime | |
def parse_html(html_str, now): | |
"""Parses HTML from OPM's current status website to return open/close | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim:sw=4:sts=4:et | |
import math | |
import locale | |
def calc_taxes(annual_salary, plan, filing): | |
filing_plan = plan[filing] | |
taxes = 0 | |
for salary_range in filing_plan: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
subscript(i: Int) -> Character { | |
return self[index(startIndex, offsetBy: i)] | |
} | |
subscript(r: Range<Int>) -> String { | |
return substring(with: index(startIndex, offsetBy: r.startIndex)..<index(startIndex, offsetBy: r.endIndex)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import urllib2 | |
import httplib | |
from bs4 import BeautifulSoup, SoupStrainer | |
import string | |
import time | |
def get_wiki(link): | |
try: |
I hereby claim:
- I am mrecachinas on github.
- I am mrecachinas (https://keybase.io/mrecachinas) on keybase.
- I have a public key whose fingerprint is 9B9F D0FD E117 251A 2CC9 E954 1FFD 95E9 483C 6A66
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "keccak-test" | |
version = "0.1.0" | |
authors = ["Michael Recachinas <[email protected]>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
tiny-keccak = { version = "2.0", features = ["cshake", "kmac"] } |
To run:
python3 -m pip install websockets
python3 simple_websocket_server.py
Then in another terminal, run