Skip to content

Instantly share code, notes, and snippets.

View AlexZeitler's full-sized avatar
👷‍♂️
Building stuff

Alexander Zeitler AlexZeitler

👷‍♂️
Building stuff
View GitHub Profile
@AlexZeitler
AlexZeitler / requirements.txt
Created July 2, 2018 11:06 — forked from jarpy/requirements.txt
Serverless Elasticsearch Curator for AWS Lambda
certifi==2016.8.8
elasticsearch-curator==4.0.6
PyYAML==3.11
@AlexZeitler
AlexZeitler / install.txt
Last active February 1, 2023 02:41 — forked from tkfm-yamaguchi/lang.map.diff
source-highlight's language definition file for YAML
apt-get install source-highlight
# update .bashrc / .zshrc:
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -R '
# add yaml support as shown in lang.map.diff
const defaultFirst = 'A`'
const defaultSecond = 'B`'
const defaultThird = 'C`'
async function doFirst() {
// throw new Error('Error A')
return await 'A'
}
async function doSecond() {
@AlexZeitler
AlexZeitler / README.md
Created February 3, 2018 11:02 — forked from leosuncin/README.md
Install Powerline on Debian/Ubuntu
  1. Install pip sudo apt-get install python-pip or wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
  2. Install powerline sudo pip install powerline-status
  3. Download and install fonts git clone https://github.com/powerline/fonts.git && cd fonts && sh ./install.sh
  4. Add this lines to respective file
    .vimrc

set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
> " Always show statusline

@AlexZeitler
AlexZeitler / repro.txt
Created November 29, 2017 14:59 — forked from anonymous/repro.txt
vue.js / webpack / Windows 10 FCU WSL
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 8.4.0
npm install -g vue-cli
vue init webpack my-project
cd my-project
@AlexZeitler
AlexZeitler / async-either-with-promise.js
Created September 11, 2017 21:06 — forked from MikeBild/async-either-with-promise.js
Async Railway Oriented Programming in JS
#!/bin/env node
//thx to http://fsprojects.github.io/Chessie/a-tale-of-3-nightclubs.html
Promise.all([
suitablePersonEnterGayBar(),
unsuitablePersonEnterGayBar(),
])
.then(result => result.map((person, i) => `Person ${i+1}: ${person.cost || ''}${person.reasons.join(' ')}`))
.then(result => console.log(`Person entries\n${result.join('\n')}`));
@AlexZeitler
AlexZeitler / node-cluster-messaging.js
Created April 29, 2017 07:33 — forked from jpoehls/node-cluster-messaging.js
Simple message passing between cluster master and workers in Node.js
var cluster = require('cluster');
if (cluster.isWorker) {
console.log('Worker ' + process.pid + ' has started.');
// Send message to master process.
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'})
// Receive messages from the master process.
@AlexZeitler
AlexZeitler / gist:2c24a4d8ee10775f330447ff63bf19dc
Created February 12, 2017 20:13 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@AlexZeitler
AlexZeitler / vm-resize-hard-disk.md
Last active February 12, 2017 16:44 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@AlexZeitler
AlexZeitler / cpu-bound.js
Created October 25, 2016 11:18 — forked from MikeBild/cpu-bound.js
Node.js - CPU bound operations with Rx
const RxNode = require('rx-node');
const Rx = require('rx');
const spawn = require('child_process').spawn;
RxNode.fromStream(spawn('find', ['/','-type','f','-exec', 'cat', '{}', '\+']).stdout)
.map(x => x.toString())
.map(x => RxNode.fromStream(spawn('./word-count.js', [x]).stdout))
.mergeAll()
.map(x => x.toString())
.do(x => console.log(x))