Skip to content

Instantly share code, notes, and snippets.

View adamdahan's full-sized avatar
🎯
Focusing

Adam Dahan adamdahan

🎯
Focusing
  • Toronto
View GitHub Profile
@adamdahan
adamdahan / BouncyButton.swift
Created May 8, 2022 05:38 — forked from dfelber/BouncyButton.swift
Bouncy UIButton in swift. Becomes small when pressed and restores its size when released. Swift 3
//
// BouncyButton.swift
//
// Created by Domink Felber on 20.03.16.
// Copyright © 2016 Domink Felber. All rights reserved.
//
import Foundation
import UIKit
@adamdahan
adamdahan / installNodeOnEC2.txt
Created December 3, 2018 21:37 — forked from mitchallen/installNodeOnEC2.txt
Install node.js and git on an Amazon EC2 instance
PREREQUISITES
This assumes that you have already experimented with creating instances under EC2 and know
how to use ssh keys to access an instance. If not, try experimenting with that first and
setup some keys.
This also assume that you have a Security Group with Port 80 available. If not, experiment
with creating one of those as well.
CREATE A NEW INSTANCE
@adamdahan
adamdahan / postgres-cheatsheet.md
Last active August 14, 2018 17:08 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Running SQL files against the database

psql -f thefile.sql targetdatabase

Magic words:

@adamdahan
adamdahan / curl.md
Created January 24, 2018 05:32 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
import Foundation
protocol ServiceLocator {
func getService<T>(type: T.Type) -> T?
func getService<T>() -> T?
}
extension ServiceLocator {
@adamdahan
adamdahan / 0_reuse_code.js
Created February 14, 2016 03:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console