Skip to content

Instantly share code, notes, and snippets.

View 6ewis's full-sized avatar

Lewis 6ewis

  • Toronto, Ontario
View GitHub Profile
@6ewis
6ewis / vim74_lua
Last active August 29, 2015 14:28 — forked from jdewit/vim74_lua
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
@6ewis
6ewis / mock_monster.rb
Created June 17, 2016 20:48 — forked from havenwood/mock_monster.rb
Mocking a few Monsters with Minitest::Mock
require 'minitest/mock'
##
# This monster eats Symbols. Give it a Symbol and how many to eat and nom nom!
monster = Minitest::Mock.new
monster.expect :eat, :nom_nom, [Symbol, Numeric]
##
# Let's verify the monster in fact ate its Symbols:
monster.verify
@6ewis
6ewis / ramda-title-case.js
Created January 22, 2019 16:46 — forked from mrwithersea/ramda-title-case.js
Ramda Title Case
import R from 'ramda';
const capitalize =
R.converge(
R.concat(),
[
R.compose(
R.toUpper,
R.head
),
@6ewis
6ewis / babel-webpack.md
Created May 15, 2019 06:55 — forked from ncochard/babel-webpack.md
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@6ewis
6ewis / SpeedTest.js
Created April 5, 2022 22:02 — forked from mjm918/SpeedTest.js
React native check internet speed
export const fetchParallel = (link,header, callback) =>{
const POOR = 150;
const MODERATE = 550;
const GOOD = 2000;
const _start = new Date().getTime();
const speedTester = RNFetchBlob
.config({