Skip to content

Instantly share code, notes, and snippets.

Edygar de Lima Oliveira edygar

Block or report user

Report or block edygar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 / composer.json
Last active Nov 17, 2015
Wordpress Composer.json
View composer.json
{
"minimum-stability": "dev",
"authors": [{
"name": "Edygar de Lima Oliveira",
"email": "edygardelima@gmail.com"
}],
"require": {
"wordpress": "4.*",
"fancyguy/webroot-installer": "1.0.0",
@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.

@edygar
edygar / LerNumeros.rb
Created Jun 16, 2015
Gist de explicação como ler apenas números em Ruby para ajudar um amigo ;D
View LerNumeros.rb
# Para números inteiros, é bem mais fácil
puts "Input a number: "
# a gente lê para o input o que o usuário digitou e
# testa de convertando para inteiro e depois para string
# o valor continua sendo o mesmo, se sim, é inteiro:
# Exemplos:
# "asdasda".to_i => 0.to_s => "0" != "asdasda"
# "0".to_i => 0.to_s => "0" == "0"
# "123123".to_i => 123123.to_s => "123123" == "123123"
while(input = gets.chomp and input.to_i.to_s != input)
View PromiseBasedAPI.js
function get(path) {
return user.waitForAuthentication()
.then(function() {
return $http.get(path);
})
.then(function(response){
return resposne data;
})
}
You can’t perform that action at this time.