Skip to content

Instantly share code, notes, and snippets.

@DJStompZone
DJStompZone / Download file from URL.js
Created June 8, 2021 01:46 — forked from mogsdad/Download file from URL.js
In StackOverflow question #14573055, the question was how to "download" a file from a URL using Google Apps-Script. See http://stackoverflow.com/questions/14573055/can-i-download-file-from-url-link-generated-by-google-apps-script/14574217#14574217. You can't actually "download" the source file, because apps-script has no access to your PC's file…
/**
* Retrieve a file from the given URL, store into the named folder
* on Google Drive.
*
* @param {String} fileURL URL to source file, e.g. "http://mysite.com/files/file.val1.val22.zip"
* @param {String} folder Name of target folder on Google Drive
*
* @returns {Object} Response of operation, e.g.
* {rc:200,fileName:"test.zip",fileSize:92994392}
*/
@DJStompZone
DJStompZone / 1.svg
Created November 13, 2021 20:08
svg4everyone
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DJStompZone
DJStompZone / blockstate_protocol.md
Created June 18, 2022 02:47 — forked from Tomcc/blockstate_protocol.md
Block Changes in Beta 1.2.13

Block Storage & Network Protocol Changes

Paletted chunks & removing BlockIDs brings a few big changes to how blocks are represented. In Bedrock, Blocks used to be represented by their 8 bit ID and 4 bit data; this means that we can only represent 256 blocks and 16 variants for each block. As it happens we ran out of IDs in Update Aquatic, so we had to do something about it :)

After this change, we can represent infinite types of Blocks and infinite BlockStates, just like in Java. BlockStates are what is sent over the network as they are roughly equivalent to the old ID+data information, eg. they're all the information attached to a block.

BlockStates are serialized in two ways:

PersistentID: a PersistentID is a NBT tag containing the BlockState name and its variant number; for example

@DJStompZone
DJStompZone / index.html
Last active September 18, 2022 12:59
This form :has whimsical touches ✨
<html>
<head>
<link href="https://gist.githubusercontent.com/DJStompZone/99e84c6198db753d2a7dcfb214775c2a/raw/d1bb4e55a78bc553b55d9a6601fdc77f7be3329d/style.css" rel="stylesheet" />
<link href="https://unpkg.com/open-props/colors-hsl.min.css" rel="stylesheet" />
<link href="https://unpkg.com/open-props/open-props.min.css" rel="stylesheet" />
<link href="https://unpkg.com/open-props/normalize.min.css" rel="stylesheet" />
</head>
<body>
<form action="">
<div class="form-group">
@DJStompZone
DJStompZone / index.html
Created December 31, 2022 14:42
Newton's CSS cradle
<div class="cradle">
<div class="floor"></div>
<div class="wood base">
<div class="left"></div>
<div class="right"></div>
<div class="front"></div>
<div class="back"></div>
<div class="top">
@DJStompZone
DJStompZone / audio-visualizer-based-on-three-js.markdown
Created December 31, 2022 15:10
Audio Visualizer based on Three.js

Audio Visualizer based on Three.js

I wanted to use the Web Audio API, so made this music visualizer. The basic idea came from a pen I found here on codepen itself ( will link to it as soon as I find it ).

To use> Just upload any mp3 file and watch the bubble do weird things!

( Let me know what you think in the comments - good/bad/ugly )

A Pen by Prakhar Bhardwaj on CodePen.

@DJStompZone
DJStompZone / MD_CRASH_COURSE.md
Created April 19, 2023 21:45
Markdown crash course

Markdown

"It's easier than it looks!"

  • Famous Last Words

So... You want to write a README?

Let's go over the basics

@DJStompZone
DJStompZone / README.md
Created September 22, 2023 18:36
The Ultimate Home Lab

Ultimate Home Lab

A Masterclass in Computing and Networking

By: Shadowdrums

Introduction

Welcome to a guided tour of one of the most comprehensive and advanced home lab setups you'll likely encounter. Designed with meticulous attention to detail and an evident depth of understanding of computing, networking, and cybersecurity, this home lab serves as a practical, educational, and experimental platform for a myriad of I.T. disciplines.

@DJStompZone
DJStompZone / pillow_cropper.py
Created November 29, 2023 02:32
Crop an Image With Pillow
from PIL import Image
import io
from typing import Tuple, Optional, Bytes
def crop_image(image_bytes: Bytes, new_size: Optional[Tuple[int, int]] = (2400, 2400)) -> Bytes:
"""
Crops an image from a byte buffer to a specified size and returns the cropped image as a byte buffer.
This function takes an image in the form of a byte buffer, crops it to the specified dimensions,
and returns the cropped image as a byte buffer. The cropping is centered, meaning the function
@DJStompZone
DJStompZone / day2.py
Created December 4, 2023 10:16
Advent of Code - Day 2
inputs_file = "inputs.txt"
sanity_check_data = {
"inputs": [
"Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green",
"Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue",
"Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red",
"Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red",
"Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green"
],