Skip to content

Instantly share code, notes, and snippets.

View sgrasso's full-sized avatar

Sean Grasso sgrasso

View GitHub Profile
@sgrasso
sgrasso / Webpack DLL Reference Config
Created January 30, 2017 16:03
Webpack DLL example using Webpack-Config
'use strict';
const path = require('path');
const webpack = require('webpack');
const WebpackConfig = require('webpack-config').Config;
module.exports = new WebpackConfig().merge({
name: 'myapp',
@sgrasso
sgrasso / nginx.conf.erb
Last active February 17, 2023 15:58
Reverse proxy Nginx config for Heroku app
daemon off;
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>;
events {
worker_connections 1024;
}
http {
upstream my_nginx {
server unix:/tmp/nginx.socket fail_timeout=0;
@sgrasso
sgrasso / owncloud_organize_move.sh
Last active April 6, 2019 17:59
Owncloud cron script. Moves iPhone photos from InstantUpload folder to mounted drive. Organizes by Year, Month of photo.
#!/usr/bin/env bash
BASE_DIR=/var/www/owncloud/data
DEST_DIR=/var/www/mydata
# Get all InstantUpload folders
dirs="$(find "$BASE_DIR" -type d -name InstantUpload)"
## Find those files
for d in $dirs ; do
@sgrasso
sgrasso / convertCSV.js
Created November 2, 2016 19:59
Convert a CSV file of url redirects into a redirect.conf file for use in Apache
/************************
--Usage
node covertCSV.js filename.csv > redirect.conf
CSV column A contains base URL and column B contains the Redirect URL.
Generates redirects based off of unique GUID in query string if present.
************************/
var fs = require('fs');