Skip to content

Instantly share code, notes, and snippets.

View pladaria's full-sized avatar
👾

Pedro Ladaria pladaria

👾
View GitHub Profile
@pladaria
pladaria / nginxproxy.md
Created February 11, 2017 18:34 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@pladaria
pladaria / heroku-deploy.sh
Created January 29, 2017 15:44
Simple shell script to deploy heroku services
#!/usr/bin/env bash
DEPLOY_PATH=/tmp/heroku-deploy-`date +%s`/
HEROKU_NAME="put-your-heroku-service-name-here"
rm -rf $DEPLOY_PATH
mkdir -p $DEPLOY_PATH
rsync -av . $DEPLOY_PATH --exclude node_modules
cd $DEPLOY_PATH
@pladaria
pladaria / .svgo.yml
Last active February 7, 2023 17:15
SVGO config file
multipass: true
plugins:
- addAttributesToSVGElement: false
- addClassesToSVGElement: false
- cleanupAttrs: true
- cleanupEnableBackground: true
- cleanupIDs: true
- cleanupListOfValues: true
- cleanupNumericValues:
@pladaria
pladaria / riffwave.js
Created December 7, 2016 16:17
RIFFWAVE
/*
* RIFFWAVE.js v0.03 - Audio encoder for HTML5 <audio> elements.
* Copyleft 2011 by Pedro Ladaria <pedro.ladaria at Gmail dot com>
*
* Public Domain
*
* Changelog:
*
* 0.01 - First release
* 0.02 - New faster base64 encoding
@pladaria
pladaria / run_ez4_client_with_wine.md
Last active August 21, 2016 13:31
Open EZ4_client with wine

Run EZ4 Client with wine

To transfer GBA Roms to SD for EZ-Flash IV

  1. Open wine config and set your SD drive as D:
  2. Install Winetricks
  3. Using Winetricks install MFC42
  4. You should now be able to run EZ4_client

Problems with names when transfering roms? Check this.

@pladaria
pladaria / websocket-reconnect.js
Last active June 27, 2016 17:47
Quick and dirty draft of a reconnecting websocket with connecting timeout
/**
* Quick and dirty draft of a reconnecting websocket with connecting timeout
*/
console.debug('script init')
const MAX_RECONNECTION_DELAY = 8000
const MIN_RECONNECTION_DELAY = 1500
const CONNECTING_TIMEOUT = 5000