Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Litt on code 👨‍💻

Siddhant Nandkishor Pagariya sidpagariya

💭
Litt on code 👨‍💻
View GitHub Profile
@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active Nov 19, 2020
Gradient shadow in pure CSS
View Gradient shadow in pure CSS.md

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
View Disable Device Enrollment Notification on Mac.md

Disable Device Enrollment Notification on Mac.md

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

Open Terminal in the recovery screen and type

csrutil disable
@jhh
jhh / ex_002.py
Created Aug 3, 2016
Solution to exercise 2.
View ex_002.py
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
@jhh
jhh / ex_001.py
Last active Sep 1, 2016
Solution to exercise 1.
View ex_001.py
import cv2
import sys
import os
# usage: python ex_001.py path/to/image.jpg
imgPath = sys.argv[1]
if not os.path.isfile(imgPath):
print("Image file not found.")
sys.exit()
View backup-homebrew.sh
#!/bin/bash
brew_command=/usr/local/bin/brew
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
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 Sublime Text 3 cheating.md

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (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 .
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View tmux.md

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
@jamtur01
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{^/*},'')
You can’t perform that action at this time.