Skip to content

Instantly share code, notes, and snippets.

View alexcu's full-sized avatar

Alex Cummaudo alexcu

View GitHub Profile
@alexcu
alexcu / SpamReport.applescript
Created November 26, 2016 05:22
Service to report spam to Apple
--
-- Implements phishing suggestions by Apple
-- http://www.apple.com/legal/more-resources/phishing/
--
using terms from application "Mail"
-- Strip the domain from an email address
on domainOf(address)
set atIndex to offset of "@" in address
set domain to strings (atIndex + 1) thru -1 of address
return domain
@alexcu
alexcu / FileParser.swift
Created April 21, 2016 00:10
Simple cross platform file parser for Swift
// Only import only funcs and structs we need to use
#if os(Linux)
// Linux uses Glibc
import struct Glibc.FILE
import func Glibc.fopen
import func Glibc.fgets
import func Glibc.fclose
#else
// OS X uses Darwin
import struct Darwin.C.FILE
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('image.jpg', cv2.IMREAD_GRAYSCALE)
def compute_skew(image):
image = cv2.bitwise_not(image)
height, width = image.shape