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 / 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).

@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 / 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;
file-icons
tool-bar
tool-bar-main
atom-material-ui
atom-material-syntax
markdown-writer
@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
@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 / 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 / nginx-userdirectory.md
Last active October 4, 2017 11:35
Tilde style user directory on nginx

This will allow tilde style user directory on nginx:

location ~ ^/~(.+?)(/.*)?$ {
    alias /home/$1/www$2;
    autoindex on;
}
@Fastidious
Fastidious / keybase.md
Last active October 4, 2017 11:35
Keybase proof

Keybase proof

I hereby claim:

  • I am fastidious on github.
  • I am davidcollantesus (https://keybase.io/davidcollantesus) on keybase.
  • I have a public key whose fingerprint is 12C7 FC2F 3D24 3C26 26F3 3909 4C9B 7B46 B9B6 7D02

To claim this, I am signing this object:

@Fastidious
Fastidious / appify
Created June 8, 2016 13:57 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh