Skip to content

Instantly share code, notes, and snippets.

@w33ble
w33ble / directive.js
Last active January 13, 2017 22:19
kibana angular examples
import uiModules from 'ui/modules';
import template from './component.html';
const app = uiModules.get('kibana');
app.directive('component', function () {
return {
restrict: 'E',
replace: true,
template: template,
@w33ble
w33ble / index.js
Last active August 28, 2024 10:27
native promise mapSeries implementation
function mapSeries(arr) {
if (!Array.isArray(arr)) throw new Error('mapSeries requires an Array');
const length = arr.length;
const results = new Array(length);
arr.reduce((chain, item, i) => {
return chain.then(() => item).then(val => results[i] = val);
}, Promise.resolve())
.then(() => results);
}

pdfmake

Use in node.js

The module on npm exposes the pdfmake Printer, which the docs themselves do not cover. Using it is pretty simple though.

var path = require('path');
var Printer = require('pdfmake');
@w33ble
w33ble / 1-instructions_1.8.md
Last active August 29, 2015 14:17
Minecraft Mods
@w33ble
w33ble / book_of_chris.md
Last active August 29, 2015 14:15
The Book of Chris™
  • Templates are not a separation of concerns, it's a separation of technologies
  • Smart people look things up, dumb people make things up

Stuff that happened at work

  • Weekly meeting where we share useful tech & tips
  • Arguing about these buttons is like looking at a witch and arguing about removing a single wart
  • The coffee nap
  • Eventually consistent = eventually messed up
  • "Making Charts and Breaking Hearts!"
@w33ble
w33ble / Planning.md
Last active August 29, 2015 14:14
Enhance Planning and Post-mortem Notes

Enhance

Technology

  • Webpack
    • Web Components - webcomponents.js
    • ES6 - 6to5 transpiler
    • Less
  • Page.js
ddoollooodddxxxxddollodxxdllodoooodddoddlcldddddddooddoodddddollllldxxdddooo
xdxxxddddlloxxxxxxxdddxxxxodxdooooddddddoodddddddddddddddddddolloddxxxxxdood
xddddxxddooloooodxxxxdxxxxxxxoloddddddddddddddddddddddddddddddddxxxdoddddodd
ddllooddddolllooxxxxdxxxxdxxddddddddddddddddddxdddxddddddxxdddddxxxdloxxxxxx
lloddddddoodddxxxxxxxxxxxdddddddddddddddddddddddddxxddddxxddddddddddoodxxxxx
ooddolooooodxxxxdoodddddddddddddddddddddddddxdxxxdxxxdddddddddddxdxxoodxxdxd
ddxdolloddoodddddodddddddddoddddddddxdddxxxxxddxxddxxxddxxdddddddddxxxxdddxd
xdxdoloodxdooodddxdddddddddodddxxxdxxdddxdddddddddddddddddddddddddddxxxddddd
dddddxdlloddddxddxdddddddddddddxxxxxxdddxxdddddddddddddddddddddddxdddddddddd
lllodxdllllodxxxddddddddddddddddxxxxdddddddddddddddddddddddddddddddddxxddddd
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@w33ble
w33ble / Vagrantfile
Last active August 29, 2015 14:04
Simple shell-based Vagrant setup for ElasticSearch
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.provision :shell, :path => "provision.sh"
config.vm.network :forwarded_port, host: 9200, guest: 9200
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "60", "--cpus", "1"]
vb.memory = 512
end
@w33ble
w33ble / gist:c6f4c0181f276d3cef87
Created July 14, 2014 00:26
Pete Hunt React Reddit Comment

Hey, I'm the React zealot on Reddit (slash on the core team :)) I expect lots of debate from this :)

I wrote a blog post a while ago about this: http://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-AngularJS-A-Closer-Look[22]

First of all I think it's important to evaluate technologies on objective rather than subjective features. "It feels nicer" or "it's cleaner" aren't valid reasons: performance, modularity, community size and ease of testing / integration with other tools are.

I've done a lot of work benchmarking, building apps, and reading the code of Angular to try to come up with a reasonable comparison between their ways of doing things.

Community / project maturity