Skip to content

Instantly share code, notes, and snippets.

@knoopx
knoopx / README.md
Last active September 13, 2025 19:41
Creality Ender 3 Stock Factory Vref

Creality3D v1.1.2 stock vref values

A4988 Drivers
Vref set to ~90% of stepper rated current
Rs = 0.1ohm

X = 0,58v (0,725A)
Y = 0,58v (0,725A)
Z = 0,58v (0,725A)
@iandanforth
iandanforth / continuous_cartpole.py
Last active January 9, 2025 19:51
Continuous Cartpole for OpenAI Gym
"""
Classic cart-pole system implemented by Rich Sutton et al.
Copied from http://incompleteideas.net/sutton/book/code/pole.c
permalink: https://perma.cc/C9ZM-652R
Continuous version by Ian Danforth
"""
import math
import gym
@imbrish
imbrish / MacroServiceProvider.php
Created January 30, 2018 14:46
Locale-aware & multi-key sorting of arrays
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Support\ServiceProvider;
class MacroServiceProvider extends ServiceProvider
{
/**
@tobias-kuendig
tobias-kuendig / instructions.md
Last active October 9, 2025 20:27
Elementary OS redshift-gtk Indicator Icons
  1. Copy redshift-status-off.svg and redshift-status-on.svg to /usr/share/icons/hicolor/scalable/apps/
  2. Restart redshift-gtk

Or run the following commands:

wget https://gist.github.com/tobias-kuendig/d055892720cf09ae1a9d82075fb0f408/raw/5d3625e5f4ac7686d7b40880a211ee72f74ea3d3/redshift-status-off.svg -O /tmp/redshift-status-off.svg
wget https://gist.github.com/tobias-kuendig/d055892720cf09ae1a9d82075fb0f408/raw/5d3625e5f4ac7686d7b40880a211ee72f74ea3d3/redshift-status-on.svg -O /tmp/redshift-status-on.svg
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active December 28, 2025 20:08
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@PiiXiieeS
PiiXiieeS / Insert a progress bar to Powerpoint presentation .md
Last active May 15, 2025 06:35
Insert a progress bar to Powerpoint presentation

Intro

To view the progress of a Powerpoint presentation, a progress bar can be displayed at the bottom of the slide show.

How to proceed

Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

In the new window, select Insert > Module and copy this text in the blank page:

Sub AddProgressBar()
    On Error Resume Next
@rday
rday / numpy_ma.py
Created June 5, 2013 18:53
Numpy moving average
import numpy as np
def moving_average(data_set, periods=3):
weights = np.ones(periods) / periods
return np.convolve(data_set, weights, mode='valid')
data = [1, 2, 3, 6, 9, 12, 20, 28, 30, 25, 22, 20, 15, 12, 10]
ma = moving_average(np.asarray(data), 3)
assert (np.around(ma, decimals=2)==np.array([2.0, 3.67, 6.0, 9.0, 13.67, 20.0, 26.0, 27.67, 25.67, 22.33, 19.0, 15.67, 12.33])).all() == True
@cosimo
cosimo / parse-options.sh
Created September 21, 2012 09:31
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"