Skip to content

Instantly share code, notes, and snippets.

Sebastián González sebastialonso

  • Nursoft
  • Santiago, Chile
Block or report user

Report or block sebastialonso

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
@sebastialonso
sebastialonso / gist:0df73421dd4184e8de69893391cf91ff
Created Oct 1, 2018
t080_template_asisgnación_de_responsabilidad
View gist:0df73421dd4184e8de69893391cf91ff
Incluir acá la meta semanal del equipo
Subequipo (pinnear a cada miembro del subequipo anteponiendo "@")
-------------------------------------------------
* Responsabilidad 1
* Responsabilidad 2
* Responsabilidad N
View nested_aggs.sh
curl -X POST -H 'Content-Type: application/json' http://localhost:9200/data-obj/data-obj/_search?size=0&pretty -d '
{
"aggs": {
"range_agg": {
"range": {
"field": "age",
"ranges": [
{"to": 20},
{"from": 20, "to": 25},
{"from": 25, "to": 30},
@sebastialonso
sebastialonso / aggs.sh
Last active Mar 13, 2018
Aggregation in Elastic
View aggs.sh
curl -X POST -H 'Content-Type: application/json' http://localhost:9200/data-obj/data-obj/_search?size=0&pretty -d '
{
"aggs": {
"range_agg": {
"range": {
"field": "age",
"ranges": [
{"to": 20},
{"from": 20, "to": 25},
{"from": 25, "to": 30},
@sebastialonso
sebastialonso / Guardian JWT.md
Created Nov 3, 2017 — forked from nikneroz/Guardian JWT.md
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.
View Guardian JWT.md

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.

View 4.1.js
{
type: 'GET_ISSUES',
payload: [{ title: 'Login doesnt work!', author_id: 3 }, { title: 'Weird error on toolbar', author_id: 3 }]
}
View 5.js
import React from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {getIssues} from '../actions/issues_actions'
class IssuesIndex extends React.Component {
render() {
return <div>Yay</div>
}
View 4.js
import Request from 'superagent';
export function getIssues() {
const request = Request
.get('http://issues.com/issues')
return (dispatch) => {
request.end((err, res) => {
if (res.ok)
dispatch({
type: 'GET_ISSUES',
View 3.1.js
export default function(state = null, action) {
switch(action.type) {
case 'GET_ISSUES':
return action.payload;
}
return state;
}
View 3.js
import {combineReducers} from 'redux';
import IssuesReducer from './issues/issues_reducer';
const rootReducer = combineReducers({
issues: IssuesReducer
});
export default rootReducer;
@sebastialonso
sebastialonso / 2.js
Created Dec 4, 2016
Router_middleware
View 2.js
import {Provider} from 'react-redux';
import {createStore, applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
import allReducers from './reducers/root_reducer';
let createStoreWithMiddleware = applyMiddleware(thunk)(createStore);
const RouterComponent = (props) => {
const routes = (
You can’t perform that action at this time.