Skip to content

Instantly share code, notes, and snippets.

View rudyhuynh's full-sized avatar

Rudy Huynh rudyhuynh

  • VN
View GitHub Profile
@rudyhuynh
rudyhuynh / table-to-json.js
Created April 15, 2021 09:06 — forked from johannesjo/table-to-json.js
Snippet to convert html table to json (to be used with google chrome or similiar)
function tableToJson(table) {
var data = [];
// first row needs to be headers
var headers = [];
for (var i=0; i<table.rows[0].cells.length; i++) {
headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,'');
}
// go through cells
@rudyhuynh
rudyhuynh / vagrant_setdate.sh
Created March 27, 2020 05:25 — forked from unfulvio/vagrant_setdate.sh
How to change server time on a Vagrant box on Virtualbox
#!/bin/bash
# Log in into the box
vagrant ssh
# VirtualBox syncs host time with guest, so we need to shut off VBox Guest Additions first
sudo service vboxadd-service stop
# Now you can set any date and time
sudo date -s "2020-10-01 10:25:00"
@rudyhuynh
rudyhuynh / polyline_decoder.js
Created April 3, 2017 06:26 — forked from ismaels/polyline_decoder.js
Javascript function to decode google maps api polyline
// source: http://doublespringlabs.blogspot.com.br/2012/11/decoding-polylines-from-google-maps.html
function decode(encoded){
// array that holds the points
var points=[ ]
var index = 0, len = encoded.length;
var lat = 0, lng = 0;
while (index < len) {
var b, shift = 0, result = 0;
@rudyhuynh
rudyhuynh / multiple_ssh_setting.md
Last active October 19, 2020 03:02 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different git account

This instruction helps create multiple ssh keys for local machine to use multiple git remote repositories.

Step 1: Create different ssh keys

$ ssh-keygen -t rsa -C "your_email1@youremail.com"
$ ssh-keygen -t rsa -C "your_email2@youremail.com"