Skip to content

Instantly share code, notes, and snippets.

Damien DeVille ddeville

Block or report user

Report or block ddeville

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
View keybase.md

Keybase proof

I hereby claim:

  • I am ddeville on github.
  • I am ddeville (https://keybase.io/ddeville) on keybase.
  • I have a public key ASDmES-E7HI6XQtpt82tRK2_gSj34to_05USfnddUUlorwo

To claim this, I am signing this object:

@ddeville
ddeville / gist:f9e78799cd5247f6dbfb
Created Jul 19, 2014
Find all tracks that match a given bit rate in iTunes and create a new playlist containing them
View gist:f9e78799cd5247f6dbfb
set track_bpm to 270
set playlist_name to "My Playlist"
tell application "iTunes"
set retrieved_tracks to get tracks where bit rate is track_bpm
set created_playlist to make new user playlist with properties {name:playlist_name}
repeat with current_track in retrieved_tracks
duplicate current_track to created_playlist
end repeat
@ddeville
ddeville / gist:b4db80697605474114bb
Created Jul 16, 2014
Create a bookmark in Spillo for every tab in the current Safari window
View gist:b4db80697605474114bb
tell application "Safari"
set current_tabs to tabs of front window
repeat with current_tab in current_tabs
set tab_title to name of current_tab
set tab_address to URL of current_tab
tell application "Spillo"
make new bookmark with properties {url:tab_address, title:tab_title}
end tell
@ddeville
ddeville / gist:118a4eb1b52483228383
Created Jul 12, 2014
Create a new bookmark in Spillo with the content from the frontmost tab in Safari
View gist:118a4eb1b52483228383
tell application "Safari"
set current_tab to current tab of front window
set tab_title to name of current_tab
set tab_address to URL of current_tab
tell application "Spillo"
make new bookmark with properties {url:tab_address, title:tab_title}
end tell
end tell
@ddeville
ddeville / gist:dc6ba4346604ab4d6b65
Created Jul 12, 2014
Present the bookmark creation window in Spillo and populate it with the content from the frontmost tab in Safari
View gist:dc6ba4346604ab4d6b65
tell application "Safari"
set current_tab to current tab of front window
set tab_title to name of current_tab
set tab_address to URL of current_tab
tell application "Spillo"
show create bookmark panel with properties {url:tab_address, title:tab_title}
end tell
end tell
@ddeville
ddeville / gist:90f341f6ed7c592900ab
Last active Aug 29, 2015
Get the actual home directory when running in the OS X sandbox
View gist:90f341f6ed7c592900ab
#import <unistd.h>
#import <pwd.h>
NSURL *_LLActualHomeDirectoryLocation(void) {
static NSURL *homeDirectoryLocation = nil;
static dispatch_once_t homeDirectoryLocationPredicate = 0;
dispatch_once(&homeDirectoryLocationPredicate, ^ {
uid_t uid = getuid();
View Salinger list of works
The Young Folks (1940)
Go See Eddie (1940)
The Hang of It (1941)
The Heart of a Broken Story (1941)
The Long Debut of Lois Taggett (1942)
Personal Notes of an Infantryman (1942)
Mrs. Hincher (Unpublished) (1942)
The Last and Best of the Peter Pans (Unpublished) (1942)
The Varioni Brothers (1943)
Both Parties Concerned (1944)
@ddeville
ddeville / gist:7173457
Created Oct 26, 2013
NSArrayController and +keyPathsForValuesAffectingValueForKey:
View gist:7173457
//
// main.m
// KVO
//
// Created by Damien DeVille on 10/26/13.
// Copyright (c) 2013 Damien DeVille. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@ddeville
ddeville / gist:7169443
Last active Dec 26, 2015
+keyPathsForValuesAffectingValueForKey: vs +keyPathsForValuesAffecting<Key>.
View gist:7169443
//
// main.m
// KVO
//
// Created by Damien DeVille on 10/26/13.
// Copyright (c) 2013 Damien DeVille. All rights reserved.
//
#import <Foundation/Foundation.h>
@ddeville
ddeville / gist:7103822
Created Oct 22, 2013
Think of a parent view controller that contains two children view controllers. The title of the parent view controller is a mixture of the titles of its children. The title of the second view controller depends on the name of its represented object too. Now, one would only need to bind the title of the window (for example) to the parent view con…
View gist:7103822
@interface ParentViewController : NSViewController
@property (strong, nonatomic) FirstChildViewController *firstViewController;
@property (strong, nonatomic) SecondChildViewController *secondViewController;
@end
@implementation ParentViewController
You can’t perform that action at this time.