Skip to content

Instantly share code, notes, and snippets.

Edygar de Lima Oliveira edygar

View GitHub Profile
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@edygar
edygar / interval.ts
Last active May 27, 2020
Deno helper to call given command each given time.
View interval.ts
/**
* # Shell interval helper
*
* Quick deno helper to call given command each given time.
*
* ## Installation:
*
* ```sh
* deno install -f --allow-run -n interval https://gist.githubusercontent.com/edygar/a1a25656d02a53c867a90fa7389ea44f/raw/interval.ts
* ```
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@edygar
edygar / README.md
Last active Nov 21, 2017
Eslint + Prettier
View README.md

Usage

Install dependencies locally

npm install -D eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import prettier eslint-plugin-prettier eslint-plugin-jsx-a11y eslint-plugin-react flow-bin 
@edygar
edygar / .eslintrc
Last active May 30, 2016
My prefered ESlintrc
View .eslintrc
{
"extends": "eslint-config-airbnb",
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module"
},
"ecmaFeatures": {
"classes": true,
"jsx": true
},
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
init() {
setTimeout(()=>{
this.set('value',
`
<h2>Permito qualquer tag?</h2>
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
init() {
setTimeout(()=>{
this.set('value',
`
<h2>Permito qualquer tag?</h2>
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
selected: 0,
options: [1, 2],
actions: {
select(index) {
this.set('selected', index);
@edygar
edygar / websocket-ping-server.js
Last active Nov 17, 2015
Receives request of pings to desired hostnames and responds with the pongs at its arrival through WebSocket
View websocket-ping-server.js
import netPing from 'net-ping';
import express from 'express';
import http from 'http';
import dns from 'dns';
import socketIO from 'socket.io';
import { BehaviorSubject, Observable } from 'rx';
const app = express();
const server = http.Server(app);
const io = socketIO(server);
@edygar
edygar / introrx.md
Last active Aug 29, 2015 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

You can’t perform that action at this time.