Skip to content

Instantly share code, notes, and snippets.

Avatar

David Demaree ddemaree

View GitHub Profile
@ddemaree
ddemaree / schema.js
Last active November 9, 2022 00:59
Example of WordPress–Sanity import
View schema.js
// First, we must import the schema creator
import createSchema from "part:@sanity/base/schema-creator";
// Then import schema types from any plugins that might expose them
import schemaTypes from "all:part:@sanity/base/schema-type";
// We import object and document schemas
import blockContent from "./blockContent";
import category from "./category";
import post from "./post";
@ddemaree
ddemaree / no-more-masters.md
Last active February 4, 2022 16:14
Draft blog post for renaming Git master branches
View no-more-masters.md

No More Masters

In my book Git for Humans, published in 2016, I made copious references to master as the primary branch name used in Git repositories.

The term master can refer to a "master copy," meaning the original or canonical version of something from which other copies are made. But its primary meaning in the English language is "a person who has general authority over others." And, especially in American and British English, it's hard to separate the word "master," and that meaning of it, from another related word: "slave."

If we're being honest, folks in tech have known that "master" and "slave" are problematic terms for a while, even if they haven't felt motivated to change them. There are those who say that if these words refer to objects or systems, rather than people, then they can't be offensive, just as people argue that tech is a meritocracy and algorithms can't be biased. These argument

@ddemaree
ddemaree / 0_story.md
Created April 24, 2015 16:48
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 December 26, 2015 18:09
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 April 26, 2013 20:49
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 September 6, 2012 15:56
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 July 7, 2012 14:46
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 June 27, 2012 21:02
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 12:28
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