Author: Chris Lattner
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
static const char *kMyQueueSentinel = "🐔"; | |
- (instancetype)init { | |
... | |
_serialQueue = dispatch_queue_crete("com.my.serialqueue", DISPATCH_QUEUE_SERIAL); | |
dispatch_queue_set_specific(self.serialQueue, kMyQueueSentinel, (void *)1, NULL); | |
... | |
} | |
static inline void _performOnSerialQueue(dispatch_block_t myBlock) { |
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
_setupQueue = dispatch_queue_create("com.fark.setup", DISPATCH_QUEUE_SERIAL); | |
_setupSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_DATA_OR, 0, 0, _setupQueue); | |
dispatch_source_set_event_handler(_setupSource, ^{ | |
[weakSelf _reload]; | |
}); | |
dispatch_resume(_setupSource); | |
... | |
- (void)_signalAccountReload { |
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
// | |
// StateMachineExample | |
// | |
// Created by Jacob Farkas on 6/4/14. | |
// | |
#import <Foundation/Foundation.h> | |
#define DownloadTempPath "/tmp/tacosXXXXXX" |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
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
#!/usr/bin/ruby | |
require 'fileutils' | |
include FileUtils::Verbose | |
$rickRollFile="/Volumes/Media/.RickRoll.mp3" | |
def rickRollDir(sourceDir, destDir) | |
for filename in Dir.entries(sourceDir) | |
next if filename=~/\.\.?$/ |