This will allow tilde style user directory on nginx:
location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/www$2;
autoindex on;
}
This will allow tilde style user directory on nginx:
location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/www$2;
autoindex on;
}
Navigate with arrow keys, mustly to be used on a static content generator, like Jekyll or Hugo:
<script>
$(document).keydown(function(e){
if (e.keyCode == 37 && $(".prev").length == 1) {
e.preventDefault();
window.location.href = $(".prev").attr("href");
} else if (e.keyCode == 39 && $(".next").length == 1) {
e.preventDefault();
-- Word and Character Count service for Mac OS X | |
-- Adds a Word and Character Count option to the text selection context menu | |
-- Use Automator to create a new service, then select the Run AppleScript action. Make | |
-- sure the service is set to receive "text", at the top of the window. Paste in this code | |
-- and save as "Word and Character Count". Now switch to a new app, select some text, | |
-- right-click, go to Services, and find the new option. | |
-- Copyright 2015, Noah Slater <nslater@apache.org> |
#!/bin/sh | |
# PROVIDE: forever | |
# REQUIRE: NETWORKING SERVERS DAEMON | |
# BEFORE: LOGIN | |
# KEYWORD: shutdown | |
# Taken from http://habrahabr.ru/post/137857/ | |
. /etc/rc.subr |
file-icons | |
tool-bar | |
tool-bar-main | |
atom-material-ui | |
atom-material-syntax | |
markdown-writer |
# On the fly resizing of images inside /images/*/ | |
# based on query string "width" and "height" parameters | |
location ~ /images/(.+)/ { | |
set $width -; | |
set $height -; | |
set $entity $1; | |
if ($arg_width) { | |
set $width $arg_width; |
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 | |
file=$2 |
# -p get all images, etc. needed to display HTML page. | |
# --mirror turns on recursion and time-stamping, sets infinite | |
# recursion depth and keeps FTP directory listings | |
# --html-extension save HTML docs with .html extensions | |
# --convert-links make links in downloaded HTML point to local files. | |
wget --mirror -p --html-extension --convert-links www.example.com |
Create ~/.inputrc and fill it with this: | |
"\e[A": history-search-backward | |
"\e[B": history-search-forward |