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
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 { |
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 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) |
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
function towerover --description 'Opens the current folder in Tower.app' | |
open -a /Applications/Tower.app/ . | |
end |
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/python | |
import sys | |
import plistlib | |
import subprocess | |
from Cocoa import NSBundle | |
if (len(sys.argv) == 2): | |
model = sys.argv[1] | |
else: |
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
//: [Previous](@previous) | |
import Foundation | |
class DummyAtomic<Value> { | |
var value: Value | |
init(_ value: Value) { | |
self.value = value |
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
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 |
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
<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) { |
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
// | |
// TagNode.swift | |
// ChannelExample | |
// | |
// Created by Robin Malhotra on 24/04/18. | |
// Copyright © 2018 Robin Malhotra. All rights reserved. | |
// | |
import AsyncDisplayKit |
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
// | |
// TagCell.swift | |
// ChannelExample | |
// | |
// Created by Robin Malhotra on 24/04/18. | |
// Copyright © 2018 Robin Malhotra. All rights reserved. | |
// | |
import AsyncDisplayKit |
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
// | |
// ChannelCell.swift | |
// ChannelExample | |
// | |
// Created by Robin Malhotra on 23/04/18. | |
// Copyright © 2018 Robin Malhotra. All rights reserved. | |
// | |
import AsyncDisplayKit |
NewerOlder