Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / dom3d.js
Last active December 17, 2024 02:42
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@MarcoEidinger
MarcoEidinger / TableWithCodeTipsAndExamples.md
Last active November 27, 2024 18:46
Master GitHub markdown tables with code blocks

Master GitHub markdown tables with code blocks

  1. Use HTML tags to define the table to get the best layout result
  2. Use either backticks (```) or the HTML pre element with attribute lang
  3. Keep a blank line before and after a code block for correct formatting and syntax highlighting

Good

Example: nice looking table to show HTTP Responses

@pmalin
pmalin / MicroBotVDUStringExample.cs
Last active December 18, 2020 11:46
BBC Micro Bot VDU String Example
using System;
using System.Diagnostics;
// Example C# program to make a VDU string for BBC Micro Bot
// @P_Malin
// Based on stuff from @rheolism and @Kweepa
namespace MakeData
{
class Program
@bencbartlett
bencbartlett / hydrogen_orbitals.nb
Last active November 27, 2021 03:10
Mathematica code for this animation of transitions in hydrogen wavefunctions: https://twitter.com/bencbartlett/status/1287802625602117632
<< MaTeX`
SetOptions[MaTeX, "Preamble" -> {"\\usepackage{color,txfonts}"}];
SetDirectory[NotebookDirectory[]];
Clear[drawLadder];
drawLadder[n_, l_, m_, imsize_: 500] := Module[{maxrungs = 5, mag = 4},
Graphics[{
White, Opacity[1], Thickness[.02], Dashing[None],
Table[Line[{{0, k}, {1, k}}], {k, maxrungs}], (*draw n lines*)
@0xabad1dea
0xabad1dea / speedrunning-faq.md
Last active November 16, 2024 13:40
Speedrunning FAQ/Glossary

Speedrunning FAQ/Glossary

by 0xabad1dea September 2018

You may notice a decidedly Nintendo bias to the examples. I can't change who I am.

What is Speedrunning?

Speedrunning is:

  • Completing a video game
@iwalpola
iwalpola / stm32_gpio_reg.md
Last active December 10, 2024 11:22
STM32 GPIO registers cheatsheet
@andykuszyk
andykuszyk / Installing multiple Bamboo remote agents on a single machine.md
Last active December 14, 2023 18:04
Installing multiple Bamboo remote agents on a single machine (as a Windows service)

Installing multiple Bamboo remote agents on a single machine (as a Windows service)

I've recently been setting up multiple remote agents for Bamboo on the same machine to run as Windows service instances. Although there's information out there as to how this is achieved, I thought I'd document all the steps here for future reference.

Pre-requisites

Assumptions are that you have:

  • Installed Bamboo on a server somewhere;
  • Have another machine that you want to install remote agents on;
  • This other machine can access the server over http;
  • The other machine has java installed on it;
@ousttrue
ousttrue / vbo_sample.py
Last active May 19, 2022 15:27
PyOpenGL vbo sample
# coding: utf-8
# 20190825 rewrite
import sys
import array
import ctypes
import struct
from typing import Any
from OpenGL.GL import *
from OpenGL.GLUT import *
@zhangzhensong
zhangzhensong / cvgltexture.cpp
Last active October 11, 2022 20:52
Converting OpenCV Mat to OpenGL texture
// don't forget to include related head files
void BindCVMat2GLTexture(cv::Mat& image, GLuint& imageTexture)
{
if(image.empty()){
std::cout << "image empty" << std::endl;
}else{
//glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glGenTextures(1, &imageTexture1);
glBindTexture(GL_TEXTURE_2D, imageTexture1);