Skip to content

Instantly share code, notes, and snippets.

View parinck's full-sized avatar

Parin Kataria parinck

View GitHub Profile
@parinck
parinck / zsh plugins
Created September 11, 2015 13:47
zsh plugins I use
plugins=(git git-extras gitfast git-flow git-remote-branch command-not-found common-aliases brew node nvm npm pip python screen sublime sudo web-search)
@parinck
parinck / ydlv.sh
Created March 27, 2016 13:56
Download youtube videos from Terminal
#!/bin/bash
# tiny wrapper on top of youtube-dl
# check if youtube-dl exists
hash youtube-dl >/dev/null 2>&1 || {
echo "Error: youtube-dl is not installed";
echo "[Install] https://rg3.github.io/youtube-dl/download.html";
exit 1;
}
@parinck
parinck / mac-apps.md
Created April 3, 2016 14:35 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@parinck
parinck / workspace.sh
Created May 16, 2017 06:48 — forked from scottsb/casesafe.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/workspace}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.workspace.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-workspace}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
@parinck
parinck / osx-for-hackers.sh
Created July 25, 2017 14:00 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@parinck
parinck / Side Bar.sublime-menu
Created October 22, 2017 17:23 — forked from craiggists/Side Bar.sublime-menu
Sublime Text "Open files with..." on the sidebar
[
{"id": "side-bar-files-open-with",
"children":
[
// Chrome
{
"caption": "Chrome",
"id": "side-bar-files-open-with-chrome",
"command": "side_bar_files_open_with",
@parinck
parinck / uncommitLastCommit.md
Created November 1, 2017 13:25 — forked from alexislucena/uncommitLastCommit.md
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say

tell application "Google Chrome"
set tab_list to every tab in the front window
repeat with the_tab in tab_list
set the_url to the URL of the_tab
tell application "Safari" to open location the_url
end repeat
end tell
@parinck
parinck / queries.sql
Created May 2, 2018 09:20 — forked from iconara/queries.sql
Low level Redshift cheat sheet
-- Table information like sortkeys, unsorted percentage
-- see http://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TABLE_INFO.html
SELECT * FROM svv_table_info;
-- Table sizes in GB
SELECT t.name, COUNT(tbl) / 1000.0 AS gb
FROM (
SELECT DISTINCT datname, id, name
FROM stv_tbl_perm
JOIN pg_database ON pg_database.oid = db_id
@parinck
parinck / latency.markdown
Created July 9, 2018 06:46 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs