Skip to content

Instantly share code, notes, and snippets.

View bmjjr's full-sized avatar
💭
Working on https://www.bomquote.com/

Bob Jordan bmjjr

💭
Working on https://www.bomquote.com/
View GitHub Profile
@rain-1
rain-1 / Modelling an Uncertain World.md
Last active August 19, 2023 06:16
Modelling an Uncertain World

I have included working code examples that can be run throughout, as well as graphs. I hope this helps make this easier to understand in a more hands on way.

The setup

Suppose you know that there are 10 balls in an urn, some are red and some are blue. So there are 11 different possible models for this situation:

  • M0: 0 red, 10 blue
  • M1: 1 red, 9 blue
  • ...
  • M10: 10 red, 0 blue
@sabarjp
sabarjp / gcode start for ender3 in prusaslicer with bltouch
Last active February 22, 2023 17:20
gcode start ender3 prusaslicer
M117 Heating... ;Put printing message on LCD screen
M300 S2500 P100; Beep
M204 T1250 ; sets acceleration (P, T) and retract acceleration (R), mm/sec^2
M221 S{if layer_height<0.075}100{else}100{endif} ; Set flow
M104 S140 ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
;G1 Z50 ; this is a good start heating position
G28 X Y; Home X Y
G1 Y10 ; this is a good start heating position
@me-no-dev
me-no-dev / IP5306.ino
Last active September 4, 2023 08:22
Sketch with IP5306 integration
#include "Arduino.h"
#include "Wire.h"
/*
** IP5306 Power Module
*/
/* M5 Defaults
KeyOff: Enabled
BoostOutput: Disabled
@DarthSim
DarthSim / Dockerfile
Created May 20, 2019 12:25
imgproxy + nginx
FROM darthsim/imgproxy:latest
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk --no-cache upgrade \
&& apk add --no-cache nginx
RUN echo -e "#!/bin/bash\nnginx && imgproxy" > /usr/local/bin/imgproxy-nginx
RUN chmod +x /usr/local/bin/imgproxy-nginx
RUN mkdir -p /run/nginx
@olljanat
olljanat / Find-OrphanDockerLayers.ps1
Last active September 6, 2023 17:54
Find Windows containers orphan layers
param (
[switch]$RenameOrphanLayers
)
If ($RenameOrphanLayers) {
Write-Warning "$($env:COMPUTERNAME) -RenameOrphanLayers option enabled, will rename all orphan layers"
}
# Get known layers on Docker images
[array]$ImageDetails += docker images -q | ForEach { docker inspect $_ | ConvertFrom-Json }
@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
import hmac
import hashlib
import base64
class ImgProxy:
"""
The class generates a signature for the imgproxy (https://github.com/DarthSim/imgproxy).
Author: Yehor Smoliakov (https://github.com/egorsmkv)
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active May 9, 2024 08:24
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@michaelgold
michaelgold / task.c
Created September 6, 2017 15:17
Taskwarrior Windows 10 Wrapper for Ubuntu Bash
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Forked from https://bitbucket.org/kvorobyev/taskwarriorc2/issues/32/wrapper-for-task-install-in-windows
// Compile in bash with the command: x86_64-w64-mingw32-gcc task.c -o task.exe
char* concat(const char *s1, const char *s2)
{
char *result = malloc(strlen(s1)+strlen(s2)+1);
@mobilinkd
mobilinkd / sds_scdp.py
Last active February 2, 2023 05:24
Screendump From Siglent DSO via VXI-11
#!/usr/bin/env python
import argparse
import sys, time
import pyvisa as visa
from pyvisa.constants import StatusCode
from PIL import Image
from io import BytesIO