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
protocol Calendar { | |
typealias Unit: BidirectionalIndexType | |
typealias Era: Unit | |
typealias Year: Unit | |
typealias Month: Unit | |
typealias Week: Unit | |
typealias Day: Unit | |
typealias Weekday: Unit | |
typealias Hour: Unit |
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/env ruby | |
require 'rubygems' | |
require 'date' | |
require 'json' | |
input = JSON.parse(ARGF.read) | |
output = { 'meta' => { 'timestamp' => DateTime.now.strftime('%Y-%m-%d %H:%M:%S.%6N') } } | |
symbols = {} |
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
// Let's define a basic Swift class. | |
class Fruit { | |
var type=1 | |
var name="Apple" | |
var delicious=true | |
} | |
// We can get at some info about an instance of an object using reflect(), which returns a Mirror. | |
reflect(Fruit()).count | |
reflect(Fruit())[1].0 |
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
""" | |
Automate loading of F-Script Anywhere into any app. | |
By Daniel Jalkut - @danielpunkass - http://indiestack.com/ | |
To set up: | |
0. Make sure you have FScript.framework installed in /Library/Frameworks (http://www.fscript.org) | |
1. Copy this script to ~/.lldb/fsa.py | |
2. Add the following to your ~/.lldbinit file: |
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 lldb | |
import re | |
import shlex | |
# This script allows Xcode to selectively ignore Obj-C exceptions | |
# based on any selector on the NSException instance | |
def getRegister(target): | |
if target.triple.startswith('x86_64'): | |
return "rdi" |
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
#!/bin/sh | |
# 2021-12-09: | |
# This script is no longer supported! | |
# Apple broke all direct downloads without logging with an Apple ID first. | |
# The number of hoops that a script would need to jump through to login, | |
# store cookies, and download is prohibitive. | |
# Now we all must manually download and mirror the files for this to work at all :'-( | |
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}') |
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
NSArray *albums = @[[Album albumWithName:@"Random Access Memories" price:9.99f], | |
[Album albumWithName:@"Clarity" price:6.99f], | |
[Album albumWithName:@"Weekend in America" price:7.99f], | |
[Album albumWithName:@"Weekend in America" price:7.90f], | |
[Album albumWithName:@"Bangarang EP" price:2.99f]]; | |
// Reversing an Array | |
__unused NSArray *reversed = albums.reverseObjectEnumerator.allObjects; | |
// PREDICATES |
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
BASE_COMMIT=$(echo {\"diff_id\": ${DIFF_ID}} | arc call-conduit differential.getdiff | awk -v RS=',' -v FS=':' '$1~/\"sourceControlBaseRevision\"/ {print $2}' | tr -d \") | |
# Update repo (can be taken care of by jenkins too) | |
git fetch --all | |
git remote prune origin | |
# We only want to test the diff so reset to base | |
git reset --hard ${BASE_COMMIT} | |
git clean -fdx |
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
package main | |
import ( | |
"fmt" | |
) | |
type SetTest struct { | |
val string | |
result chan bool | |
} |
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 <Foundation/Foundation.h> | |
@interface SafeSet : NSObject { | |
NSMutableSet *set; | |
dispatch_queue_t queue; | |
} | |
@end | |
@implementation SafeSet |
NewerOlder