Skip to content

Instantly share code, notes, and snippets.

Kevin Perez kevinnio

Block or report user

Report or block kevinnio

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
@kevinnio
kevinnio / adding-jest-to-a-babel-6-project.md
Last active Jun 17, 2019
Adding Jest to a Babel 6 project
View adding-jest-to-a-babel-6-project.md

Jest is an amazing testing tool developed by the folks at Facebook and maintained by a vast community of developers. Is one of the best ways to write and run Javascript tests. It should be really easy to setup starting from scratch, but what if we want to integrate it into an already initialized project? One which uses Babel 6 and already has a .babelrc file.

The problem with Babel 6

Jest requires Babel to transpile Javascript code that doesn't normally run on NodeJS environments, most commonly ES2015 modules. Problem is Jest dropped support for Babel 6 since 24.0.0 in favour of Babel 7, which introduces a lot of changes to how devs work with Babel. Jest recommends upgrading if your project is still on Babel 6, but not all projects can upgrade quickly. This blog post is for those kinds of projects.

Alternative setup

Let's start by i

@kevinnio
kevinnio / rules.md
Last active May 27, 2019
Mario Kart Tournament Rules
View rules.md

Mario Kart Tournament Rules

First stage

  • Groups will be composed of 4 players max.
  • Each group will play 1 Versus Mode round with the following rules:
    • 150cc race
    • Teams: No
    • Items: Normal
    • CPU Level: Hard
@kevinnio
kevinnio / code.txt
Created May 22, 2019
Example of Fira Code on GitHub
View code.txt
// FIRA CODE OFFICIAL REPO: https://github.com/tonsky/FiraCode
object o;
if (o is int i || (o is string s &&
int.TryParse(s, out i)) { /* use i */ }
var x = 0xABCDEF;
-> --> ==> != === !== && ||<=<
</><tag> http://www.hanselman.com
<=><!-- HTML Comment -->
i++; #### ***
View gist:5be3b5ec13f3f7b9e311b81cf9f06ac3
.CodeMirror-code,
.highlight pre,
.blob-code,
code {
font-family: 'Fira Code'
}
@kevinnio
kevinnio / md5rename
Last active May 2, 2019
Renames all files in the current dir using their MD5 checksums.
View md5rename
#! /bin/bash
md5 * | sed -e 's/MD5 (\([^.]*\)\(.[^)]*\)) = \(.*\)$/mv -v "\1\2" \3\2/' | sh
@kevinnio
kevinnio / spree_decorator.rb
Last active Oct 24, 2018
Spree/Solidus Module Decorator pattern
View spree_decorator.rb
require 'active_support/concern'
module MyNamespace::SpreeDecorator
extend ActiveSupport::Concern
included do
# Call base class methods here!
some_class_method :foo
some_class_method_with_block do
another_class_method :bar
@kevinnio
kevinnio / app.rb
Last active Oct 4, 2018
The OddEven kata
View app.rb
require './oddeven'
oddeven = OddEven.new
(1..100).each { |number| puts oddeven.print_number(number) }
@kevinnio
kevinnio / app.rb
Last active Oct 4, 2018
The FizzBuzz kata
View app.rb
require './fizzbuzz'
fizzbuzz = FizzBuzz.new
(1..100).each { |number| puts fizzbuzz.print_number(number) }
View remanent-orders.csv
Enterprise Key Buyer Organization Code Order No Revenue Requested Ship Date Order Date Status
5117452 SP_FL_55686 15 9/6/17 14:33 3300.100-Waved
5117452 SP_FL_55994 16.09 9/8/17 19:22 1300-Backordered
5117452 SP_FL_56005 20 9/9/17 1:32 3300.100-Waved
5117452 SP_FL_56070 15 9/9/17 10:56 3300.100-Waved
5117452 SP_FL_56449 15 9/12/17 14:14 3300.200-Picked
5117452 SP_FL_56454 15 9/12/17 16:02 3300.200-Picked
5117452 SP_FL_56599 15 9/13/17 13:49 3300.300-Manifested
5117452 SP_FL_56600 15 9/13/17 14:00 3300.300-Manifested
5117452 SP_FL_56601 0 9/13/17 14:06 3300.100-Waved
@kevinnio
kevinnio / deploy.sh
Last active Jul 5, 2017
Script para deplegar el SIIUTeM
View deploy.sh
#! /bin/bash
set -e
# ssh siiutem.net php artisan down
# Desplegar siiutem-repositorios
cd vendor/utem-dsi/siiutem-repositorios
git push origin develop:develop
# Desplegar siiutem
You can’t perform that action at this time.