Skip to content

Instantly share code, notes, and snippets.

@arol
arol / README.md
Created October 31, 2018 07:23
Node.js + Babel + TypeScript
const randomNumber = () => {
return Math.random();
}
// 1. Make it wait for 1 sec. with `setTimeout`
const timeoutRandomNumber = (cb) => {
setTimeout(() => {
cb(null, randomNumber())
}, 1000);
}
@arol
arol / ExpressJS.md
Created September 1, 2017 22:46
ExpressJS & Sequelize

Express and Sequelize

Install

$ mkdir myapp
$ cd myapp
$ npm init #follow instructions - wizard app
$ git init
$ npm i express
@arol
arol / async.js
Last active January 11, 2020 11:08
Asynchronicity exercise
// log the `rnd` result in the console using all three async techniques.
// You can only call console.log inside the `main` function.
const randomNumber = () => {
return Math.random();
}
// 1. Make it wait for 1 sec. with `setTimeout` and log it on main function
const timeoutRandomNumber = () => {
@arol
arol / react-redux.md
Last active December 13, 2018 18:36
React & Redux

React

Install

The easiest way to create a react application is using the create-react-app package. Install it globally in your machine running

$ npm i -g create-react-app
@arol
arol / express-js.md
Created July 14, 2017 22:30
ExpressJS Guide

Express

Install

$ mkdir myapp
$ cd myapp
$ npm init #follow instructions - wizard app
$ git init
$ npm i express
@arol
arol / serverless.yml
Created April 20, 2017 08:29
Serverless yaml configuration file example
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
#
// Add custom timing as a bezier curve
[animation setTimingFunction:[CAMediaTimingFunction functionWithControlPoints:.34 :.01 :.69 :1.37]];
// Add a ease in&out timing function on the animation
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
// Create a basic animation changing the transform.scale value
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
// Set the initial and the final values
[animation setFromValue:[NSNumber numberWithFloat:1.5f]];
[animation setToValue:[NSNumber numberWithFloat:1.f]];
// Set duration
[animation setDuration:0.5f];