Skip to content

Instantly share code, notes, and snippets.

@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 / 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
@w33ble
w33ble / tweaks.md
Created January 8, 2020 18:07
MacOS Tweaks

Disable Window Animation

defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO

@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 / 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 {
/*
USAGE:
tdAffix.init({
menu_selector: ".td-header-menu-wrap",
menu_wrap_selector: ".td-header-menu-wrap-full",
tds_snap_menu: tdUtil.getBackendVar("tds_snap_menu"),
tds_snap_menu_logo: tdUtil.getBackendVar("tds_logo_on_sticky"),
menu_affix_height: 48,
menu_affix_height_on_mobile: 54
@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 / nginxproxy.md
Created May 31, 2018 21:14 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@w33ble
w33ble / index.mjs
Last active March 28, 2019 19:19
Simple Mosca MQTT server demo, with leveldb persistence
import mosca from 'mosca';
// source: https://github.com/mcollina/mosca/wiki/Mosca-basic-usage
const moscaSettings = {
port: 1883,
persistence: {
factory: mosca.persistence.LevelUp,
path: 'db',
},