Skip to content

Instantly share code, notes, and snippets.

View farisachugthai's full-sized avatar

Faris A Chugthai farisachugthai

View GitHub Profile
@minrk
minrk / test.sh
Created February 23, 2018 16:01
#!/usr/bin/env bash
# show-args is a Python script that prints sys.argv[1:]
echo '$@ =' "$@"
echo 'no quotes: $@'
show-args $@
echo 'quotes: "$@"'
show-args "$@"
AT="$@"
echo 'quotes: "$AT" where AT="$@"'
show-args "$AT"
@gnestor
gnestor / github-py.ipynb
Last active February 9, 2022 00:25
A notebook for generating a Jupyter Notebook release changelog and credits
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@milmazz
milmazz / imposter-handbook-links.md
Last active July 27, 2024 22:46
Useful links found in The Imposter's Handbook by Rob Conery
@huytd
huytd / .gitconfig
Created August 4, 2016 16:26
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
# 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 "$@"
}
@treyhunner
treyhunner / time_dict_merge.py
Last active November 3, 2023 08:13
Test performance of different dictionary merging functions in Python
"""
Results:
multiple_update: 33 ms
copy_and_update: 27 ms
dict_constructor: 29 ms
kwargs_hack: 33 ms
dict_comprehension: 33 ms
concatenate_items: 81 ms
union_items: 81 ms
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 28, 2024 03:34
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@anula
anula / gist:5748a896cb0c749257a5
Created May 8, 2015 20:08
Workaround for colorful prompt in prompt_toolkit
from __future__ import unicode_literals
from prompt_toolkit.contrib.completers import WordCompleter
## Almost exact copy of prompt_toolkit.shortcuts
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.enums import DEFAULT_BUFFER
from prompt_toolkit.eventloop.base import EventLoop
from prompt_toolkit.filters import IsDone, HasFocus, Always, Never, RendererHeightIsKnown
from prompt_toolkit.history import History
@staltz
staltz / introrx.md
Last active July 27, 2024 04:59
The introduction to Reactive Programming you've been missing
@mattboehm
mattboehm / gist:9977950
Created April 4, 2014 16:15
A mini-plugin to cycle through diffs of unstaged git changes by file (requires fugitive)
nnoremap <silent> <leader>gm :tab split<CR>:Glistmod<CR>
nnoremap <silent> <c-s-j> :call g:DiffNextLoc()<CR>
nnoremap <silent> <c-s-k> :call g:DiffPrevLoc()<CR>
command! Glistmod only | call g:ListModified() | Gdiff
function! g:ListModified()
let old_makeprg=&makeprg
let old_errorformat=&errorformat
let &makeprg = "git ls-files -m"
let &errorformat="%f"