Skip to content

Instantly share code, notes, and snippets.

@jottr
jottr / ApplePressAndHoldEnabled.sh
Last active August 29, 2015 14:03
Reenable Press and Hold on OSX
#!/bin/bash
# As per http://osxdaily.com/2011/08/04/enable-key-repeat-mac-os-x-lion/
# Most apps need to be relaunched to make the setting stick.
defaults write -g ApplePressAndHoldEnabled -bool true

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@jottr
jottr / readline_shortcuts.md
Last active March 29, 2025 21:51
readline shortcuts

Readline

GNU readline is a commonly used library for line-editing; it is used for example by Bash, FTP, and many more (see the details of [readline][5] package under "Required By" for more examples). readline is also customizable (see man page for details).

Keyboard Shortcut Description

Ctrl+l Clear the screen

Cursor Movement

@jottr
jottr / .vimrc
Last active October 5, 2019 00:59 — forked from vinniefranco/gist:4730156
Quickly convert string to array in vim
" Quick array creation
nmap <leader>ta vF=l<Esc>:s/\%V\S\+/"&",/g<CR>A<BS><Esc>vF=2lgS[JJ:let @/ = ""<CR>

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jottr
jottr / i3-get-window-criteria
Last active February 10, 2025 09:29
Get window criteria to use with i3 window placement. Taken from: http://bit.ly/1e9pcfe
#!/bin/sh
# i3-get-window-criteria - Get criteria for use with i3 config commands
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion,
# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`,
# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807

Here some Google Reader Open Source alternatives with the most expected features.

Please fork and help me to keep it updated.

Name language Database has categories Responsive/Mobile
Commafeed java hsql,mysql/postgresql
Freader nodejs mongodb ???
Goread go appengine
Miniflux php
@jottr
jottr / rename.sh
Created January 13, 2014 22:56
Changes the matching string in the filenames containg that string.
for f in *; do n=$(echo "$f" | sed -e "s/oldString/newString/"); mv "$f" "$n"; done
@jottr
jottr / containers.md
Last active January 3, 2016 03:19
remove running docker containers.

docker ps -a lists all running containers.

Delete all containers with an exit state of 1

docker ps -a | grep Exit | awk '{print $1}' | xargs docker rm

Remove all containers, ignoring their current state

docker ps -a -q | xargs docker rm

If you observe stale NFS handles - reboot.

@jottr
jottr / 99-thinklight.rules
Last active January 3, 2016 01:29
Blink thinklight
SUBSYSTEM=="leds", RUN+="/bin/sh /sbin/thinklight_permissions"