Skip to content

Instantly share code, notes, and snippets.

View rodrigooler's full-sized avatar
💜
I would love to change the world, but they did not give me the source code.

Rodrigo Oler rodrigooler

💜
I would love to change the world, but they did not give me the source code.
View GitHub Profile
@rodrigooler
rodrigooler / realocacao.json
Created December 14, 2016 19:17
realocacao.json
{
"loteLocal":{
"id":13080,
"bloco":{
"id":1947
}
},
"blocoDestiny":{
"id":"1965"
}
@rodrigooler
rodrigooler / example.json
Last active December 19, 2016 13:30
example.json
{
"secoes": [
{
"id": 1,
"description": "Seção 01",
"quadras": [
{
"id": 163,
"armazem": null,
"description": "A",
@rodrigooler
rodrigooler / api.js
Created December 22, 2016 15:52
api.js
const BASE_URL = 'http://localhost:8001/'
export async function callApi(endpoint, body, method, authenticated) {
const token = localStorage.getItem('id_token') || null
let config = {}
if (authenticated && token) {
config = {
method,
headers: {
@rodrigooler
rodrigooler / login.js
Created December 22, 2016 15:53
login.js
import { browserHistory } from 'react-router'
import { callApi } from '../middleware/api'
export const LOGIN_REQUEST = 'LOGIN_REQUEST'
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS'
export const LOGIN_FAILURE = 'LOGIN_FAILURE'
function requestLogin(creds) {
return {
type: LOGIN_REQUEST,
final List<Movie> movies = Arrays.asList(
new Movie(1, "Exterminador do Futuro"),
new Movie(2, "Exterminador do Futuro 2"),
new Movie(3, "Exterminador do Futuro 3"));
final Map<String, List<Movie>> movies = movies.stream().collect(Collectors.groupingBy(m -> m.getTitle()));
package com.luizalabs.repository;
import com.luizalabs.entity.Product;
import com.luizalabs.entity.ProductGroup;
import info.debatty.java.stringsimilarity.Levenshtein;
import org.springframework.stereotype.Repository;
import java.util.*;
import java.util.stream.Collectors;
@rodrigooler
rodrigooler / get_schema.js
Created February 15, 2018 16:12 — forked from ssomnoremac/get_schema.js
get your graphql schema
var fetch = require('node-fetch');
var fs = require('fs');
const {
buildClientSchema,
introspectionQuery,
printSchema,
} = require('graphql/utilities');
console.log(introspectionQuery);
def find_coupons(
_parent,
%{
city: city,
company_category_id: company_category_id,
coupon_category_id: coupon_category_id
},
_resolution
) do
{:ok,
const path = require('path');
module.exports = {
entry: './path/to/my/entry/file.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'my-first-webpack.bundle.js'
}
};
@rodrigooler
rodrigooler / prepack-gentle-intro-1.md
Created May 8, 2018 20:27 — forked from gaearon/prepack-gentle-intro-1.md
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.