Skip to content

Instantly share code, notes, and snippets.

@justscribner
justscribner / rsync_backup.sh
Created August 11, 2020 18:07 — forked from spyesx/rsync_backup.sh
Rsync backup excluding node_modules
# Backup files
#https://explainshell.com/explain?cmd=rsync+-azuv+--delete+--progress+--exclude+%27node_modules%27
rsync -auvhp --delete --exclude=node_modules [source] [destination]
# Remove all node_modules folders
# https://explainshell.com/explain?cmd=find+.+-name+%22node_modules%22+-type+d+-prune+-exec+rm+-rf+%27%7B%7D%27+%2B
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@justscribner
justscribner / wp.sh
Created August 29, 2018 17:55 — forked from robertogalan/wp.sh
Shell script to install apache/mysql/php/wordpress into an EC2 instance of Amazon AMI Linux.
#! /bin/bash
# Shell script to install apache/mysql/php/wordpress into an EC2 instance of Amazon AMI Linux.
# Step 1: Create an AWS EC2 instance
# Step 2: ssh in like: ssh -v -i wordpress.pem ec2-user@ec2-54-185-74-0.us-west-2.compute.amazonaws.com
# Step 3: Run this as root/superuser, do sudo su
echo "Shell script to install apache/mysql/php/wordpress into an EC2 instance of Amazon AMI Linux."
echo "Please run as root, if you're not, choose N now and enter 'sudo su' before running the script."
echo "Run script? (y/n)"
@justscribner
justscribner / cloudSettings
Last active April 6, 2022 23:32
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-12-11T02:26:02.816Z","extensionVersion":"v3.4.3"}
@justscribner
justscribner / postgistogeojson.js
Created May 8, 2018 00:27 — forked from samgiles/postgistogeojson.js
A function that converts a PostGIS query into a GeoJSON object.
/*
* A function that converts a PostGIS query into a GeoJSON object.
* Copyright (C) 2012 Samuel Giles <sam@sam-giles.co.uk>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@justscribner
justscribner / README.md
Created April 7, 2018 19:10 — forked from clhenrick/README.md
PostgreSQL & PostGIS cheatsheet (a work in progress)
@justscribner
justscribner / binaryGap.js
Created January 17, 2018 19:56
Binary Gap Solution
function solution(N) {
var binary = Number(N).toString(2);
var max = 0;
var curr = 0;
for(var i = 0; i < binary.length; i++) {
if (binary[i] === '0') {
curr++
} else {
max = Math.max(curr, max);
@justscribner
justscribner / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console