Skip to content

Instantly share code, notes, and snippets.

View jaythomas's full-sized avatar
🇹🇼

Jay Thomas jaythomas

🇹🇼
  • USA
View GitHub Profile
@jaythomas
jaythomas / tmux.conf
Last active December 19, 2017 15:42
tmux.conf
# options
set -s escape-time 0
set-option -g status-bg default
set-option -g status-fg default
set-option -g default-shell /usr/bin/zsh
set-option -g history-limit 5000
set -g default-terminal "screen-256color"
set -g base-index 1 # start counting from 1 instead of 0
set -g status-keys vi
set -g status-justify centre
@jaythomas
jaythomas / lipscript.js
Last active September 19, 2018 01:49
lisp-like language written in javascript
function tokenize(characters) {
return characters
.replace(/\s\s+/g, ' ')
.replace(/\(/g, ' ( ')
.replace(/\)/g, ' ) ')
.split(' ')
.filter(t => ' \t\n'.indexOf(t) === -1)
}
@jaythomas
jaythomas / esp8266-led-blink.ino
Created January 19, 2021 14:15
Wemos ESP8266 D1 Mini led blink script
@jaythomas
jaythomas / esp8266-led-swell.ino
Created January 19, 2021 15:22
Wemos ESP8266 D1 Mini led beacon example
// Wemos Mini D1 Pro pinout. This should have been provided by selecting the correct board but this
// board wasn't available when I looked for it so whatever this requires less dependency on the
// Arduino IDE configuration anyway.
// https://arduino-projekte.info/wp-content/uploads/2017/03/wemos_d1_mini_pro_pinout.png
byte PIN_D0 = 16;
byte PIN_D1 = 5;
byte PIN_D2 = 4;
byte PIN_D3 = 0;
byte PIN_D4 = 2;
byte PIN_D5 = 14;
@jaythomas
jaythomas / esp8266-hello-world.ino
Created April 8, 2021 16:35
Wemos ESP8266 D1 Mini hello world
void setup() {
Serial.begin(115200);
}
void loop() {
delay(1000);
Serial.println("Hello World!");
delay(1000);
Serial.println("Goodbye, Cruel World!");
}
@jaythomas
jaythomas / esp8266-rgb-blink.ino
Created April 8, 2021 16:38
Wemos ESP8266 D1 Mini RGB led blink
@jaythomas
jaythomas / esp8266-rgb-swell.ino
Last active May 27, 2024 22:54
Wemos ESP8266 D1 Mini RGB led swell
/* ***********************************************************
* Global Constants *
* Hardware Definitions *
* ********************************************************* */
// Wemos Mini D1 Pro pinout. This should have been provided by selecting the correct board but this
// board wasn't available when I looked for it so whatever this requires less dependency on the
// Arduino IDE configuration anyway.
// https://arduino-projekte.info/wp-content/uploads/2017/03/wemos_d1_mini_pro_pinout.png
byte PIN_D0 = 16;
@jaythomas
jaythomas / esp8266-wifi.ino
Last active August 10, 2024 18:57
Wemos ESP8266 D1 Mini wi-fi example
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char* ssid = "YourWifiSSID";
const char* password = "YourWifiPassword";
// Set a user ID we want to fetch information from
uint16_t user_id = 1;
void setup () {
@jaythomas
jaythomas / Markup.spec.js
Last active March 19, 2024 12:45
Markup.vue (Parse and display Markdown-ish text)
import { strictEqual } from 'assert';
import { describe, it } from '@jest/globals';
import { createLocalVue, mount, RouterLinkStub } from '@vue/test-utils';
import Vue from 'vue';
import { findId } from '~/helpers/test-utils';
import ElMarkup from './Markup';
const createWrapper = (options = {}) => {
const localVue = createLocalVue();