Skip to content

Instantly share code, notes, and snippets.

View whaleinvasion's full-sized avatar
💭
I may be slow to respond.

WhaleInvasion whaleinvasion

💭
I may be slow to respond.
View GitHub Profile
@whaleinvasion
whaleinvasion / daemon.js
Created July 14, 2021 22:19 — forked from kumatch/daemon.js
Node.js daemon example
var fs = require('fs');
var INTERVAL = 1000;
var cycle_stop = false;
var daemon = false;
var timer;
process.argv.forEach(function (arg) {
if (arg === '-d') daemon = true;
@whaleinvasion
whaleinvasion / csv2po.php
Created December 16, 2019 16:15 — forked from nfreear/csv2po.php
Convert a comma-separated value CSV file to Gettext PO format (i18n, internationalization, localization, translation)
#!/usr/bin/env php
<?php
/**
* Convert a comma-separated value CSV file to Gettext PO format.
*
* @copyright Nick Freear, 2 October 2013.
*/
$path = '/Users/Nick';
$csv_file = $path . "/Downloads/iSpot SPANISH v. luis lopez-sangil - Spanish.csv";
@whaleinvasion
whaleinvasion / install-comodo-ssl-cert-for-nginx.rst
Created February 20, 2019 07:21 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@whaleinvasion
whaleinvasion / docker-compose-node-mongo.yml
Created October 25, 2018 09:58 — forked from wesleybliss/docker-compose-node-mongo.yml
Docker Compose with example App & Mongo
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
@whaleinvasion
whaleinvasion / Dockerfile
Created October 5, 2018 22:39
WordPress on Amazon ECS
FROM alpine:3.3
MAINTAINER Tom Maiaroto <tom@outdoorsy.co>
# Install packages
RUN apk --update --repository http://dl-3.alpinelinux.org/alpine/edge/main add \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
php7 \
@whaleinvasion
whaleinvasion / touch-detect.js
Created October 2, 2018 11:51 — forked from seafoox/touch-detect.js
Detecting the ‘Tap’ event on a Mobile touch device using javascript --- JSFiddle: http://jsfiddle.net/gianlucaguarini/56Szw/light/
var $touchArea = $('#touchArea'),
touchStarted = false, // detect if a touch event is sarted
currX = 0,
currY = 0,
cachedX = 0,
cachedY = 0;
//setting the events listeners
$touchArea.on('touchstart mousedown',function (e){
e.preventDefault();
@whaleinvasion
whaleinvasion / index.html
Created September 17, 2018 10:33 — forked from fcingolani/index.html
How to render a full PDF using Mozilla's pdf.js
<html>
<body>
<!-- really dirty! this is just a test drive ;) -->
<script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script>
<script type="text/javascript">
function renderPDF(url, canvasContainer, options) {
var options = options || { scale: 1 };
@whaleinvasion
whaleinvasion / install-docker.sh
Created September 14, 2018 14:17 — forked from frgomes/install-docker.sh
Debian - install docker in Debian Jessie
#!/bin/bash
# compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install apt-transport-https ca-certificates -y
sudo sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list"
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@whaleinvasion
whaleinvasion / image-proxy.conf
Created June 5, 2018 14:13 — forked from tmaiaroto/image-proxy.conf
Nginx Image Filter Resize Proxy Service
# Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below).
proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G;
# Gzip was on in another conf file of mine...You may need to uncomment the next line.
#gzip on;
gzip_disable msie6;
gzip_static on;
gzip_comp_level 4;
gzip_proxied any;
# Again, be careful that you aren't overwriting some other setting from another config's http {} section.
@whaleinvasion
whaleinvasion / gist:0069867a238bda21e66c988477a6eb54
Created April 12, 2018 05:40 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key