Skip to content

Instantly share code, notes, and snippets.

View lacyrhoades's full-sized avatar
💭
Typing frantically!

Lacy lacyrhoades

💭
Typing frantically!
View GitHub Profile
Process: Xcode [2223]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 7.0 (8227)
Build Info: IDEFrameworks-8227000000000000~2
App Item ID: 497799835
App External ID: 813293765
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [2223]
// Pin names based on https://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf
int serial_clock_pin = 2; // SHCP, Shift register clock
int serial_data_pin = 4; // DS, Serial data input
int register_clock_pin = 6; // STCP, Storage Clock, finalizes a series of serial inputs
int clear_pin = 8; // MR, Clear / Reset all storage (active LOW)
int output_enable_pin = 10; // OE, Enable output (active LOW) otherwise all output pins are LOW
void setup() {
pinMode(serial_clock_pin, OUTPUT);
@lacyrhoades
lacyrhoades / gist:2b86ea7993a76c661e3dc8604aba11a6
Created May 14, 2016 21:21
pod lib lint --allow-warnings --verbose (v0.39.0)
This file has been truncated, but you can view the full file.
17:20 $ pwd
/Users/lacy/Projects/GPUImage
✔ ~/Projects/GPUImage [master|⚑ 1]
17:20 $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
✔ ~/Projects/GPUImage [master|⚑ 1]
17:20 $ pod lib lint --allow-warnings --verbose
@lacyrhoades
lacyrhoades / gist:c9365a079848f1bc3745b43a93643948
Created May 14, 2016 21:29
pod lib lint --allow-warnings --verbose (v1.0.0)
This file has been truncated, but you can view the full file.
17:21 $ sudo gem update
Password:
Updating installed gems
Updating cocoapods
Fetching: cocoapods-core-1.0.0.gem (100%)
Successfully installed cocoapods-core-1.0.0
Fetching: cocoapods-deintegrate-1.0.0.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.0
Fetching: cocoapods-downloader-1.0.0.gem (100%)
Successfully installed cocoapods-downloader-1.0.0
diff --git a/lib/lighthouse.js b/lib/lighthouse.js
index f9a00c8..2a292e9 100644
--- a/lib/lighthouse.js
+++ b/lib/lighthouse.js
@@ -2,11 +2,13 @@ var Netmask = require('netmask').Netmask
var dgram = require('dgram');
var os = require('os');
+var PORT = 3001;
+var MULTICAST_ADDR = "224.1.1.1";
@lacyrhoades
lacyrhoades / Extensions.swift
Last active November 9, 2016 14:51
Swift 3 networking primitives
// Not sure this all works
// I only use copyAsSockAddr which seems fine
extension sockaddr_in {
var addressString: String {
let sadr: UInt32 = self.sin_addr.s_addr
let b = (UInt8( sadr >> 24 ),
UInt8((sadr >> 16) & 0xff),
UInt8((sadr >> 8) & 0xff),
UInt8( sadr & 0xff))
func debug() {
let manager = ThingManager()
let thing1 = Thing(name: "thing1")
manager.addThing(thing1)
manager.sawSomeThing(named: thing1.name)
print("Manager has this many things: ", manager.things.count)
Timer.scheduledTimer(withTimeInterval: 10.0, repeats: false, block: { (timer) in
// By now, the manager should have forgotten about the thing
print("Manager has this many things: ", manager.things.count)
})
func debug() {
let manager = ThingManager()
let thing1 = Thing(name: "thing1")
manager.addThing(thing1)
manager.sawSomeThing(named: thing1.name)
print("Manager has this many things: ", manager.things.count)
Timer.scheduledTimer(withTimeInterval: 10.0, repeats: false, block: { (timer) in
// By now, the manager should have forgotten about the thing
print("Manager has this many things: ", manager.things.count)
})
//
// LiveFrameCaptureViewController.swift
// SCNKit2Video
//
// Created by Lacy Rhoades on 11/29/16
// Revised 7/19/17
// Copyright © 2017 Lacy Rhoades. All rights reserved.
//
import Foundation
import UIKit
import MobileCoreServices
import ImageIO
let sourceOptions: [String: AnyObject] = [kCGImageSourceTypeIdentifierHint as String: kUTTypeJPEG]
let cfSourceOptions = sourceOptions as CFDictionary
let image = UIImage(named: "input.jpg")!
let data = UIImageJPEGRepresentation(image, 1.0)