Skip to content

Instantly share code, notes, and snippets.

View junegunn's full-sized avatar
🐷
Please be kind to animals

Junegunn Choi junegunn

🐷
Please be kind to animals
View GitHub Profile
@d630
d630 / 0.16.2.md
Last active January 26, 2017 13:28
fzf - a command-line fuzzy finder

fzf - a command-line fuzzy finder

Internal opts struct

opts.Field Type Default
Ansi bool false
Black bool false
Bold bool true
Case Case CaseSmart
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@junegunn
junegunn / vimrc
Last active October 10, 2021 07:54
set nocompatible hidden laststatus=2
if !filereadable('/tmp/plug.vim')
silent !curl --insecure -fLo /tmp/plug.vim
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
source /tmp/plug.vim
call plug#begin('/tmp/plugged')
Plug 'junegunn/fzf', { 'do': './install --bin' }
@jibsen
jibsen / srgbtogenericrgb.py
Created October 22, 2014 06:50
Example of converting RGB colors from sRGB to Generic RGB
#!/usr/bin/env python3
# Copyright (c) 2014 Joergen Ibsen
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
@steve-jansen
steve-jansen / README.md
Last active February 23, 2024 22:38
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@choppsv1
choppsv1 / tmux-24.diff
Last active December 21, 2018 15:25
True color (24-bit) terminal support for tmux-1.9a and tmux-2.0
This diff is a modified version of a diff written by Arnis Lapsa.
[ The original can be found here: https://gist.github.com/ArnisL/6156593 ]
This diff adds support to tmux for 24-bit color CSI SRG sequences. This
allows terminal based programs that take advantage of it (e.g., vim or
emacs with https://gist.github.com/choppsv1/73d51cedd3e8ec72e1c1 patch)
to display 16 million colors while running in tmux.
The primary change I made was to support ":" as a delimeter as well
@stathissideris
stathissideris / tree-seq-extra.clj
Last active July 2, 2023 11:33
Like Clojure's tree-seq, but with depth info for each node or the full path (recursive - blow up the stack for deep trees)
(defn tree-seq-depth
"Returns a lazy sequence of vectors of the nodes in a tree and their
depth as [node depth], via a depth-first walk. branch? must be a fn
of one arg that returns true if passed a node that can have
children (but may not). children must be a fn of one arg that
returns a sequence of the children. Will only be called on nodes for
which branch? returns true. Root is the root node of the tree."
[branch? children root]
(let [walk (fn walk [depth node]
(lazy-seq
@davidguttman
davidguttman / index.js
Last active February 29, 2024 21:43
Bootstrap and Browserify
// Bootstrap wants jQuery global =(
window.jQuery = $ = require('jquery')
// Bootstrap doesn't have a "main" field / export anything =(
var bootstrap = require('bootstrap/dist/js/bootstrap')
// Get Bootstrap styles with cssify
var style = require('./node_modules/bootstrap/dist/css/bootstrap.css')
var popover = document.createElement('span')
popover.innerHTML = 'I have a popover'
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing