Skip to content

Instantly share code, notes, and snippets.

export default `
type Author {
id: Int!
firstName: String
lastName: String
posts: [Post]
}
type Post {
id: Int!
export default `
type Query {
post(id: Int!): Post
posts: [Post]
author(id: Int): Author
}
`
@pechitook
pechitook / README.md
Created November 19, 2016 20:40
Push to deploy en hosting compartido con PHP

Crear archivo /pull.php

<?php

shell_exec('./pull.sh 2>&1');
echo "Done.";
@pechitook
pechitook / DJI.md
Created August 24, 2017 00:36
DJI - Combinar audio del cache del celular con el video original

Extraer audio del video:

ffmpeg -i audio.mp4 -map 0:a audio.aac -vn

Combinar audio en video

ffmpeg -i video.mp4 -i audio.aac -c copy -map 0:v:0 -map 1:a:0 videoconaudio.mp4
import { Component } from 'react';
import PropTypes from 'prop-types';
class KeyEvent extends Component {
listen = (event) => {
if (event.key === this.props.when) {
this.props.do();
}
}
/*
Importamos el store de verdad, el cual fue modificado para recibir un array
de middlewares que aplica además de los default (thunk en mi caso). Utilicé
la función `compose` de redux para esto, y quedó algo así:
```
export default (middlewares = []) => createStore(
reducer,
compose(applyMiddleware(thunk, ...middlewares),
)
```
import Store from 'test/Store'; // El store re piola que hicimos
describe('Shows modal', () => {
beforeEach(() => {
// inicializamos nuestro store
store = new Store();
// Disparamos acciones necesarias para poder tener los datos
return store.dispatch(loadPost(POST_ID)).then(() => {
// Limpiamos el log para poder tener asserts más limpitos
store.clearActions();