Skip to content

Instantly share code, notes, and snippets.

View kyle-dorman's full-sized avatar
🤠

Kyle Dorman kyle-dorman

🤠
  • San Francisco
View GitHub Profile
@kyle-dorman
kyle-dorman / opencv.rb
Created February 14, 2019 17:26
Install opencv 3.3.1 using brew
class Opencv < Formula
desc "Open source computer vision library"
homepage "https://opencv.org/"
revision 1
stable do
url "https://github.com/opencv/opencv/archive/3.3.1.tar.gz"
sha256 "5dca3bb0d661af311e25a72b04a7e4c22c47c1aa86eb73e70063cd378a2aa6ee"
# Upstream commit 8 Nov 2017 "cmake: fix pkg-config generation for MacOSX"
@kyle-dorman
kyle-dorman / .bash_profile
Created November 9, 2016 21:12
my bash_profile
# git alias
alias gitclean='git checkout master && git reset --hard origin/master && git pull && git submodule update'
# sublime
alias subl="open -a 'Sublime Text'"
alias subl.="subl ."
# Quicker navigation
alias ..='cd ..'
@kyle-dorman
kyle-dorman / Taxonomy tree 1 parent node
Created February 11, 2016 21:31
Round 1 interview question, potential answer
/*
value String
children []Node
*/
function Node(value, children) {
self.value = value;
self.children = children;
}
/*
root Node
import UIKit
public protocol KDLayoutConstraint {
var view: UIView { get }
var attribute: NSLayoutAttribute { get }
}
public protocol KDLayoutAnchor {
/* These methods return an inactive constraint of the form thisAnchor = otherAnchor + constant. */
func constraintEqualToAnchor(anchor: KDLayoutAnchor, constant c: CGFloat) -> NSLayoutConstraint
// Example Hammer 1.x code:
var body = document.getElementsByTagName('body')[0];
var armAndHammer = new Hammer(body, options);
armAndHammerr.on('tap', tapEvent(ev));
function tapEvent (ev) {
var touchEl; // dom element which you want to act on
if (ev.target === tocuhEl) {
handleTapEvent(); // what you actally want to do on tap