Skip to content

Instantly share code, notes, and snippets.

View codeOfRobin's full-sized avatar

Robin codeOfRobin

View GitHub Profile
export TEST_EMAIL=EMAIL
export TEST_PASSWORD=PASSWORD
import Foundation
import Files // marathon:https://github.com/JohnSundell/Files.git
import Unbox // marathon:https://github.com/johnsundell/unbox.git
import Commander // marathon:https://github.com/kylef/Commander.git
public func convertToBase64(_ str: String) -> String {
if let data = str.data(using: String.Encoding.utf8) {
return data.base64EncodedString()
}
else {
let socket = Socket(url: URL(string: "http://localhost:4000/socket/websocket")!)
socket.onConnect = {
let channel = self.socket.channel("rooms:lobby", payload: ["user": "spartacus"])
channel.on("new:msg", callback: { message in
print("New message: \(message)")
})
channel.join()?.receive("ok", callback: { payload in
public extension UIView {
public func getSnapshotImage() -> UIImage {
UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.isOpaque, 0)
self.drawHierarchy(in: self.bounds, afterScreenUpdates: false)
let snapshotImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return snapshotImage
}
}
enum FontSize {
static var pageTitle = UIFont.preferredFont(forTextStyle: .title1).pointSize,// 28
subTitle1 = UIFont.preferredFont(forTextStyle: .title2).pointSize,//22
subtitle2 = UIFont.preferredFont(forTextStyle: .title3).pointSize,//20
body = UIFont.preferredFont(forTextStyle: .body).pointSize,//17
callout = UIFont.preferredFont(forTextStyle: .callout).pointSize,//16
subHeading = UIFont.preferredFont(forTextStyle: .subheadline).pointSize,//15
footnote = UIFont.preferredFont(forTextStyle: .footnote).pointSize, //13
smallTitle = UIFont.preferredFont(forTextStyle: .caption2).pointSize //11
}

Lightning talk on ATP episode 205

Caution - Ahead be spoilers!!

  1. John, Casey and Marco
  2. Chris Lattner is on the show. Creator of LLVM and Swift. Now working at Tesla on automotive software (he later calls it autopilot, so ¯_(ツ)_/¯
  3. LLVM is a collection of compiler infrastructure projects.
  4. Ex: SourceKit leverages LLVM (rather than a monolith, access underlying services)
  5. LLVM first used in  OpenGL stuff to repack buffers for various GPUs. Code gen stuff. llvm bytecode files -> GPU machine code 😳

SOOPER SECRET OSS PLANS 2017

2016 has been an amazing year for me. I’ve landed a job I love (find me here ), and life overall has been great (I haven’t put on an urgent alarm on my phone since I’ve graduated, been sleeping atleast 7 hours a day, started playing Overwatch, my 🏀 skills are on point etc.). I have a lot to be thankful about, is what I’m saying.

This year, I’ve decided to challenge myself a bit more and decided I’ll spend my non work time contributing to OSS as much as possible. To that effect, I’ve compiled a list of projects I’m interested in doing. The list is ⏬, but I’ll first explain my categories/philosophy behind them first.

  • I love being challenged. I’ve pretty much been solving simple problems with my latest projects, but I feel like I need to level up
  • Swift is ❤️💜💙💛💚 . It’s a great language that scales well from system level stuff, all the way to the top of the stack, and writing in Swift has been a pleasure and joy for me.
  • I want to wo
lane :travis do
increment_build_number
cocoapods
carthage(command: "update",
use_ssh: "true",
no_skip_current: false,
use_binaries: false,
platform: "iOS")
@codeOfRobin
codeOfRobin / open iterm.scpt
Created December 19, 2016 07:24
open current folder in iTerm with Apple Script
on run {input, parameters}
tell application "Finder"
set dir_path to quoted form of (POSIX path of (folder of the front window as alias))
end tell
CD_to(dir_path)
end run
on CD_to(theDir)
tell application "iTerm"
activate
//Extensions for Pantry using reflection. Default implementation
public protocol Pantryable: Storable {
func allProperties() throws -> [String: Any]
func toDictionary() -> [String : AnyObject]
}
extension Pantryable {