$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'
$ zmv '*' '${(L)f}'
$ autoload zmv
$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'
$ zmv '*' '${(L)f}'
$ autoload zmv
#!/bin/bash | |
USER=${1:-sebble} | |
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-) | |
PAGES=$((658/100+1)) | |
echo You have $STARS starred repositories. | |
echo |
install termpix from https://github.com/fimkap/termpix (currently alpha blending done with white background) | |
-- init.vim (along with usual FZF setup, change path to termpix) | |
let g:fzf_layout = { 'down': '~60%' } | |
let g:fzf_files_options = | |
\ '--preview "(~/dev/termpix/bin/termpix --width 50 --true-color {} || cat {}) 2> /dev/null "' |
# 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 "$@" | |
} |
" Add this to your vimrc to get a minimalist autocomplete pop | |
" Or use as a plugin : https://github.com/maxboisvert/vim-simple-complete | |
" Minimalist-TabComplete-Plugin | |
inoremap <expr> <Tab> TabComplete() | |
fun! TabComplete() | |
if getline('.')[col('.') - 2] =~ '\K' || pumvisible() | |
return "\<C-P>" | |
else |
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>F19 to CapsLock and Fn</name> | |
<appendix>Tap F19 for CapsLock, Hold F19 for Fn</appendix> | |
<appendix>Works well with using Seil to remap CapsLock to F19(code 80).</appendix> | |
<identifier>private.remap_f19_capslock_fn</identifier> | |
<autogen> | |
__KeyOverlaidModifier__ KeyCode::F19, KeyCode::FN, KeyCode::CAPSLOCK | |
</autogen> |
# Elixir has lazily evaluated enumerable objects that allow you | |
# to work with enumerable objects like lists either only as needed | |
# or infinitely. | |
# Start up iex to play around | |
$ iex | |
# Typical enumeration is done eagerly where the result is computed ASAP | |
iex> Enum.map(1..10, fn i -> i * 2 end) | |
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20] |
Note: This guide was written for Phoenix 1.1.4. Parts of it may no longer work if you are using a newer version.
Let’s build a JSON API that serves a list of contacts. We’ll be writing it using Elixir (version 1.2.5) and Phoenix (version 1.1.4). Phoenix is a framework written in Elixir that aims to make writing fast, low latency web applications as enjoyable as possible.
Source Code: The source code after finishing this guide can be found here.
local alert = require("hs.alert") | |
local timer = require("hs.timer") | |
local eventtap = require("hs.eventtap") | |
local events = eventtap.event.types | |
local module = {} | |
-- Save this in your Hammerspoon configuration directiorn (~/.hammerspoon/) | |
-- You either override timeFrame and action here or after including this file from another, e.g. |
/** | |
* MQTT Bridge | |
* | |
* Authors | |
* - [email protected] | |
* - [email protected] | |
* - [email protected] | |
* | |
* Copyright 2016 | |
* |