Skip to content

Instantly share code, notes, and snippets.

Litt on code 👨‍💻

Siddhant Nandkishor Pagariya sidpagariya

Litt on code 👨‍💻
View GitHub Profile
jhh /
Last active Sep 1, 2016
Solution to exercise 1.
import cv2
import sys
import os
# usage: python path/to/image.jpg
imgPath = sys.argv[1]
if not os.path.isfile(imgPath):
print("Image file not found.")
jhh /
Created Aug 3, 2016
Solution to exercise 2.
import cv2
import sys
import os
def simple_threshold(path, thresh):
# read in the image
img = cv2.imread(path)
# display the image and wait for key press
jamtur01 / generate_navigation.rb
Created May 20, 2012
Auto-generates navigation menu for Jekyll sites using pages based on subdirectories and contents
View generate_navigation.rb
# Auto-generates navigation
# {% generate_navigation %}
require 'pathname'
module Jekyll
class Page
def source_path
File.join(@dir, @name).sub(%r{^/*},'')
brew_cask_command="$brew_command cask"
echo '#!/bin/bash'
echo ''
echo 'trap ctrl_c INT'
echo 'function ctrl_c() {'
echo 'echo "** Trapped CTRL-C"'
aclissold / NSUserDefaults+UIColor.swift
Created Jun 1, 2015
Swift NSUserDefaults UIColor extension
View NSUserDefaults+UIColor.swift
extension NSUserDefaults {
func colorForKey(key: String) -> UIColor? {
var color: UIColor?
if let colorData = dataForKey(key) {
color = NSKeyedUnarchiver.unarchiveObjectWithData(colorData) as? UIColor
return color
View Disable Device Enrollment Notification on

Disable Device Enrollment Notification on

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
View Sublime Text 3


Important Note

Please use built-in (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
tunguskha / Gradient shadow in pure
Last active Apr 18, 2021
Gradient shadow in pure CSS
View Gradient shadow in pure

Gradient shadow in pure CSS

alt text

<button>Let's Go !</button>