Skip to content

Instantly share code, notes, and snippets.

View igorrmotta's full-sized avatar
💭
I may be slow to respond.

igorrmotta igorrmotta

💭
I may be slow to respond.
View GitHub Profile
@igorrmotta
igorrmotta / test-changed-files.js
Last active June 10, 2020 09:40
Jest - Test changed files only
const execa = require('execa');
const path = require('path');
const glob = require('glob');
// === === UTILS === ===
const run = async (cmd, stdio) => {
const options = !stdio ? { shell: true } : { shell: true, stdio: 'inherit' };
const { stdout, stderr, exitCode } = await execa(cmd, options);
if (stderr || exitCode === 1) {
@igorrmotta
igorrmotta / download_egghead_videos.sh
Last active May 6, 2019 04:36 — forked from mnsami/download_egghead_videos.sh
this script is to download egghead videos using youtube-dl
#!/bin/bash
COURSENAME=$1
TYPE=$2
youtube-dl --download-archive "$COURSENAME/archive.txt" -o "$COURSENAME/%(playlist_index)s_%(title)s" "https://egghead.io/$TYPE/$COURSENAME"
@igorrmotta
igorrmotta / server.ts
Created December 24, 2017 04:35
John McAfee Twitter Alerts
import * as Twit from 'twit';
import * as nodemailer from 'nodemailer';
// Environment Variables
namespace NodeJS {
export interface ProcessEnv {
CONSUMER_KEY: string;
CONSUMER_SECRET: string;
ACCESS_TOKEN: string;
ACCESS_TOKEN_SECRET: string;
import * as Immutable from 'immutable';
import { combineReducers } from 'redux-immutable';
import { handleActions, Action } from 'redux-actions';
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';
const FOO_ACTION = 'FOO_ACTION';
interface FooAction { param: string; };
const fooAction = (param: string): Action<FooAction> => {
return { type: FOO_ACTION, payload: { param } };
@igorrmotta
igorrmotta / bug-react16-with-reacttransitiongroup.jsx
Last active October 3, 2017 05:45
This snippet reproduces a bug with React@16 and react-transition-group. For some reason, the new reconciler algorithm of react removes the css effect when componentDidMount is fired. But anything that happens after that point, works.
import React, { Component } from 'react';
import Transition, { ENTERING, ENTERED } from 'react-transition-group/Transition';
import './App.css';
const duration = 8000;
const fadeStyles = {
[ENTERING]: 'in',
[ENTERED]: 'in',
};
@igorrmotta
igorrmotta / 0_reuse_code.js
Created August 29, 2017 10:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@igorrmotta
igorrmotta / .gitignore
Created July 2, 2016 09:40 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore