ES2015 it's awesome and babel.js is a great tool for compiling ES2015 into
javascript code. If you take a look at babel's documentation, you'll find out
over than 20 different ways to install babel.js from node to .NET.
One of the greatets features in ES2015 is import
and export
but you can't
use it in the browser :( right out of the box.
If you want to use modules in the browser you will need to do a trick and use
browserify
+ babelify
.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quiero crear un loop que corra cada 1000 miliseconds, pero que espere a que | |
// el anterior termine | |
// incorrecto: http://g.recordit.co/p8ssRrRY27.gif | |
// correcto: http://g.recordit.co/OFFYS9Nd6F.gif | |
function doStuff(){ | |
setTimeout(function(){ | |
console.log('done doing stuff'); | |
}, 3000); | |
}; |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type arr = number[]; | |
type multiple = number[][]; | |
type irregular = any[]; | |
const flatten = (arr : arr | multiple | irregular) : number[] => { | |
const newState : number[] = []; | |
for (let item of arr) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) In your terminal, open the file using vim: | |
vim file_name | |
2) Remove all BOM characters: | |
:set nobomb | |
3) Save the file: | |
:wq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo tcpdump -A -s0 -ilo0 port 24224 or port 12201 or port 8125 |
OlderNewer