As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/bin/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
| #!/usr/bin/env bash | |
| # Use this one-liner to produce a JSON literal from the Git log: | |
| git log \ | |
| --pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \ | |
| $@ | \ | |
| perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \ | |
| perl -pe 's/},]/}]/' |
| var data = "do shash'owania"; | |
| var crypto = require('crypto'); | |
| crypto.createHash('md5').update(data).digest("hex"); |
| <?php | |
| /* | |
| Plugin Name: R Debug | |
| Description: Set of dump helpers for debug. | |
| Author: Andrey "Rarst" Savchenko | |
| Author URI: https://www.rarst.net/ | |
| License: MIT | |
| */ |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| // Implement bash string escaping. | |
| var safePattern = /^[a-z0-9_\/\-.,?:@#%^+=\[\]]*$/i; | |
| var safeishPattern = /^[a-z0-9_\/\-.,?:@#%^+=\[\]{}|&()<>; *']*$/i; | |
| function bashEscape(arg) { | |
| // These don't need quoting | |
| if (safePattern.test(arg)) return arg; | |
| // These are fine wrapped in double quotes using weak escaping. | |
| if (safeishPattern.test(arg)) return '"' + arg + '"'; |
| the | |
| of | |
| to | |
| and | |
| a | |
| in | |
| is | |
| it | |
| you | |
| that |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)