Skip to content

Instantly share code, notes, and snippets.

View mysteriouspants's full-sized avatar
:shipit:
Help! I'm trapped in a fixed-width str

Christopher R. Miller mysteriouspants

:shipit:
Help! I'm trapped in a fixed-width str
View GitHub Profile
@mysteriouspants
mysteriouspants / pretty-function-demo.m
Created September 9, 2011 18:39
__PRETTY_FUNCTION__ Demonstration
#include <Foundation/Foundation.h>
typedef void (^voidBlock)();
@interface MyObject : NSObject
- (void)doSth;
@end
@mysteriouspants
mysteriouspants / Avalon.terminal
Created October 14, 2011 21:33
Avalon Terminal Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.39743955291970801</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OViRjbGFzc1xOU0NvbG9yU3BhY2VXTlNXaGl0ZYAC
<h3>Upload a New Image</h3>
<%= form_for Image.new(:project => @project) do |f| %>
<%= f.hidden_field :project_id %>
<div class="sevenhundred">
<div class="first column threeforty">
<%= f.text_field :name, :class => 'form-text', :placeholder => 'Image Name', :size => '45' %>
</div>
<div class="last column threeforty">
<%= f.file_field :image %>
</div>
@mysteriouspants
mysteriouspants / ex.m
Created December 9, 2011 21:11
Madness.
@interface Sender : NSObject
@property (weak) id delegate;
@property (assign) SEL selector;
- (void)doSth;
@end
@interface Receiver : NSObject
@property (strong) Sender* whatever;
@property (copy) void(^blockStuff)();
- (void)assumeThisIsRun;
@mysteriouspants
mysteriouspants / layout.scss
Created December 21, 2011 19:10
Fix for nested lists in Octopress
ul ul, ol ol { margin-bottom: 0px !important; } // hack for soapy-spaghetti
// see the big 'ole list at http://chrismiller.at/blog/2011/12/21/soapy-spaghetti/
// and notice how the sub-lists don't have the bottom margin
// as a side note, it'd be cool if someone knew how to do this without the evil
// !important bit, but it was a quick hack and worked for me.
// if the margin below nested lists is intentional, that's totally cool, too!
@mysteriouspants
mysteriouspants / test.cpp
Created December 21, 2011 22:03
Testing Pointers Stuff
// see http://alexcampbell.github.com//blog/2011/12/19/my-poor-attempt-at-classes/#comment-391786776
#include <iostream>
#include <vector>
#include <cassert>
class C1;
class C2;
class C1 {
public:
@mysteriouspants
mysteriouspants / players_sketch.cpp
Created January 13, 2012 21:27
Just some randomness. Probably doesn't even compile.
#include <iostream>
#include <vector>
Class Player;
using namespace std;
int main(int argc, char *argv[]) {
int32_t min_players = 2;
int32_t max_players = 6;
@mysteriouspants
mysteriouspants / allClassesConformingToProtocol.h
Created January 20, 2012 21:28
All Classes Conforming to Protocol
#import <Foundation/Foundation.h>
NSArray* allClassesConformingToProtocol(Protocol* p); // fwd dec; makes compiler stfu
@mysteriouspants
mysteriouspants / descriptionwithlocalebug.m
Created January 27, 2012 16:10
descriptionWithLocale:indent: Bug
#import <Foundation/Foundation.h>
@interface C0 : NSObject
@end
@interface C1 : NSObject
@end
@interface C2 : NSObject
@end
int main(int argc, char *argv[]) {
@mysteriouspants
mysteriouspants / Rakefile
Created January 31, 2012 17:23
ARMED AND FULLY OPERATIONAL RAKEFILE!!!!
require 'rake/clean'
CC = 'clang'
CXX = 'clang++'
LD = CC
PRODUCTS = {
# executable => source file with the main method
'example_main' => 'example_main.m',
'default_description_example' => 'default_description_example.m'