Skip to content

Instantly share code, notes, and snippets.

View EyeOfMidas's full-sized avatar

Justin Gilman EyeOfMidas

View GitHub Profile
//Inspiration and heavy lifting credit goes to @lunasorcery
//https://twitter.com/lunasorcery/status/1361801141890220033
(() => {
let style = document.createElement('style');
style.innerHTML = '.alt-text-viewer { position: relative; text-align: center; background-color: rgba(0,0,0,0.75); color: white;padding:10px;font-family: sans-serif;}';
document.head.appendChild(style);
document.querySelectorAll('div[data-testid="tweetPhoto"]:not([aria-label="Image"]').forEach(elem => {
let div = document.createElement("div");
div.className = "alt-text-viewer";
id word
1 adorable
2 adventurous
3 aggressive
4 agreeable
5 alert
6 alive
7 amused
8 angry
9 annoyed
@EyeOfMidas
EyeOfMidas / animal-names.csv
Created January 18, 2021 12:52
A simple csv of animal names - scraped from https://a-z-animals.com/animals/
id name
1 Aardvark
2 Abyssinian
3 Adelie Penguin
4 Affenpinscher
5 Afghan Hound
6 African Bush Elephant
7 African Civet
8 African Clawed Frog
9 African Forest Elephant
@EyeOfMidas
EyeOfMidas / css-colors.csv
Created January 18, 2021 12:44
A simple csv of the named css colors - scraped from https://www.w3schools.com/cssref/css_colors.asp
id name display hex
1 AliceBlue Alice Blue #F0F8FF
2 AntiqueWhite Antique White #FAEBD7
3 Aqua Aqua #00FFFF
4 Aquamarine Aquamarine #7FFFD4
5 Azure Azure #F0FFFF
6 Beige Beige #F5F5DC
7 Bisque Bisque #FFE4C4
8 Black Black #000000
9 BlanchedAlmond Blanched Almond #FFEBCD
function asyncLoadGltf(loc) {
return new Promise((resolve, reject) => {
//this is now a manual async function. Instead of returning the object, it
//returns a Promise. When you call the resolve() function, it will complete
//the promise and will allow any `await` keywords to progress.
var gltfloader = new GLTFLoader();
return gltfloader.load(
loc,
function (gltf) {
resolve(gltf);
// Example minimal server from StackOverflow comment by user B T (https://stackoverflow.com/users/122422/b-t)
// https://stackoverflow.com/questions/6084360/using-node-js-as-a-simple-web-server/26354478#26354478
//
// run the server using `node server.js` and you can access any files that are in the same directory.
// in a browser, visit http://localhost:9615/[filename]
// example url (self reference) http://localhost:9615/server.js
var http = require('http')
var url = require('url')
@EyeOfMidas
EyeOfMidas / gist:c0820cc58611f2cda971615af042c17c
Last active September 6, 2020 00:48
javascript ping sound
// on Chrome this plays a quick ping
// on Firefox this plays a sustained ping (until the context is closed)
var end = 0.5;
var audioContext = new AudioContext();
var oscillatorNode = audioContext.createOscillator();
oscillatorNode.type = "sine";
oscillatorNode.frequency.value = 261.63; //middle C
var gainNode = audioContext.createGain();
gainNode.gain.value = 0.7;
@EyeOfMidas
EyeOfMidas / KeyCode.js
Last active May 20, 2020 00:32
KeyCode by Justin Gilman -Add this file at the top of any project that interacts with keyCode for a convenient way to reference the ASCII values. - MIT License
/*
KeyCode by Justin Gilman
Add this file at the top of any project that interacts
with keyCode for a convenient way to reference the ASCII values.
MIT License
*/
const KeyCode = {
Backspace: 8,
@EyeOfMidas
EyeOfMidas / ConfigurationLoader.cs
Created April 8, 2020 15:18
A simple appsettings.json Configuration loader/viewer for your dotnet core console app
// Create an appsettings.json in the root directory of your console application
// for example, it should look like:
// {
// "Environment": {
// "Token": "abc-123",
// "Name": "Production"
// }
//}
//
// In your Program.cs file, make sure to add:
@EyeOfMidas
EyeOfMidas / Page is LIT
Created October 18, 2017 17:47
A bookmark link to set any page you're viewing on fire
javascript:function f(){var e=document.createElement("div");e.style.height="250px",e.style.backgroundImage="url(https://static.tumblr.com/ylk3wsj/C0jo7z2ep/fire.gif)",e.style.backgroundRepeat="repeat-x",e.style.position="fixed",e.style.bottom="0",e.style.width="100%",document.body.appendChild(e)}f();