Skip to content

Instantly share code, notes, and snippets.

View hurshagrawal's full-sized avatar

Hursh Agrawal hurshagrawal

View GitHub Profile
@hurshagrawal
hurshagrawal / keybase.md
Created March 24, 2018 03:44
keybase.md

Keybase proof

I hereby claim:

  • I am hurshagrawal on github.
  • I am hursh (https://keybase.io/hursh) on keybase.
  • I have a public key ASBJc95ZSP9qocxCUEzsfBe337A8sGqz8sGk7qM-EeBjqgo

To claim this, I am signing this object:

# First set the path to sentry.properties
export SENTRY_PROPERTIES=sentry.properties
# Setup nvm and set node
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
. "$HOME/.nvm/nvm.sh"
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
. "$(brew --prefix nvm)/nvm.sh"
// Copyright © 2017 Jumprope. All rights reserved.
import Foundation
// From: https://stackoverflow.com/questions/32322386/how-to-download-multiple-files-sequentially-using-nsurlsession-downloadtask-in-s
// Asynchronous operation base class
//
// This is abstract to class performs all of the necessary KVN of `isFinished` and
// `isExecuting` for a concurrent `Operation` subclass. You can subclass this and
/// Manager of asynchronous download `Operation` objects
class DownloadManager: NSObject {
/// Dictionary of operations, keyed by the `taskIdentifier` of the `URLSessionTask`
fileprivate var operations = [Int: DownloadOperation]()
/// Serial NSOperationQueue for downloads
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
@hurshagrawal
hurshagrawal / SwiftUI_API.swift
Last active August 29, 2015 14:02
This is a super v0.1 of what I think a new UI API may look like.
// Benefits:
// - UI is nested, making it easy to tell what contains what UI elements
// - All UI is *one file* - no need to hunt down other files/locations (UITableViewCells, for example).
// This is a huge boon to productivity. Going back to edit this means I only have to look in one place.
// - All event handling info is inline with the UI, making it easy to tell what is interacting how.
// (Not very different from current target:action: methods, tbh)
// - Styling and layout is separated out, and styling allows for inheritence to keep it DRY
// - All UI and styling is declarative (as much as possible), so there's no "order" of doing things, reducing complexity.
// Cons:
$ ->
window.BR ||= {}
BR.userListWidget = new BR.UserListWidget $('#user-list'),
length: 20
#!/usr/bin/env bash
sudo apt-get -y update
sudo apt-get -y install git-core build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion libpq-dev xvfb -y
sudo bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
sudo usermod -a -G rvm ubuntu
echo 'gem: --no-rdoc --no-ri' > ~/.gemrc
# Log out and back in
rvm install 1.9.3-p194
---\n- 42\n- 1\n- 66\n- 37163\n- 35\n- 53\n- 2\n- 4\n- 7\n- 51\n- 8\n- 9\n- 10\n- 11\n- 12\n- 78\n- 14\n- 15\n- 17\n- 18\n- 57\n- 20\n- 6\n- 23\n- 24\n- 25\n- 26\n- 27\n- 29\n- 30\n- 31\n- 32\n- 45\n- 79\n- 36\n- 33\n- 38\n- 40\n- 41\n- 43\n- 44\n- 46\n- 47\n- 49\n- 50\n- 37\n- 52\n- 34\n- 56\n- 21\n- 58\n- 59\n- 60\n- 61\n- 39\n- 63\n- 64\n- 5\n- 67\n- 68\n- 69\n- 70\n- 71\n- 72\n- 73\n- 74\n- 76\n- 62\n- 28\n- 80\n- 81\n- 82\n- 83\n- 19\n- 16\n- 55\n- 13\n- 107\n- 138\n- 118\n- 98\n- 37164\n- 136\n- 91\n- 132\n- 37174\n- 165\n- 123\n- 51826\n- 84\n- 86\n- 87\n- 89\n- 99\n- 93\n- 94\n- 96\n- 97\n- 100\n- 92\n- 101\n- 102\n- 103\n- 104\n- 90\n- 160\n- 111\n- 109\n- 153\n- 164\n- 125\n- 113\n- 114\n- 105\n- 117\n- 119\n- 120\n- 121\n- 122\n- 124\n- 139\n- 110\n- 127\n- 128\n- 129\n- 126\n- 131\n- 133\n- 134\n- 135\n- 137\n- 144\n- 140\n- 142\n- 143\n- 130\n- 146\n- 147\n- 148\n- 149\n- 151\n- 152\n- 154\n- 155\n- 156\n- 158\n- 159\n- 162\n- 161\n- 116\n- 166\n- 167\n- 163\n- 108\n- 176\n- 230\n- 170\n- 224\n-
"\x04\b[\x02,.i/i\x06iGi\x02+\x91i(i:i\ai\ti\fi8i\ri\x0Ei\x0Fi\x10i\x11iSi\x13i\x14i\x16i\x17i>i\x19i\vi\x1Ci\x1Di\x1Ei\x1Fi i\"i#i$i%i2iTi)i&i+i-i.i0i1i3i4i6i7i*i9i'i=i\x1Ai?i@iAiBi,iDiEi\niHiIiJiKiLiMiNiOiQiCi!iUiViWiXi\x18i\x15i<i\x12ipi\x01\x8Ai{igi\x02,\x91i\x01\x88i`i\x01\x84i\x026\x91i\x01\xA5i\x01{i\x02r\xCAiYi[i\\i^ihibicieifiiiaijikilimi_i\x01\xA0itiri\x01\x99i\x01\xA4i\x01}iviwinizi|i}i~i\x7Fi\x01|i\x01\x8Bisi\x01\x7Fi\x01\x80i\x01\x81i\x01~i\x01\x83i\x01\x85i\x01\x86i\x01\x87i\x01\x89i\x01\x90i\x01\x8Ci\x01\x8Ei\x01\x8Fi\x01\x82i\x01\x92i\x01\x93i\x01\x94i\x01\x95i\x01\x97i\x01\x98i\x01\x9Ai\x01\x9Bi\x01\x9Ci\x01\x9Ei\x01\x9Fi\x01\xA2i\x01\xA1iyi\x01\xA6i\x01\xA7i\x01\xA3iqi\x01\xB0i\x01\xE6i\x01\xAAi\x01\xE0i\x02\xA5\x06i\x02s\xCAi\x02\x9F\xCAi\x02\xC7\xCAi\x02\x90\xC6i\x02\xA9\xCAi\x02\x87\xCAi\x02\x9B\xD0i\x02\x9E\xCAi\x02w\xCAi\x02{\xCAi\x01\xAFi\x01\xA9i\x02\xF7\xD9i\x01\xBDi\x01\xBFi\x01\xADi\x01\xAEi\x02\x8F\xCAi\x01\xB1i\x01\xB2i\x01\xB3i\x01\xB4i\x01\xB5i\x01\xCCi\x01\xB8i\x01\xB9i\x01\xB