Skip to content

Instantly share code, notes, and snippets.

🤔
If Your company thrives on open-source software, allow me to help you give back.

wilmoore

🤔
If Your company thrives on open-source software, allow me to help you give back.
Block or report user

Report or block wilmoore

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
@wilmoore
wilmoore / use-fish-shell.sh
Created Apr 22, 2019
Install fish shell and make it your default shell
View use-fish-shell.sh
brew install fish
which fish | sudo tee -a /etc/shells
chsh -s $(which fish)
@wilmoore
wilmoore / server.js
Last active Apr 7, 2019
Intrinsic Node.js HTTP server taking into consideration IPv6 address (::)
View server.js
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
@wilmoore
wilmoore / server.js
Created Apr 7, 2019
Simple Node.js HTTP server with clean formatting of http address and port.
View server.js
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
@wilmoore
wilmoore / index.js
Last active Mar 12, 2019
Flattens a nested array recursively (A quick ES6 prototype of my https://www.npmjs.com/package/flatten-arr)
View index.js
const toString = Object.prototype.toString
/**
* Recursive list item concatenation.
*
* @param {Array} nested
* Nested array.
*
* @param {Array} flat
* Initial/Flattended array.
@wilmoore
wilmoore / index.js
Last active Feb 12, 2019
flatten kata
View index.js
exports.flatten = (input) => input.toString().split(',').map(Number)
@wilmoore
wilmoore / kubernetes-helm223.rb
Last active Aug 18, 2017
Installs Kubernetes Helm 2.2.3
View kubernetes-helm223.rb
class KubernetesHelm223 < Formula
desc "Installs Kubernetes Helm 2.2.3"
homepage "https://helm.sh"
url "https://storage.googleapis.com/kubernetes-helm/helm-v2.2.3-darwin-amd64.tar.gz"
sha256 "64420d467e03ceb666a4f22b89e08b93c06f76f5917fe539860b04cd5e5e515f"
head "https://github.com/kubernetes/helm.git"
def install
bin.install "helm"
end
@wilmoore
wilmoore / promiseWhile
Created Aug 10, 2017
Promise loop (can use as a long-running worker) with predicate.
View promiseWhile
/**
* Hat Tip: https://gist.github.com/victorquinn/8030190#gistcomment-1615901
*/
'use strict'
var Promise = require('bluebird')
var times = 0
function promiseWhile (predicate, action) {
@wilmoore
wilmoore / 01-composition-pipeline.js
Last active Jun 23, 2017
Functional Programming Fundamentals Code
View 01-composition-pipeline.js
'use strict'
const assert = require('assert')
function words (text) {
return text.split(/\s+/)
}
function reverse (list) {
return list.reverse()
@wilmoore
wilmoore / poke-pointfree.js
Created Jan 21, 2016
Pokemon API Exploration
View poke-pointfree.js
'use strict'
const all = require('promise-all')
const got = require('got')
const map = require('arraymap')
const mapcat = require('array-mapcat')
const pipe = require('function-pipeline')
const selectn = require('selectn')
const unique = require('array-unique')
@wilmoore
wilmoore / index.js
Created Nov 19, 2015
requirebin sketch
View index.js
'use strict'
var sum = require('lodash').sum
var threads = [
{
id: '1ad2a01b-209f-4216-85fb-a04c67655472',
subject: 'My Coverage & Benefits',
latestMessageId: '0dbae0cc-0a81-4376-9b99-9d4ac4d829c6',
unreadCount: 1,
messageCount: 2,
You can’t perform that action at this time.