Skip to content

Instantly share code, notes, and snippets.

@w33ble
w33ble / design thinking.md
Last active April 27, 2024 05:30
Design Thinking

Design Thinking

A structured guide to the stuff you do anyway

design thinking diagram


Empathize

@w33ble
w33ble / docker-compose.advanced.yml
Last active August 1, 2023 13:37
Using jwilder/nginx-proxy with multiple compose files
version: '3'
services:
nginx-proxy:
image: nginx:alpine
container_name: proxy-nginx
environment:
- DEFAULT_HOST=hello.local
ports:
- 80:80
@w33ble
w33ble / list.txt
Created February 4, 2020 23:46
Open Bittorrent Trackers
http://tracker.opentrackr.org:1337/announce
udp://tracker.opentrackr.org:1337/announce
http://tracker.yoshi210.com:6969/announce
udp://tracker.yoshi210.com:6969/announce
http://tracker.internetwarriors.net:1337/announce
udp://tracker.internetwarriors.net:1337/announce
http://9.rarbg.com:2710/announce
udp://11.rarbg.com:80/announce
http://tracker.skyts.net:6969/announce
udp://tracker.skyts.net:6969/announce

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 / index.js
Last active September 22, 2022 07:49
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);
}
@w33ble
w33ble / docker-compose.yml
Last active April 8, 2022 12:59
Elastic Stack in Docker with Basic Auth via proxy
version: '2.2'
services:
proxy:
image: nginx:1-alpine
restart: always
ports:
- 5601:80
- 9200:9201
volumes:
@w33ble
w33ble / generate-ssm-env.js
Created June 23, 2021 18:19
Generate .ssm-env from your preferences.arc file
/* eslint @typescript-eslint/no-var-requires: 0 */
console.log('WARNING: Make sure you run `yarn arc env` before updating your env file')
const parse = require('@architect/parser')
const fs = require('fs/promises')
const readline = require('readline')
function ask(question) {
const rl = readline.createInterface({
@w33ble
w33ble / machine.js
Created April 15, 2020 18:35
messing with xstate
const { Machine, assign, interpret } = require('xstate');
const glassMachine = Machine(
{
id: 'glass',
// the initial context (extended state) of the statechart
context: {
amount: 0,
},
initial: 'empty',
@w33ble
w33ble / tweaks.md
Created January 8, 2020 18:07
MacOS Tweaks

Disable Window Animation

defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO

@w33ble
w33ble / hoc.tsx
Created September 6, 2019 03:50
i can haz type?
import { createElement, Attributes, ComponentType } from 'react';
import PropTypes from 'prop-types';
import { graphql } from '@apollo/react-hoc';
import { GraphQLRequest } from 'apollo-boost';
interface Config {
name: string;
}
interface Props {