Skip to content

Instantly share code, notes, and snippets.

View Fastidious's full-sized avatar
🐵
Just another one.

Fastidious Fastidious

🐵
Just another one.
View GitHub Profile
@Fastidious
Fastidious / previous-next.md
Last active October 4, 2017 11:42
JS previous and next

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();
@Fastidious
Fastidious / Word and Character Count.scpt
Created October 5, 2015 14:23
Word and Character Count service for Mac OS X
-- 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 <[email protected]>
@Fastidious
Fastidious / gist:e159e684b4cc13b6187c
Last active September 9, 2015 17:41 — forked from jellea/gist:6510897
Node.js Forever rcng script for FreeBSD
#!/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
@Fastidious
Fastidious / nginx_image_filter.conf
Last active August 26, 2015 18:37 — forked from tsertkov/nginx_image_filter.conf
On the fly image resizing with image_filter
# 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;
@Fastidious
Fastidious / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# 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
@Fastidious
Fastidious / openssl-decrypt-encrypt.md
Last active July 25, 2019 18:58
OpenSSL encrypt/decrypt

Encryption with openssl

Encrypt:

openssl enc -e -aes256 -salt -in file-to-encrypt -out file-encrypted.encrypted

Use this one instead, if base64 is needed (send encrypted file as text on email, or messaging).

# -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
@Fastidious
Fastidious / most-useful-thing-in-bash
Created April 13, 2015 00:49
Most useful thing in Bash
Create ~/.inputrc and fill it with this:
"\e[A": history-search-backward
"\e[B": history-search-forward
@Fastidious
Fastidious / sublime-conf
Created April 12, 2015 17:29
Sublime Text Configuration
{
"theme": "Afterglow.sublime-theme",
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
"tabs_small": true,
"sidebar_size_12": true,
"sidebar_row_padding_medium": true,
"status_bar_brighter": true,
"color_inactive_tabs": true,
"tabs_padding_small": true,
"font_face": "Inconsolata-g"