sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
This file contains 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
#target Illustrator | |
// script.name = exportLayersAsCSS_PNGs.jsx; | |
// script.description = mimics the Save for Web, export images as CSS Layers (images only); | |
// script.requirements = an open document; tested with CS5 on Windows. | |
// script.parent = carlos canto // 05/24/13; All rights reseved | |
// script.elegant = false; | |
/** |
This file contains 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
<UserImage user={user} width={50} height={30} variant="small" /> | |
^^^^^^^ number. This type is incompatible with void | |
<UserImage user={user} width={50} height={30} variant="small" /> | |
^^^^^^^ number. This type is incompatible with void | |
<UserImage user={user} width={50} height={30} variant="small" /> | |
^^^^^^^ string. This type is incompatible with void |
This file contains 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
// Examples | |
export class App extends Component { | |
render() { | |
return ( | |
<main> | |
<Spacer type="small"> | |
<p>Hello dude!</p> | |
</Spacer> | |
<Spacer type="medium"> | |
<div> |
This file contains 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
// We can replace here by `redux-actions` | |
const createActionCreator = function(action) { | |
return function(data) { | |
return { | |
type: action, | |
payload: data, | |
} | |
} | |
} |
This file contains 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
const superagent = require('superagent'); | |
const NUM_RETRIES = 3; | |
request('http://google.com/this-throws-an-error', function(error, res) { | |
console.log(error.message); // "Not Found" | |
}); | |
function request(url, callback) { | |
_request(url, 0, callback); |
This file contains 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
const superagent = require('superagent'); | |
const NUM_RETRIES = 3; | |
test(); | |
async function test() { | |
let i; | |
for (i = 0; i < NUM_RETRIES; ++i) { | |
try { |
This file contains 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
const superagent = require('superagent'); | |
const NUM_RETRIES = 3; | |
test(); | |
async function test() { | |
let arr = new Array(NUM_RETRIES).map(() => null); | |
arr.forEach(() => { | |
try { |
This file contains 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
const mongodb = require('mongodb'); | |
test(); | |
async function test() { | |
const db = await mongodb.MongoClient.connect('mongodb://localhost:27017/test'); | |
await db.collection('Movies').drop(); | |
await db.collection('Movies').insertMany([ | |
{ name: 'Enter the Dragon' }, |
OlderNewer