Skip to content

Instantly share code, notes, and snippets.

View heanfig's full-sized avatar
🏠
Working from home

Herman Andres Figueroa heanfig

🏠
Working from home
View GitHub Profile
@heanfig
heanfig / vite-testing-config.md
Created January 9, 2023 21:53 — forked from Klerith/vite-testing-config.md
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@heanfig
heanfig / options-in-typescript.ts
Created March 1, 2020 15:47 — forked from bcherny/options-in-typescript.ts
Options in TypeScript
type None = {
flatMap<U>(f: (value: null) => Option<U>): None
getOrElse<U>(def: U): U
isEmpty(): true
map<U>(f: (value: null) => U): None
nonEmpty(): false
orElse<U>(alternative: Option<U>): Option<U>
}
type Some<T> = {
@heanfig
heanfig / sass-7-1-pattern.scss
Created December 19, 2018 11:24 — forked from rveitch/sass-7-1-pattern.scss
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@heanfig
heanfig / SassMeister-input.scss
Created October 23, 2018 05:21 — forked from pdaoust/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
// 'map', 'transform', 'select', or 'project' function. Iterate over a list,
// performing a function on each item, and collecting the new items. Each
// function takes an item as a first argument and returns a transformed item.
// You can pass additional arguments to the function too, which is a decent poor
// man's function composition.
Organization name: leexij@gmail.com
Serial Key: eNrzzU/OLi0odswsqslJTa3IzHJIz03MzNFLzs+tMTQyNrcwsTQyAIEa5xpDAIFxDy8k
@heanfig
heanfig / xampp_php7_xdebug.md
Created March 12, 2018 23:23 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

@heanfig
heanfig / foo.js
Created February 18, 2018 17:50 — forked from vvgomes/foo.js
Ramda vs Lodash
var _ = require("lodash");
var R = require("ramda");
var companies = [
{ name: "tw", since: 1993 },
{ name: "pucrs", since: 1930 },
{ name: "tw br", since: 2009 }
];
var r1 = _(companies).chain()
@heanfig
heanfig / fibonacci-generator.js
Created October 24, 2017 03:30 — forked from jfairbank/fibonacci-generator.js
Fibonacci ES6 Generator
function *fibonacci(n) {
const infinite = !n && n !== 0;
let current = 0;
let next = 1;
while (infinite || n--) {
yield current;
[current, next] = [next, current + next];
}
}
@heanfig
heanfig / publickey-git-error.markdown
Created July 10, 2017 01:06 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@heanfig
heanfig / gist:1f3eba8e03fdbd613778b6c8736a6efd
Created April 29, 2017 18:27 — forked from murum/gist:47b35085dfb603d56b82
Wordpress gulp with PHP browsersync
///// Plugin Includes /////
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
plumber = require('gulp-plumber'),
concat = require('gulp-concat'),
jshint = require('gulp-jshint'),
autoprefixer = require('gulp-autoprefixer'),
browserSync = require('browser-sync'),
reload = browserSync.reload,
sass = require('gulp-sass');