Skip to content

Instantly share code, notes, and snippets.

Avatar

Joe Fleming w33ble

View GitHub Profile
@w33ble
w33ble / machine.js
Created Apr 15, 2020
messing with xstate
View machine.js
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 Feb 4, 2020
Open Bittorrent Trackers
View list.txt
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
View tweaks.md

Disable Window Animation

defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO

@w33ble
w33ble / docker-compose.advanced.yml
Last active Feb 9, 2020
Using jwilder/nginx-proxy with multiple compose files
View docker-compose.advanced.yml
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 Sep 6, 2019
i can haz type?
View hoc.tsx
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 {
View affix.js
/*
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 Nov 5, 2018
Elastic Stack in Docker with Basic Auth via proxy
View docker-compose.yml
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 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?
View nginxproxy.md

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 Mar 28, 2019
Simple Mosca MQTT server demo, with leveldb persistence
View index.mjs
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',
},
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Addressable RGB LED</title>
<script src="serial.js"></script>
<script src="rgb.js"></script>
</head>
<body>
<p>
<button id="connect">Connect</button> <span id="status"></span>