-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
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
#!/usr/bin/osascript | |
on run argv | |
set theFilePath to POSIX file (item 1 of argv) | |
set theFolder to theFilePath as alias | |
tell application "System Events" to set theDocs to theFolder's items whose name extension = "numbers" | |
repeat with aDoc in theDocs | |
set docName to aDoc's name as text |
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 AVFoundation | |
import Foundation | |
// The maximum number of audio buffers in flight. Setting to two allows one | |
// buffer to be played while the next is being written. | |
private let kInFlightAudioBuffers: Int = 2 | |
// The number of audio samples per buffer. A lower value reduces latency for | |
// changes but requires more processing but increases the risk of being unable | |
// to fill the buffers in time. A setting of 1024 represents about 23ms of |
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
# Uncrustify config file for objective-c and objective-c++ | |
################################################################################################### | |
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs | |
output_tab_size = 4 # new tab size | |
indent_columns = output_tab_size | |
indent_label = 2 # pos: absolute col, neg: relative column | |
indent_align_assign = FALSE | |
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
Pod::Spec.new do |s| | |
s.name = "ReactiveCocoa" | |
s.version = "2.0-development" | |
s.summary = "A framework for composing and transforming sequences of values." | |
s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source" | |
s.author = { "Josh Abernathy" => "[email protected]" } | |
s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoa.git", :branch => "fishhook-off-device" } | |
s.license = 'Simplified BSD License' | |
s.description = "ReactiveCocoa offers:\n" \ | |
"1. The ability to compose operations on future data.\n" \ |
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
#define MSDesignatedInitializer(__SEL__) __attribute__((unavailable("Invoke the designated initializer `" # __SEL__ "` instead."))) | |
// Sample usage: | |
- (instancetype)initWithObject:(id)object; | |
- (instancetype)init MSDesignatedInitializer(initWithObject:); // <- This even gets auto-complete. | |
// Now calling init on this class would throw a warning. |
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
BOOL ProtocolContainsInstanceSelector(NSString *protocolName, SEL sel); | |
BOOL ProtocolContainsInstanceSelector(NSString *protocolName, SEL sel) | |
{ | |
Protocol *p = objc_getProtocol([protocolName cStringUsingEncoding:NSUTF8StringEncoding]); | |
// must check for both required = {YES, NO} | |
struct objc_method_description desc = protocol_getMethodDescription(p, sel, YES, YES); | |
BOOL contains = desc.name != NULL && desc.types != NULL; | |
if (!contains) { |
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
(load-file "./watch_service.clj") | |
(refer 'watch-service) | |
(defn print-ev | |
[ev ctx] | |
(println "[foo]" ev " --> " ctx) | |
(println "Parent Dir:" (.getParent ctx))) | |
(defn print-ev-2 | |
[ev ctx] |
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
#include <unistd.h> | |
#include <CoreServices/CoreServices.h> | |
#include <ApplicationServices/ApplicationServices.h> | |
typedef int CGSConnection; | |
extern OSStatus CGSGetWorkspace(const CGSConnection cid, int *workspace); | |
extern OSStatus CGSSetWorkspace(const CGSConnection cid, int workspace); | |
extern CGSConnection _CGSDefaultConnection(void); | |
int get_space_id(void); |