Skip to content

Instantly share code, notes, and snippets.

David Demaree ddemaree

Block or report user

Report or block ddemaree

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ddemaree
ddemaree / 0_story.md
Created Apr 24, 2015
Apple Git prompt set up
View 0_story.md

We want our prompts to look like this:

[ddemaree@ddemaree-osx giftboxapp (master)]$ 

In this example, the text inside the square brackets shows the current username and hostname (ddemaree@ddemaree-osx), followed by the name of the current directory (giftboxapp), and finally the current Git branch ((master)) shown in parentheses.

If we have untracked changes to this Git project, those are denoted with an asterisk:

View keybase.md

Keybase proof

I hereby claim:

  • I am ddemaree on github.
  • I am ddemaree (https://keybase.io/ddemaree) on keybase.
  • I have a public key whose fingerprint is BEA0 F423 C8D7 AEDD 8A45 D72D 4102 B0D5 7A7B 617A

To claim this, I am signing this object:

@ddemaree
ddemaree / talk_notes.md
Last active Dec 26, 2015
Notes and links for my Web Directions South 2013 talk
View talk_notes.md

Slides

You can view or download my slides from Speaker Deck: The Weight of the Web (Web Directions South).

Referenced in my talk

@ddemaree
ddemaree / _retina.scss
Created Apr 26, 2013
Example Sass mixin for a "bulletproof" Hi-DPI media query
View _retina.scss
@mixin retina($ratio: 1.5) {
$dpi: $ratio * 96;
$opera-ratio: $ratio * 100;
@media only screen and (-webkit-min-device-pixel-ratio: #{$ratio}),
only screen and ( -o-min-device-pixel-ratio: '#{$opera-ratio}/100'),
only screen and ( min-resolution: #{$dpi}dpi),
only screen and ( min-resolution: #{$ratio}dppx) {
@content;
}
@ddemaree
ddemaree / application_controller.rb
Created Sep 6, 2012
Sample code for WCR2012 lightning talk
View application_controller.rb
class ApplicationController < ActionController::Base
def current_user
User.find_by_id(session[:user_id])
end
def current_user=(user)
session[:user_id] = user.id
end
@ddemaree
ddemaree / DDImportOperation.h
Created Jul 7, 2012
Multi-threaded Core Data import example
View DDImportOperation.h
@interface DDImportOperation
@property (strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
-(void)initWithPersistentStoreCoordinator:(NSPersistentStoreCoordinator*)persistentStoreCoordinator;
-(void)saveChanges;
@end
@ddemaree
ddemaree / 01_versioned.sql
Created Jun 27, 2012
Example of my versioning problem from earlier, or: things that were easier before ORMs
View 01_versioned.sql
CREATE TABLE items (
uuid VARCHAR(255) NOT NULL PRIMARY KEY,
name VARCHAR(255) NOT NULL DEFAULT '');
CREATE TABLE item_versions (
uuid VARCHAR(255) NOT NULL PRIMARY KEY,
version INT(64) NOT NULL UNIQUE AUTO_INCREMENT,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
INSERT INTO items(uuid, name) VALUES("APP_GENERATED_ID", "An item");
@ddemaree
ddemaree / shell_output.txt
Created May 15, 2012
Error compiling Core Data model in RubyMotion 1.4
View shell_output.txt
› rake
Build ./build/iPhoneSimulator-5.1-Development
Build ./vendor/AFNetworking
Link ./build/iPhoneSimulator-5.1-Development/CB Ruby.app/CB Ruby
Compile ./resources/Cashbox.xcdatamodeld
./resources/Cashbox.xcdatamodeld:0: error: Compilation failed for data model at path './resources/Cashbox.momd/Cashbox.mom'
rake aborted!
Command failed with status (1): ["/Applications/Xcode.app/Contents/Develope...]
Tasks: TOP => default => simulator => build:simulator
@ddemaree
ddemaree / 01_rubymotion.mdown
Created May 9, 2012
DRAFT: RubyMotion first impressions
View 01_rubymotion.mdown

Title: RubyMotion first impressions

For the last couple of days I've been playing with RubyMotion, Laurent Sansonetti's amazing new toolchain that allows developers to write fully-fledged, native Cocoa apps for iOS using MacRuby. Having seen some of what the MacRuby community is doing with it, heard what guys like Marco Arment and John Siracusa have to say about it, and having cut myself on some of its rough edges, it feels like a good time to stop and take down some first impressions.

What I like

While it's true RubyMotion isn't that much less of a black box than Xcode — in that it's still a proprietary framework that slurps in code and spits out either errors or a working iOS app — being able to configure and build a project using only a Ruby Rakefile feels much simpler and nicer.

RubyMotion's configuration DSL is simple and task-oriented, and effectively does a job that in Xcode is spread across six or seven (or more?) different .plist files or project settings.

View 2012-04-27-cucumber.mdown

RubySource Talks to Matt Wynne About Cucumber

Link: http://rubysource.com/matt-wynne-on-using-cucumber/

Wynne is the co-author (with Aslak Hellesøy) of Pragmatic's The Cucumber Book. In this interview by Pat Shaughnessy, he explains a bit about what Cucumber is for and how it can help teams deliver good software:

Q: So do you view Cucumber as a pair or group programming tool?

Wynne: I view it as a team communication or collaboration tool really. So by playing the game, forcing yourselves to try to describe what you want the software to do, together, what you end up doing is surfacing all the things that you haven’t actually figured out yet and all the things that you’re not really sure about. This is what Dan North calls deliberate discovery.

You can’t perform that action at this time.