This file contains 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
id Container: | |
width = "680px" | |
margin = "2em auto" | |
class Column: | |
float = "left" | |
width = "60%" | |
padding = "2em 0" |
This file contains 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
#container { | |
width: 680px; | |
margin: 2em auto; | |
} | |
.column { | |
float: left; | |
width: 60%; | |
padding: 2em 0; | |
} |
This file contains 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
# post.rb | |
class Post < ActiveRecord::Base | |
has_attached_file :upload | |
validates_presence_of :title | |
end | |
# posts_controller.rb | |
data = grab_data_for(@post) | |
file = StringIO.new(data) |
This file contains 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
""" | |
# Test File | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi | |
vitae `enim` a turpis pellentesque aliquet. Quisque aliquam | |
vestibulum sem, ac ultrices neque dignissim ultricies. | |
Nam posuere [tempor](http://google.com) metus, in porta ante convallis | |
quis. Mauris ut vestibulum nibh. Quisque et lacinia augue. Ut bibendum vestibulum risus vitae dignissim. | |
In hac habitasse platea dictumst. Mauris scelerisque risus luctus |
This file contains 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
#!/bin/bash | |
# A basically sane bash environment. | |
# | |
# Ryan Tomayko <http://tomayko.com/about> (with help from the internets). | |
# setup some basic variables | |
: ${HOME=~} | |
: ${LOGNAME=$(id -un)} | |
: ${UNAME=$(uname)} |
This file contains 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
// Create a new instance of the entity managed by the fetched results controller. | |
NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; | |
NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; | |
Account *account = [NSEntityDescription insertNewObjectForEntityForName:[entity name] | |
inManagedObjectContext:context]; | |
[account setValue:[userDict valueForKey:@"username"] forKey:@"username"]; | |
[account setValue:[userDict valueForKey:@"password"] forKey:@"password"]; | |
[account getAvatar]; |
This file contains 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
# Init with your API key. To find out your key visit | |
# http://disqus.com/api/get_my_key while logged in to disqus.com. | |
disqus = Disqus(secret_key) | |
# Get a list of forums that user owns | |
disqus.forum_list() | |
# Get a list of posts on a forum | |
disqus.forum_posts(forum_id=1) |
This file contains 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
(defn file-maps [#^String dir] | |
(let [files (file-seq (File. dir)) | |
names (map #(.getName %) files) | |
paths (map #(.getPath %) files)] | |
(map (fn [name path] (assoc {} :title name :path path | |
:lines (ds/read-lines path))) | |
names paths))) |
This file contains 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 NSString (Extensions) | |
+ (NSString *)timeAgoStringFromDate:(NSDate *)fromDate; | |
@end |
This file contains 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
// Function: getCopyAndMakeNextMove | |
// | |
// Desc: Creates a copy of the current object then performs the makeNextMove | |
// function on it, advancing it to its next state. | |
// | |
// Pre: None. | |
// | |
// Post: A new object is returned and the next move is taken from the stack. | |
Board getCopyAndMakeNextMove() | |
{ |