I hereby claim:
- I am frozzare on github.
- I am frozzare (https://keybase.io/frozzare) on keybase.
- I have a public key ASAu0jk21efZkw07DoY2EDMh07y_9lAYvXG95G0z98CooAo
To claim this, I am signing this object:
root = true | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_style = space | |
indent_size = 2 | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
import Foundation | |
class Request : NSObject { | |
var url : NSURL? = nil | |
var request : NSMutableURLRequest? = nil | |
var response : NSHTTPURLResponse? = nil | |
var data: NSMutableData? = nil | |
var done: (NSError?, NSData, NSString?) -> () = { (_, _, _) -> () in } |
I hereby claim:
To claim this, I am signing this object:
extension Int { | |
func times (iterator: () -> Void) { | |
for _ in 0..self { | |
iterator() | |
} | |
} | |
func downto (to : Int, iterator: (Int) -> Void) { | |
var num : Int = self |
import Foundation | |
class Template { | |
class func render (var str: String, dict: Dictionary<String, String>) -> String { | |
for (key, value) in dict { | |
str = str.stringByReplacingOccurrencesOfString("{\(key)}", withString: value) | |
} | |
return str | |
} |
package main | |
// reactWrapper fix issues with dynamic routes created | |
// in `react-router` so we don't get a 404 page. | |
// | |
// usage: http.Handle("/", reactWrapper(http.FileServer("path/to/public"))) | |
func reactWrapper(fs http.Handler) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { | |
staticIndex := strings.Index(req.URL.Path, "/static/") |
import Foundation | |
extension Array { | |
/** | |
* Get first item in array. | |
* | |
* @return First item in array. | |
*/ | |
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
import Foundation | |
class File { | |
class func exists (path: String) -> Bool { | |
return NSFileManager().fileExistsAtPath(path) | |
} | |
class func read (path: String, encoding: NSStringEncoding = NSUTF8StringEncoding) -> String? { | |
if File.exists(path) { |
import Foundation | |
extension String { | |
func exec (str: String) -> Array<String> { | |
var err : NSError? | |
let regex = NSRegularExpression(pattern: self, options: NSRegularExpressionOptions(0), error: &err) | |
if err { | |
return Array<String>() | |
} | |
let nsstr = str as NSString |