Skip to content

Instantly share code, notes, and snippets.

View fernandovega's full-sized avatar

Fernando Vega fernandovega

View GitHub Profile
@fernandovega
fernandovega / private_fork.md
Created February 17, 2022 21:06 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@fernandovega
fernandovega / nodejs_aws_s3_file_upload.js
Created March 18, 2021 03:19 — forked from sarfarazansari/nodejs_aws_s3_file_upload.js
How to upload files to AWS S3 with NodeJS - AWS-SDK? With the help of this library you can upload any kind of file to s3. (NODEJS, AWS-SDK, S3)
/**
* we are going to upload file to s3 via node js by using
* aws-sdk - required
* busboy - required
* uuid - optional - for image renaming purpose
* with this library you can upload any kind of file to s3 via node js.
*/
const AWS = require('aws-sdk');
const UUID = require('uuid/v4');
@fernandovega
fernandovega / install_nodejs_and_yarn_homebrew.md
Created September 7, 2019 18:53 — forked from nijicha/install_nodejs_and_yarn_homebrew.md
Install NVM, Node.js, Yarn via Homebrew

Install NVM, NodeJS, Yarn via Homebrew

Prerequisites

  • Homebrew should be installed (Command line tools for Xcode are included).

Getting start

Part A: Install NVM and NodeJS

  1. Install nvm via Homebrew
@fernandovega
fernandovega / jwtRS256.sh
Created August 19, 2019 20:06 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
# find the IP addresses of many hosts on the network
# step 1. obtain the broadcast address from ifconfig
# step 2. ping the broadcast address
$ ifconfig -a | grep broadcast
inet 192.168.1.102 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.68.1 netmask 0xffffff00 broadcast 192.168.68.255
inet 192.168.174.1 netmask 0xffffff00 broadcast 192.168.174.255
$ ping 192.168.1.255
PING 192.168.1.255 (192.168.1.255): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=0.634 ms
@fernandovega
fernandovega / tmux-cheatsheet.markdown
Created December 27, 2018 19:34 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@fernandovega
fernandovega / gist:4b19197c384f35f52686c30a133965d7
Created August 14, 2018 14:44 — forked from yesvods/gist:4c7251f060029c8a5b07
Merge Object with ES7 object spread
const obj1 = {name:"xiaoming", age: 23}
const obj2 = {age: 33}
const obj3 = {...obj1, ...obj2}
//obj3 ==> {"name":"xiaoming","age":33}
find . -name "node_modules" -exec rm -rf '{}' +
@fernandovega
fernandovega / GoogleDrivePicker.html
Created June 26, 2018 11:08
Google Drive Picker Example
<h2>Index</h2>
<center>
<h2>Google Picker API</h2>
<table class="imagetable">
<tbody>
<tr id="header">
<th style="font-size:18px;">Google Drive</th>
</tr>
<tr>

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/