Skip to content

Instantly share code, notes, and snippets.

View codeOfRobin's full-sized avatar

Robin codeOfRobin

View GitHub Profile
func fibonacci(_ number: Int, memoizingDict: inout [Int: Int]) -> Int {
switch number {
case 0:
return 0
case 1:
return 1
default:
let numberMinus1: Int
let numberMinus2: Int
if memoizingDict[number - 1] == nil {
import Foundation
import XCTest
func isPermutationOfPalindrome(_ string: String) -> Bool {
let characterCounts: [Character: Int] = string.reduce(into: [:], { (dict, character) in
dict[character] = (dict[character] == nil) ? 1 : (dict[character] ?? 0) + 1
})
// Do I really need to do this? 🤔
let keys = Array(characterCounts.keys)
function towerover --description 'Opens the current folder in Tower.app'
open -a /Applications/Tower.app/ .
end
@codeOfRobin
codeOfRobin / MarketingName.py
Created September 11, 2018 05:19
Tiny script to get the "marketing name" of your 🖥/💻
#!/usr/bin/python
import sys
import plistlib
import subprocess
from Cocoa import NSBundle
if (len(sys.argv) == 2):
model = sys.argv[1]
else:
//: [Previous](@previous)
import Foundation
class DummyAtomic<Value> {
var value: Value
init(_ value: Value) {
self.value = value
function clapify --description 'Replaces words with claps a la https://handclaps.io'
set temp (string join ' 👏 ' $argv)
echo $temp | pbcopy
printf "successfully copied handclapped message $temp"
end
<div id="root"></div>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="https://unpkg.com/prop-types@15.6/prop-types.min.js"></script>
<script type="text/babel">
let rootElement = document.getElementById("root")
function SayHello(props) {
//
// TagNode.swift
// ChannelExample
//
// Created by Robin Malhotra on 24/04/18.
// Copyright © 2018 Robin Malhotra. All rights reserved.
//
import AsyncDisplayKit
//
// TagCell.swift
// ChannelExample
//
// Created by Robin Malhotra on 24/04/18.
// Copyright © 2018 Robin Malhotra. All rights reserved.
//
import AsyncDisplayKit
//
// ChannelCell.swift
// ChannelExample
//
// Created by Robin Malhotra on 23/04/18.
// Copyright © 2018 Robin Malhotra. All rights reserved.
//
import AsyncDisplayKit