Skip to content

Instantly share code, notes, and snippets.

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

Erifranck Nuñez erifranck

🏠
Working from home
View GitHub Profile
function bubbleSort() {
const len = this.length;
const inputArray = this;
for (let i=0; i < len; i++) {
for (let j=0; j < len - i; j++) {
if(inputArray[j] > inputArray[j+1]) {
const tmp = inputArray[j];
inputArray[j] = inputArray[j+1];
inputArray[j + 1] = tmp;
}
export function createStore(reducer, preloadedState) {
let listeners = [];
let currentState = reducer(preloadedState, { type: "" });
const subscribe = listener => {
listeners.push(listener);
let isSubscribed = true;
const unsubscribe = () => {
const index = listeners.indexOf(listener);
listeners = listeners.concat(
listeners.slice(0, index - 1),
@erifranck
erifranck / js
Last active March 17, 2019 00:25
Quicksort Javascript
function quicksort(list) {
if(list.length < 2) {
return list;
}
const [pivot, ...rest] = list; // define pivot and rest of array
const left = [], right = []; // initialize left and right
rest.forEach(num => num < pivot ? left.push(num) : right.push(num)); // set right if the number is equar to pivot or over, if the number is less than pivot put in left
return quicksort(left).concat([pivot], quicksort(right)); // concat values in order
}
@erifranck
erifranck / .vimrc
Created March 16, 2018 17:17 — forked from joegoggins/.vimrc
Mac Vim .vimrc file
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" ================ General Config ====================
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
@erifranck
erifranck / README-Template.md
Created March 10, 2018 23:46 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

import glamorous from 'glamorous'
import { Table as antTable } from 'antd'
// custom import
import { colors } from 'shared/constants'
export const Table = glamorous(antTable)({
background: colors.white,
boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.05)',
'& .ant-table-thead tr': {
@erifranck
erifranck / front-end-curriculum.md
Created January 21, 2017 00:56 — forked from stevekinney/front-end-curriculum.md
Front-end Curriculum Draft

Module 1

  • Semantic markup
  • HTML standards mode and quirks mode
  • HTML fundamentals
    • Classes and IDs
  • CSS fundamentals
    • Selectors
    • Resets and normalizers
    • The box model
@erifranck
erifranck / gulpfile.js
Created October 2, 2016 19:34 — forked from edouard-lopez/gulpfile.js
Gulp copy font-awesome files to dist/ directory
'use strict';
// Generated on 2014-04-14 using generator-leaflet 0.0.14
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();
@erifranck
erifranck / impress.jsx
Created August 21, 2016 16:13 — forked from scottpurdy/impress.jsx
react-impress
/** @jsx React.DOM */
var RenderedDeck = React.createClass({
render: function() {
return <div id={this.props.id} className="deck" dangerouslySetInnerHTML={{__html:this.props.contents}}></div>;
}
});
var Deck = React.createClass({
render: function() {