Skip to content

Instantly share code, notes, and snippets.

View onluiz's full-sized avatar

Luiz Alberto onluiz

  • Brazil, Santa Catarina, Florianópolis
View GitHub Profile
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
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
});
}
@crizstian
crizstian / solid.js
Last active March 15, 2023 02:40
Code examples of SOLID principles for JavaScript
/*
Code examples from the article: S.O.L.I.D The first 5 priciples of Object Oriented Design with JavaScript
https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa#.7uj4n7rsa
*/
const shapeInterface = (state) => ({
type: 'shapeInterface',
area: () => state.area(state)
})
@waynelkh
waynelkh / FixButton.js
Created January 28, 2016 18:53
like inbox right bottom button, always fix
import React, { PropTypes } from 'react'
import FloatingActionButton from 'material-ui/lib/floating-action-button';
const FixButton = ({ onAddClick }) => {
return (
<FloatingActionButton
style={{ right: 20, bottom: 20, position: 'fixed' }}
onClick={onAddClick}>
<ContentAdd />
</FloatingActionButton>
@maxkfranz
maxkfranz / README
Last active March 8, 2020 09:24
wine-and-cheese-demo
dummy file to create gist
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@tkh44
tkh44 / FileController.js
Last active March 10, 2020 09:04
Simple file upload for sails.js
module.exports = {
get: function (req, res) {
res.sendfile(req.path.substr(1));
},
_config: {
rest: false,
shortcuts: false
}
};
@NPashaP
NPashaP / .block
Last active November 6, 2020 19:57
Graceful Tree Conjecture
license: gpl-3.0