Skip to content

Instantly share code, notes, and snippets.

@toulouse
toulouse / keybase.md
Created October 9, 2014 06:42
keybase.md

Keybase proof

I hereby claim:

  • I am toulouse on github.
  • I am aat (https://keybase.io/aat) on keybase.
  • I have a public key whose fingerprint is 4CF0 CF21 EBF8 6ACB 769D 60E4 FEF7 C76D 9FDF CD23

To claim this, I am signing this object:

@toulouse
toulouse / xcptool.py
Created August 23, 2014 06:22
Messing around with Xcode functions in PyObjC
#!/usr/bin/env python -i
import objc
import os
DVTFoundation = objc.loadBundle('DVTFoundation', globals(), "/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework")
CSServiceClient = objc.loadBundle("CSServiceClient", globals(), "/Applications/Xcode.app/Contents/SharedFrameworks/CSServiceClient.framework")
IDEFoundation = objc.loadBundle("IDEFoundation", globals(), "/Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework")
Xcode3Core = objc.loadBundle('Xcode3Core', globals(), "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin")
//
// Foo.h
// InternCheck
//
// Created by Andrew Toulouse on 5/23/14.
// Copyright (c) 2014 Andrew Toulouse. All rights reserved.
//
#import <Foundation/Foundation.h>
@toulouse
toulouse / .vimrc
Created April 15, 2014 18:33
Some useful vimrc settings
""" Settings
imap \ymd <C-R>=strftime("%Y.%m.%d")
imap \date <C-R>=strftime("%c")
imap \vimss :s/\s\+$//<CR>i
set nocompatible " Don't care about vi compatibility
set backupdir=~/.vim/backup " Backup - specify directory
set directory=~/.vim/backup
set backup
@toulouse
toulouse / main.cpp
Last active December 27, 2015 17:59
#include <iostream>
class BlahClass {
public:
BlahClass() {
std::cout << "BlahClass()" << std::endl;
}
~BlahClass() {
std::cout << "~BlahClass()" << std::endl;
}
class action_disabler {
BOOL previousValue;
action_disabler(){
previousValue = [CATransaction disableActions];
[CATransaction setDisableActions:YES];
}
~action_disabler() {
[CATransaction setDisableActions:previousValue];
@toulouse
toulouse / gist:6836071
Created October 5, 2013 02:47
That's because you're doing it wrong
@class X
@interface Y : NSObject
@property (nonatomic, assign) int z;
- (int)times:(int)other;
- (int)timesX:(X *)xObject;
@end
@implementation Y
@toulouse
toulouse / ATScrollDirectionProxy.h
Created May 7, 2013 07:07
Augments a UITableViewDelegate to let you detect which direction a UITableView has been scrolled.
// Created by Andrew Toulouse on 5/6/13.
// Copyright (c) 2013 Andrew Toulouse. All rights reserved.
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, ATScrollDirection) {
ATScrollDirectionUp,
ATScrollDirectionDown
};
@toulouse
toulouse / sshtutorial.md
Created October 25, 2012 17:17
SSH Tutorial

I noticed some people were typing a lot just to ssh. This can be a pain, so for those who don't already know, here's how you use SSH fast and effectively. These instructions primarily apply to *nix systems. Specifically, I saw Angie was typing more than she needed and I offered to email helpful instructions.

Part 1: Getting Started

In your home directory, there will be a .ssh directory. This directory is where most of our magic will happen.

If you don't have one, go to your home directory and make the directory. Go ahead and cd into it.

[toulouse@myhomecomputer:~]% cd ~
[toulouse@myhomecomputer:~]% mkdir .ssh

[toulouse@myhomecomputer:~]% cd ~/.ssh