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 cato 1.2 | |
import Foundation | |
class OptCls: NSObject { | |
dynamic var s: String? | |
dynamic var nos: String = "" | |
dynamic var nss: NSString? | |
dynamic var ius: String! | |
dynamic var i: Int = 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
#import <objc/runtime.h> | |
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
IMP imp = imp_implementationWithBlock(^id(id self, id block, id arg){ | |
NSLog(@"self: %@, arg: %@", self, arg); | |
return self; | |
}); | |
class_addMethod([NSObject class], @selector (foo), imp, "@@:@"); |
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/ruby | |
versions = `rbenv versions --bare`.split("\n").map(&:strip) | |
warn "rbenv not installed" && exit(1) unless $?.success? | |
versions.each do |v| | |
puts "rbenv shell #{v}" | |
puts | |
system({"RBENV_VERSION" => v}, ARGV.join(' ')) | |
puts '-' * 80 |
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 | |
app = requested = ARGV.shift | |
unless File.executable?(app) | |
escaped_app = app.gsub(/(.)/, '\\\\\1') | |
app = Dir.glob("/Applications/#{escaped_app}.app/Contents/MacOS/{#{escaped_app},*}").first | |
end | |
Process.detach Process.spawn([app, requested], *ARGV, err: '/dev/null', out: '/dev/null') |
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 Typed { | |
typealias Element | |
func elem() -> Element | |
} | |
struct Concrete<T>: Typed { | |
typealias Element = T | |
let e: T | |
func elem() -> T { | |
return e |
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 'pathname' | |
code_files = ARGV | |
code_files.each do |file| | |
file = Pathname(file) | |
contents = file.read | |
contents.gsub!(/(^#import .*\n)+/) do |imports| | |
imports = imports.split("\n") | |
imports.sort.uniq.join("\n") << "\n" |
OlderNewer