Skip to content

Instantly share code, notes, and snippets.

View southpawfishel's full-sized avatar

Dave southpawfishel

View GitHub Profile
public struct Lens<ParentType, ChildType> {
public let get: (ParentType) -> ChildType
public let set: (ParentType, ChildType) -> ParentType
}
public struct KeyLens<KeyType, ValueType> where KeyType: Hashable {
public typealias ParentType = [KeyType: ValueType]
public static func ForKey(_ key: KeyType) -> Lens<ParentType, ValueType> {
let lens = Lens<ParentType, ValueType>(
@southpawfishel
southpawfishel / gist:5992966
Created July 14, 2013 02:28
wtf native loom
This file has been truncated, but you can view the full file.
dave@Daves-MacBook-Air ~/code/loom-engine (spriter)*$ rake build:desktop
== Executing as 'dave' ==
Loom Rakefile running on Ruby 2.0.0
Running cmake version 2.8.11.1
*** Using JIT? = 1
*** Build Type = Release
*** AndroidSDK = android-13 AndroidBuildType = release
*** iOS SDK Version = 6.0
*** doxygen suppress = 0
*** Building with 4 cores.
@southpawfishel
southpawfishel / Point.as
Last active December 19, 2015 03:18
Quick implementation of flash.geom.Point in Loomscript. I took loom2d.math.Point and used it as a base, and added all the methods from the Flash version, as well as a distanceSquared method since thats on loom.graphics.Point.
package loom2d.math
{
/**
* A slightly less simple Point class.
*/
public struct Point
{
public var x:Number, y:Number;
// CREATION / ASSIGNMENT
@southpawfishel
southpawfishel / emacs.md
Last active June 16, 2016 22:49
Emacs shortcuts

Emacs Control Keys

Control

Commands using control will always look of the form C-? where ? is some key that you're to press while holding control.

Meta

Commands using meta will always look of the form M-? where ? is some key that you're to press while holding the meta key (most often this is the alt key in modern terminals). Pressing ESC will also activate the meta key.