Skip to content

Instantly share code, notes, and snippets.

View codeOfRobin's full-sized avatar

Robin codeOfRobin

View GitHub Profile
//
// CountNode.swift
// ChannelExample
//
// Created by Robin Malhotra on 22/04/18.
// Copyright © 2018 Robin Malhotra. All rights reserved.
//
import AsyncDisplayKit
//
// ViewController.swift
// TableViewPaging
//
// Created by Robin Malhotra on 19/03/18.
// Copyright © 2018 Robin Malhotra. All rights reserved.
//
import UIKit

Hey folks! 👋 Got kind of a gigantic question, so please bear with me

I'm trying to build a "better" client for phoenixframework.org. For those who know how phoenix works, skip the following section

How does phoenix work?

The idea is that if you want access to multiple "events", like conversations on a chat server, you make only one socket connection and it multiplexes them. You do that by telling the server “hey I want to join this channel”.

So now you’re subscribed to that channel, you get events for it.

@codeOfRobin
codeOfRobin / RxDwifft.swift
Last active March 1, 2018 18:59
Uh, I can't quite come up with a good name for this
//
//
// Created by Robin Malhotra on 29/01/18.
//
// Special thanks to DaveDelong for suggesting this: https://github.com/davedelong/Syzygy/blob/master/SyzygyCore/Properties/Property%2BCollections.swift#L76
import RxSwift
import Dwifft
@codeOfRobin
codeOfRobin / .gitignore
Created January 23, 2018 08:01
My swift gitignore
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "Networking",
products: [
.library(name: "Networking", targets: ["Networking"]),
],
targets: [
.target(

Spacemacs: The good, The bad and the nice

I’ve recently started using spacemacs as my weapon of choice for non-iOS work. I must say, I’m pleasantly surprised. I’ve seen my colleagues’ esoteric Haskell/Python Vim setups and walked away, disappointed in the fact that their setups weren’t even as polished as Xcode’s defaults (don’t @ me).

But I recently had to start writing code in elixir for a side project and came across this blog post: Spacemacs and Alchemist to make Elixir of immortality

Since then, I’ve been looking at spacemacs, going through their beginner’s guide(which is weirdly hidden on their website: Beginners tutorial) and generally spelunking around.

Things I like

#check if env-vars.sh exists
if [ -f ./env-vars.sh ]
then
source ./env-vars.sh
fi
#no `else` case needed if the CI works as expected
./Sourcery/bin/sourcery --templates ./kayakoSwiftSDKTests --sources . --output ./kayakoSwiftSDKTests --args email=$TEST_EMAIL,password=$TEST_PASSWORD,url=$TEST_URL
public struct TestCredentials {
let email: String
let password: String
}
public let testCreds = TestCredentials(email: "{{ argument.email }}", password: "{{ argument.password }}")
source ./env-vars.sh