Skip to content

Instantly share code, notes, and snippets.

Avatar

Pedro Ladaria pladaria

View GitHub Profile
@pladaria
pladaria / clean-up-boot-partition-ubuntu.md
Created Dec 20, 2019 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@pladaria
pladaria / fundacion-lectura.md
Last active Jan 30, 2020
Saga de la Fundación - Orden de lectura
View fundacion-lectura.md

Saga de la Fundación

Serie de los Robots

  • 1950 Yo, Robot
  • 1954 Bóvedas de Acero
  • 1957 El Sol Desnudo
  • 1983 Los Robots del Amanecer
  • 1985 Robots e Imperio
View index.js
const crypto = require('crypto');
const urlBase64 = require('urlsafe-base64');
function generateVAPIDKeys() {
const curve = crypto.createECDH('prime256v1');
curve.generateKeys();
return {
publicKey: urlBase64.encode(curve.getPublicKey()),
privateKey: urlBase64.encode(curve.getPrivateKey())
@pladaria
pladaria / sentry-webpack-plugin.js
Created Nov 24, 2017
Sentry artifacts upload plugin for webpack
View sentry-webpack-plugin.js
/*
* Original file:
* https://github.com/40thieves/webpack-sentry-plugin/blob/master/src/index.js
*/
const request = require('request-promise');
const fs = require('fs');
const crypto = require('crypto');
const {green, yellow, red} = require('colors/safe');
const Queue = require('promise-queue');
@pladaria
pladaria / index.js
Last active Apr 22, 2017
requirebin sketch
View index.js
const RWS = require('reconnecting-websocket');
const rws1 = new RWS('wss://echo.websocket.org');
const rws2 = new RWS('wss://echo.websocket.org', undefined);
rws1.onopen = () => console.log('ws1 connected');
rws2.onopen = () => console.log('ws2 connected');
@pladaria
pladaria / nginxproxy.md
Created Feb 11, 2017 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?
View nginxproxy.md

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 Jan 29, 2017
Simple shell script to deploy heroku services
View heroku-deploy.sh
#!/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 Jul 16, 2020
SVGO config file
View .svgo.yml
multipass: true
plugins:
- addAttributesToSVGElement: false
- addClassesToSVGElement: false
- cleanupAttrs: true
- cleanupEnableBackground: true
- cleanupIDs: true
- cleanupListOfValues: true
- cleanupNumericValues:
View riffwave.js
/*
* 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
You can’t perform that action at this time.