Skip to content

Instantly share code, notes, and snippets.


Jasdev Singh jasdev

View GitHub Profile
jasdev / CustomCell.swift
Last active Jul 6, 2018
An approach to safer UITableViewCell and UICollectionViewCell reuse
View CustomCell.swift
class CustomCell: UITableViewCell, Reusable {
class var reuseIdentifier: String {
return "customCell"
class SupaHotCustomCell: CustomCell {
override class var reuseIdentifier: String {
return "supaHotCustomCell"
jasdev / AppDelegate.swift
Last active Sep 5, 2015
A Tour of UIUserNotificationAction
View AppDelegate.swift
import UIKit
enum Notifications {
enum Categories: String {
case Message
enum Actions: String {
case RemindMeLater
case Reply
jasdev /
Last active Aug 29, 2015 — forked from marcdown/
Brooklyn Swift Developers Meetup Presenters
jasdev / UpperCaseLetter.swift
Created Aug 12, 2015
Swift 2.0 gist to quickly determine if a String contains an uppercase alphabetical character
View UpperCaseLetter.swift
extension String {
func containsUpperCaseLetter() -> Bool {
let beginCodePoint = Character("A").unicodeScalarCodePoint()
let endCodePoint = Character("Z").unicodeScalarCodePoint()
for scalar in self.unicodeScalars {
if case beginCodePoint...endCodePoint = scalar.value {
return true

Keybase proof

I hereby claim:

  • I am jasdev on github.
  • I am jasdev ( on keybase.
  • I have a public key whose fingerprint is 711E 45E8 FF90 3997 AA07 6FD0 D107 2F37 4EB8 54D8

To claim this, I am signing this object:

jasdev /
Last active Aug 29, 2015
Clone repo at specific commit
clonerev() {
git clone $1
cd 'sed ${1}##/*/ s/.git//'
git reset --hard $2
# Usage: clonerev [url] [commit hash]
jasdev / gallery.js
Last active Aug 29, 2015
Fetch top 5 Gallery Items from Imgur
View gallery.js
jasdev /
Created Dec 22, 2013
quick python to generate the optimum set of RBG values for a set of size COUNT. This uses the technique outlined in this post
colors = []
for i in range(0, COUNT):
colors.append(colorsys.hsv_to_rgb(fmod(i * 0.618033988749895, 1.0), 0.5, 1.0))
View .bash_profile
export PATH
cdls() {
if [ -z "$1" ]; then
cd && ls -G
cd "$*" && ls -G
alias cd=cdls
alias pearp='/Applications/MAMP/bin/php/php5.4.4/bin/pear'
View gist:7504303
“You could take all the gold that’s ever been mined, and it would fill a cube 67 feet in each direction. For what it’s worth at current gold prices, you could buy — not some — all of the farmland in the United States. Plus, you could buy 10 Exxon Mobils (XOM), plus have $1 trillion of walking-around money. Or you could have a big cube of metal. Which would you take? Which is going to produce more value?” - Warren Buffett