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 swift | |
import Foundation | |
var path = (Process.arguments[0] as NSString) | |
path = path.stringByDeletingLastPathComponent | |
path = String(CString:realpath(path.cStringUsingEncoding(NSUTF8StringEncoding), nil), | |
encoding: NSUTF8StringEncoding)! | |
print("\(path) \n") |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
14513878 | |
13185872 | |
138908422 | |
3036621918 | |
168831662 | |
113138090 | |
28338715 | |
14789498 | |
148207025 | |
5501422 |
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 'cocoapods' | |
require 'fileutils' | |
def podfile_from_spec(spec) | |
podfile = File.open('Podfile', 'w') | |
podfile.write(<<-EOF | |
platform :ios, '8.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
require 'githop' | |
require 'sinatra' | |
def githop_html(user) | |
config = { | |
'bigquery' => { | |
'client_id' => ENV['BIGQUERY_CLIENT_ID'], | |
'service_email' => ENV['BIGQUERY_SERVICE_EMAIL'], | |
'keyfile' => ENV['BIGQUERY_KEYFILE'], | |
'project_id' => ENV['BIGQUERY_PROJECT_ID'] |
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 'fileutils' | |
require 'xcodeproj' | |
# Find all workspaces, but reject the subproject ones | |
workspaces = Dir.glob('**/*.xcworkspace').reject { |w| w.end_with?('project.xcworkspace') } | |
schemes = workspaces.map do |workspace| | |
# Find all pod targets | |
targets = `xcodebuild -workspace #{workspace} -list 2>&1`.split("\n").select { |t| t.match(/Pods/) } |
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
$ grep -ri wireless * | |
DTDeviceKitBase/DTDKRemoteDeviceConnection.h: _Bool _wireless; | |
DTDeviceKitBase/DTDKRemoteDeviceConnection.h:@property(readonly, getter=isWireless) _Bool wireless; // @synthesize wireless=_wireless; | |
DTDeviceKitBase/DTDKRemoteDeviceToken.h: DTDKRemoteDeviceConnection *_primaryWirelessConection; | |
DTDeviceKitBase/DTDKRemoteDeviceToken.h:+ (id)keyPathsForValuesAffectingHasWirelessConnection; | |
DTDeviceKitBase/DTDKRemoteDeviceToken.h:@property(retain, nonatomic) DTDKRemoteDeviceConnection *primaryWirelessConection; // @synthesize primaryWirelessConection=_primaryWirelessConection; | |
DTDeviceKitBase/DTDKRemoteDeviceToken.h:- (id)takeWirelessPowerAssertionWithName:(id)arg1 deatils:(id)arg2 andTimeout:(double)arg3; | |
DTDeviceKitBase/DTDKRemoteDeviceToken.h:- (id)wirelessInstrumentsServer; | |
DTDeviceKitBase/DTDKRemoteDeviceToken.h:- (void)disableWireless; | |
DTDeviceKitBase/DTDKRemoteDeviceToken.h:- (id)enableWireless; |
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/xcrun swift -suppress-warnings | |
infix operator ∖ {} | |
public func ∖ (a: Int, b: Int) -> Int { | |
return a + b | |
} | |
let ¯ = 1 | |
let ツ = 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
#!/usr/bin/xcrun swift | |
let _ = 2 | |
let x = _ / 2 | |
println(x) |
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 'yaml' | |
def install_gem(name, version) | |
require 'rubygems/commands/install_command' | |
cmd = Gem::Commands::InstallCommand.new | |
cmd.handle_options [name, '--version', version] | |
begin |
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
int yolo = 23; | |
__unsafe_unretained id foo = (__bridge id)(void*)&yolo; | |
// CFDictionary allows not retaining values | |
typeof(@{}.mutableCopy) dict = (__bridge NSDictionary*)CFDictionaryCreateMutable(nil, 0, NULL, NULL); | |
dict[@"name"] = foo; | |
// We have to use CF APIs to avoid retaining the value here as well | |
__unsafe_unretained id foo2 = CFDictionaryGetValue((__bridge CFDictionaryRef)dict, @"name"); | |
int heh = *(int *)(__bridge void *)foo2; |