Skip to content

Instantly share code, notes, and snippets.

View jh3y's full-sized avatar
🔨
Crafting

Jhey Tompkins jh3y

🔨
Crafting
View GitHub Profile
@jh3y
jh3y / index.html
Last active October 21, 2019 17:40
Electron - Get System Information Fiddle
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<div>
<h1>Get system information</h1>
<i>Supports: Win, macOS, Linux <span>|</span> Process: Both</i>
@jh3y
jh3y / activity-monitor.js
Created November 11, 2019 16:37
Foundation for activity monitor w/ Bangle.js
let buzzing = false
/**
* Hard-coded interval for now is not ideal
*/
const minutes = 10
const interval = minutes * (1000 * 60)
/**
* Can you detect if the Bangle is Buzzing or in Buzz in progress?
@jh3y
jh3y / rings.js
Created November 11, 2019 19:22
Create hypnotising/psychedelic rings
/**
* So you get 240 x 240 so you can technically do different things right?
* Colors?
*/
g.clear()
//g.drawImage(img, 100,100);
class Ring {
constructor() {
@jh3y
jh3y / morse.js
Created November 11, 2019 23:41
Morse code player
/**
* Teach a user morse code
*/
g.clear()
let index = 0;
const MORSE_MAP = {
a: '.-',
b: '-...',
@jh3y
jh3y / accel.js
Created November 12, 2019 13:39
Frequency beep. Adjustable polling for beeping based on accelerometer magnitude.
//Bangle.beep(10000, 10000)
let b = null;
let freq = 5000;
let radius = 0;
let DURATION = 50;
const LOWER = 500;
const LOWER_MAG = 0.97;
const UPPER_MAG = 1.03;
const UPPER = 10000;
@jh3y
jh3y / ringsv2.js
Created November 12, 2019 16:11
Rings v2 for Bangle.js
/**
* So you get 240 x 240 so you can technically do different things right?
* Colors?
*/
g.clear();
class Ring {
constructor() {
this.alive = true;
@jh3y
jh3y / morse.js
Created November 13, 2019 01:21
learn morse code with this little Espruino app
/**
* Teach a user morse code
*/
/**
* Constants
*/
const FONT_NAME = 'Vector12';
const FONT_SIZE = 80;
const SCREEN_PIXELS = 240;
const UNIT = 100;
@jh3y
jh3y / egghead.css
Created June 5, 2020 20:03
Egghead CSS
*,
*:before,
*:after {
box-sizing: border-box;
}
:root {
--size: 50;
--unit: calc((var(--size) / 769) * 1vmin);
--specs: #262626;
--shell-outline: #666;
@jh3y
jh3y / Blurbs.jsx
Created July 3, 2020 17:15
Very rough blurb code
const Blurbs = ({ onChange, blurb, noscript }) => {
return (
<Fragment>
{!noscript && (
<input
className="blurb-swapper"
onChange={onChange}
type="range"
min="0"
max={BLURBS.length - 1}
const myObject = {
a: 1,
b: 2,
...(false && { c: 3 }),
}
// myObject: { a: 1, b: 2 }
const myObject = {
a: 1,
b: 2,