Skip to content

Instantly share code, notes, and snippets.

View emoron's full-sized avatar
🏠
Working from home

Edgardo emoron

🏠
Working from home
View GitHub Profile
@emoron
emoron / install-rabbitmq-ubuntu1604.md
Created November 17, 2021 15:04 — forked from fernandoaleman/install-rabbitmq-ubuntu1604.md
Install RabbitMQ on Ubuntu 16.06

Install RabbitMQ on Ubuntu 16.04

Install Erlang

wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update -y
sudo apt-get install -y erlang erlang-nox
@emoron
emoron / rsync_backup.py
Created March 21, 2020 15:25 — forked from seebk/rsync_backup.py
Python rsync backup script
#!/usr/bin/python3
#######################################################
# Python rsync Backup script
# Sebastian Kraft, 24.06.2013
#
#######################################################
#-----------------------------------------------------
# Config
@emoron
emoron / jimp-example.js
Created May 10, 2019 18:27 — forked from ASteinheiser/jimp-example.js
An example of how to use Jimp to read a base64 image string, resize, removeExif data, then return as an image buffer.
let imageBuffer = Buffer.from(body.profilePicture.split(',')[1], 'base64');
console.log(imageBuffer);
Jimp.read(imageBuffer, function(err, image) {
if (err) {
context.done(err,
prepareErrorResponse(response, 'Unable to remove EXIF data from profile picture'));
}
console.log('before transform: ', image);
image = image.resize(400, 400).exifRotate((err, exifRotatedData) => {
@emoron
emoron / proxy.js
Created January 21, 2019 21:53 — forked from cmawhorter/proxy.js
Node script to forward all http requests to another server and return the response with an access-control-allow-origin header. Follows redirects.
// Simple proxy/forwarding server for when you don't want to have to add CORS during development.
// Usage: node proxy.js
// Open browser and navigate to http://localhost:9100/[url]
// Example: http://localhost:9100/http://www.google.com
// This is *NOT* for anything outside local development. It has zero error handling among other glaring problems.
// This started as code I grabbed from this SO question: http://stackoverflow.com/a/13472952/670023
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@emoron
emoron / clear.txt
Created September 4, 2018 20:48 — forked from EQuimper/clear.txt
React-Native clear Watchman + Cache
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache
@emoron
emoron / google-form-to-github-issue.md
Created January 7, 2018 01:49 — forked from bmcbride/google-form-to-github-issue.md
Create a new GitHub Issue from a Google Form submission

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
@emoron
emoron / 0_reuse_code.js
Created February 21, 2017 03:35
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
@emoron
emoron / convertSheet2JsonText.gs
Last active February 21, 2017 16:28 — forked from daichan4649/convertSheet2Json.gs
Convert Json
var URL_BOOK = 'https://docs.google.com/spreadsheet/ccc?key=xxxxx';
var SHEET_NAME = 'sheet name';
function doGet(e) {
var url = URL_BOOK;
var sheetName = SHEET_NAME;
var book = SpreadsheetApp.openByUrl(url);
var sheet = book.getSheetByName(sheetName);
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed