Skip to content

Instantly share code, notes, and snippets.

View mnem's full-sized avatar

Dave Clayton-Wagner mnem

View GitHub Profile
iOS release build
Eigen additions 375
Eigen multiplications 1258
GLM additions 620
GLM multiplications 767
CML additions 397
CML multiplications 3029
@mnem
mnem / README.md
Last active August 29, 2015 14:07
PixiJS WebGL Graphics Test

Simple PixiJS graphics test to see what works on mobile. Uses the set-background-to-black hack as mentioned in issue #938.

### Keybase proof
I hereby claim:
* I am mnem on github.
* I am mnem (https://keybase.io/mnem) on keybase.
* I have a public key whose fingerprint is 1D88 0A68 B233 8A02 1B92 393A 17C9 EF8D 13F7 7DC2
To claim this, I am signing this object:
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
[self.tableView setEditing:NO];
}];
moreAction.backgroundColor = [UIColor lightGrayColor];
UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
[self.tableView setEditing:NO];
}];
@mnem
mnem / NAHMainTable.h
Created May 4, 2015 20:38
An opaque navigation bar with an arbitrary background color and single pixel divider color on iOS 7+. This is more faff than it should be.
#import <UIKit/UIKit.h>
@interface NAHMainTable : UITableViewController
@end
import Cocoa
//: Types to make my typing life simpler
typealias Cell = Int
typealias Board = [Cell]
typealias CellPosition = Int
typealias PackedBoard = Int64
typealias AddNeighbours = (Board, CellPosition) -> Cell
typealias SwapNeighbours = (Board, CellPosition) -> Board
typealias Mutator = (add:AddNeighbours, swap:SwapNeighbours)
@mnem
mnem / foo.cpp
Last active August 29, 2015 14:21
//
// main.cpp
// jpm-code-dojo-2015-05-cpp
//
// Created by David Wagner on 18/05/2015.
// Copyright (c) 2015 David Wagner. All rights reserved.
//
#include <iostream>
#include <set>
public function newMrNoisy() :void
{
returnMrNoisy(new MrNoisy()).thing += 50;
}
// ABC Output for newMrNoisy
// function :CompoundOperatorsAndNew:::newMrNoisy()::void
// maxStack:3 localCount:1 initScopeDepth:9 maxScopeDepth:10
// getlocal0
// pushscope
// getlocal0
public function speedTestA() :void
{
var a :int = 1;
var b :int = 2;
b = a + a + a;
}
public function speedTestB() :void
{
// This is just one of the reasons why
// treating null as a boolean false
// is Bad and Wrong
var iAmAStringInstance :String = "";
var iAmANullString :String = null;
if(iAmAStringInstance)
{
trace("iAmAStringInstance: That there is an instance!");