This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WORK_COUNT = 1000 | |
const EXAMPLE_PACKET = { | |
action: 'news/latest/onWebSocketNewsItemUpdate', | |
data: 1234, | |
type: 'INSERT' | |
} | |
// This represents some synchronous busy-work in JS, like calling ws.write. | |
// The original code doesn't do anything async or wait on any callbacks. | |
function writePacket(packet) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
08-24 17:15:58.360 2605 2643 I ActivityManager: Displayed me.overflo.mastermine/com.unity3d.player.UnityPlayerActivity: +262ms | |
08-24 17:15:58.374 14159 14174 I Unity : MemoryManager: Using 'Dynamic Heap' Allocator. | |
08-24 17:15:58.391 14159 14174 I zygote : Rejecting re-init on previously-failed class java.lang.Class<com.unity3d.player.AssetPackManagerWrapper$b>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/play/core/assetpacks/AssetPackStateUpdateListener; | |
08-24 17:15:58.391 14159 14174 I zygote : at boolean com.unity3d.player.UnityPlayer.nativeRender() ((null):-2) | |
08-24 17:15:58.391 14159 14174 I zygote : at boolean com.unity3d.player.UnityPlayer.access$300(com.unity3d.player.UnityPlayer) ((null):-1) | |
08-24 17:15:58.391 14159 14174 I zygote : at boolean com.unity3d.player.UnityPlayer$e$1.handleMessage(android.os.Message) ((null):-1) | |
08-24 17:15:58.391 14159 14174 I zygote : at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102) | |
08-24 17: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import * | |
from time import sleep | |
from shutil import get_terminal_size | |
i = 0 | |
w = 103 | |
while True: | |
w = get_terminal_size((80, 20)).columns | |
for x in range(1, floor((sin(i) + 1) * (w / 2))): print(" ", end='') | |
print("█") | |
sleep(0.01) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const aS = document.getElementsByTagName('a') | |
for (const a of aS) { | |
a.addEventListener('mousedown', (e) => { | |
window.location.href = e.target.attributes.href.value | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIDI song genereator | |
const notePallette = [44, 46, 49, 51, 53, 56] | |
function getPallette () { | |
return notePallette | |
} | |
// eslint-disable-next-line | |
class Song { | |
constructor (bpm) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const div = document.querySelector('div') | |
const cnv = document.querySelector('canvas') | |
const ctx = cnv.getContext('2d') | |
let parts = 10 | |
function draw () { | |
div.innerHTML = `n = ${parts}` | |
ctx.clearRect(0, 0, cnv.width, cnv.height) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Very hacky script written quickly, but it works. | |
// Didn't feel like taking the time to get billed for more GB-Months | |
// Requires aws CLI installed and configured with auth - must use output type json | |
// Usage: | |
// aws s3api list-buckets --query "Buckets[].Name" | xargs node backupAndRemoveS3.js | |
const { spawn } = require('child_process') | |
const { existsSync, mkdirSync } = require('fs') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo rm -rf node_modules && npm i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled, { keyframes } from 'styled-components' | |
const shimg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANcAAAABCAYAAABNGjuHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTC |