Skip to content

Instantly share code, notes, and snippets.

View lucasdu4rte's full-sized avatar
🌎

Lucas Duarte lucasdu4rte

🌎
View GitHub Profile
@lucasdu4rte
lucasdu4rte / async-await.js
Created May 18, 2018 13:55 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@lucasdu4rte
lucasdu4rte / csv-to-json.js
Last active April 2, 2018 13:31 — forked from iwek/csv-to-json.js
CSV to JSON Conversion in JavaScript
var csvJSON = function(csv){
var lines = csv.split("\n")
var result = []
var headers = lines[0].split(",")
lines.map(function(line, indexLine){
if (indexLine < 1) return // Jump header line
var obj = {}
<div ng-app="myApp" ng-controller="MyCtrl">
<div after-render="missionCompled">element</div>
</div>
@lucasdu4rte
lucasdu4rte / Random-string
Created March 1, 2018 13:43 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);