start new:
tmux
start new with session name:
tmux new -s myname
function fish_prompt --description 'Write out the prompt' | |
# Just calculate these once, to save a few cycles when displaying the prompt | |
if not set -q __fish_prompt_hostname | |
set -g __fish_prompt_hostname (hostname|cut -d . -f 1) | |
end | |
if not set -q __fish_prompt_normal | |
set -g __fish_prompt_normal (set_color normal) | |
end |
# Mac OS X | |
*.DS_Store | |
# Xcode | |
*.pbxuser | |
*.mode1v3 | |
*.mode2v3 | |
*.perspectivev3 | |
*.xcuserstate | |
project.xcworkspace/ |
#include "copyfile.h" | |
typedef enum { | |
_NotStarted = 0, | |
_InProgress, | |
_Finished, | |
} _State; | |
@implementation BAVAppDelegate | |
{ |
import Cocoa; | |
export MyFramework.DataStructures; | |
//Objective-C Modules | |
@class Queue : NSObject | |
//implicitly because we are exporting group names we have a "namespace" of sorts | |
//which is why this class doesn't have a prefix. Since we have modules now @class | |
//can serve a different purpose than it currently serves |
#import <Foundation/Foundation.h> | |
// Adapted from http://stackoverflow.com/a/11068850 | |
/** | |
* @brief convert a hexidecimal string to a signed long | |
* will not produce or process negative numbers except | |
* to signal error. | |
* | |
* @param hex without decoration, case insensative. | |
* |
self.startButton.rac_command = [RACCommand command]; | |
self.stopButton.rac_command = [RACCommand command]; | |
__unsafe_unretained id weakSelf = self; | |
id<RACSignal> tick = [[[[self.startButton.rac_command | |
map:^(id _) { | |
RTAFirstView *strongSelf = weakSelf; | |
// Map each start button click to a new signal that fires every second | |
// and stops when the stop button is clicked. | |
return [[RACSignal interval:1] takeUntil:strongSelf.stopButton.rac_command]; |
// Creating a lambda in C++ with variable type inferred automatically | |
auto someLambda = [](float w, int x, int y) { return(x); }; | |
// Creating a block in C/ObjC without the use of a typedef -- UGLY | |
int (^someBlock)(float, int, int) = ^(float w, int x, int y) { return(x); }; | |
// Creating a block in CPP/ObjCPP with variable type inferred automatically -- NOT TOO BAD | |
auto someBlock = ^(float w, int x, int y) { return(x); }; |
#!/usr/bin/python | |
import zipfile | |
import glob | |
import fnmatch | |
import sys | |
import json | |
import os | |
import Foundation |
// Find out where the frames will be with the "after" layout | |
1. Remove the "before" constraints | |
2. Add the "after" constraints | |
3. Call [window layoutIfNeeded], to force the frames to update | |
4. Grab the frames of all the views I want to animate and save them off | |
// Go back to what the user sees | |
5. Remove the "after" constraints | |
6. Add the "before" constraints | |
7. Call [window layoutIfNeeded], to force the frames to update |