This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
const char* c = "1A FF"; | |
int a, b; | |
sscanf(c, "%2x %2x", &a, &b); | |
printf("a: %3d b: %3d\n", a, b); | |
printf("a: %3x b: %3x\n", a, b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# a rakefile for working with Markdown-based prose. | |
# | |
# quotes: Change dumb quotes to smart quotes, and then back again. | |
# info: Various metrics for vanity's sake. "How many words and | |
# characters are in each file, & total" and other such nonsense. | |
# (Note that this chops off the very last file, which I generally | |
# use as the 'stuff I'm about to write' scratchpad - I don't want | |
# metrics on that! | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface C0 : NSObject | |
@end | |
@interface C1 : NSObject | |
@end | |
@interface C2 : NSObject | |
@end | |
int main(int argc, char *argv[]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
NSArray* allClassesConformingToProtocol(Protocol* p); // fwd dec; makes compiler stfu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |