Skip to content

Instantly share code, notes, and snippets.

@jhidalgo3
jhidalgo3 / downloader.js
Last active January 16, 2021 09:48
Use NodeJS to download files
var path = require('path');
var url = require('url');
var http = require('http');
var fs = require('fs');
var write_file;
//what global variable do we have?
var complete = false;
var content_length = 0;
var downloaded_bytes = 0;

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

Git vs. CVS Advantages

Flexible Workflow

In Git your working copy is a clone of the entire repository. This includes branches and tags. This decreases the overhead (speed and manual work) involved when switching contexts and the need to be connected to a network. Some examples are:

  • When switching branches there is no need to connect to a remote server or close your IDE/project and open a checkout in another directory. Running git checkout [branch name] is all you need to do.
  • When merging you do not need a connection to the remote server, you have all branches locally. Since branches are so cheap in Git you could create a new branch to perform the merge in so that if you had a large amount of conflicts you could incrementally work on and commit without affecting the main branch then merge or create a patch after everything has been fixed.
  • Because Git is a distributed system in addition to connecting to a central repository developers can connect to another developers repository. This allows team

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@jhidalgo3
jhidalgo3 / INSTALLATION.md
Created November 22, 2015 11:12 — forked from DenisIzmaylov/INSTALLATION.md
OS X 10.11 El Capitan: fresh install with Node.js (io.js) Developer Environment

OS X 10.11 (El Capitan) / Node.js and io.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content

@jhidalgo3
jhidalgo3 / docker_clean_scripts.md
Created October 22, 2017 00:19
Docker clean scripts

Delete all container status=exited

docker rm $(docker ps -a -q -f "status=exited")

Delete all untagged images

docker rmi $(docker images -q --filter "dangling=true")
### Keybase proof
I hereby claim:
* I am jhidalgo3 on github.
* I am jhidalgo3 (https://keybase.io/jhidalgo3) on keybase.
* I have a public key ASCNjRFDor_Qipm0n8Ik0cxS6B5FurcC0HyOL-rRhAvNpAo
To claim this, I am signing this object:
@jhidalgo3
jhidalgo3 / Documentation.md
Created January 13, 2019 10:48 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@jhidalgo3
jhidalgo3 / myip.sh
Created July 23, 2019 18:50
What is my ip?
myip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
echo "My WAN/Public IP address: ${myip}"