Skip to content

Instantly share code, notes, and snippets.

@Ilgrim
Ilgrim / .vimrc
Created August 23, 2024 08:11 — forked from rocarvaj/.vimrc
Minimal .vimrc for C/C++ developers
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
@Ilgrim
Ilgrim / README.md
Created May 11, 2024 17:03 — forked from subfuzion/README.md
vim/neovim configuration

I recently switched over to neovim (see my screenshots at the bottom). Below is my updated config file.

It's currently synchronized with my .vimrc config except for a block of neovim-specific terminal key mappings.

This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer.

These days I primarily develop in Go. I'm super thrilled and grateful for fatih/vim-go,

@Ilgrim
Ilgrim / gist:92eaa13c3f206ca9172815d17caccb62
Created February 11, 2024 18:43 — forked from TobiasWooldridge/gist:22f0cdca75190b9a473f
How to Unbrick a Kindle Paperwhite

How to unbrick an Amazon Kindle Paperwhite™

This guide instructs you in how to unbrick an Amazon Kindle Paperwhite. The consequences of following it are your own responsibility. This method (opening the Kindle and using the serial interface) should be a last resort and should only be considered if other methods fail

The Guide

  1. Pry open Kindle using a prying tool
  2. Unscrew the screen and remove it from the base. Note that there's a screw hidden under the adhesive at the top in the middle
  3. Solder tin wire to serial ports on the bottom
  4. Attach tin wire to USB TTY device (order is ground, RX, TX, from the kindle's perspective, where GND is the smallest pad) and plug USB TTY device into your computer
  5. Open Putty on your computer in serial mode, with the serial port specified as your USB device and baud configured to 115200
@Ilgrim
Ilgrim / mini-stc-t12-menu.md
Created January 15, 2024 02:23 — forked from rockavoldy/mini-stc-t12-menu.md
Menu P00-P11 on Mini STC T12 Controller

DIY T12 Soldering Station with Mini STC T12 Controller

So i have build myself an soldering station to replace my Dekko "Ol' reliable" 40w hand solder, it works and do the job, but it takes forever to meet the heat temperature. So i build a new one with around 300k IDR

The controller is Mini STC T12 rev 2.1 that can be found from ShopeeID around 130k IDR, or on aliexpress at around 8 USD. I pick the LED version since it's way more cheaper than OLED and STM32 edition, and i don't need any features other than variable temperature and standby mode.

For the handle, i got it from Tokopedia at around 130k IDR. This handle is for Hakko FX9501, but i only need the handle and the pin inside to connect with the T12 solder tips.

For the tips, i got it from aliexpress too, find cheap tips and pay it along with the voucher, so i just need to pay around 4 USD for 3pcs T12 soldering tips.

@Ilgrim
Ilgrim / stc15f_prog.c
Created January 13, 2024 23:16 — forked from zerog2k/stc15f_prog.c
stc mcu programmer sample code from stc website for stc15f series, with some google translate ;)
/*---------------------------------------------------------------------*/
/* --- STC MCU Limited ------------------------------------------------*/
/* --- To be downloaded from the ISP chip (limited STC15 series), for example using the main chip -----------------*/
/* --- Mobile: (86)13922805190 ----------------------------------------*/
/* --- Fax: 86-755-82905966 -------------------------------------------*/
/* --- Tel: 86-755-82948412 -------------------------------------------*/
/* --- Web: www.STCMCU.com --------------------------------------------*/
/* If you want to use this code in the program, in the program, using the information and procedures specified macro crystal technology */
/* If you want to quote this code in the article, please indicate in the article the use of information technology and procedures Wang Jing */
/*---------------------------------------------------------------------*/
@Ilgrim
Ilgrim / Blackmagicprobe_compile.md
Created January 12, 2024 00:32 — forked from micooke/Blackmagicprobe_compile.md
blackmagic probe binaries for stlink v2 baite module
## Tested the blue pill on 10/09/2018
## 1. install pre-requisites
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt update
sudo apt install gcc-arm-embedded
# If it reports error message of conflict to gcc-arm-none-eabi, which is likely if upgrading from 4.x to 5+, please uninstall it first with:
# "sudo apt-get remove gcc-arm-none-eabi"

sudo apt -y install lib32z1 lib32ncurses5 lib32bz2-1.0 

This is a collection of code snippets for various features on the STM8S family microcontrollers (specifically the STM8S003F3). These are written against the STM8S/A SPL headers and compiled using SDCC.

Some of this controller's functions aren't particularly intuitive to program, so I'm dumping samples for future reference here. These are based on the STM8S documentation:

Run at 16MHz

@Ilgrim
Ilgrim / sdl2_game_loop.c
Created September 25, 2023 21:17 — forked from velipso/sdl2_game_loop.c
SDL2 game loop forcing a certain frame rate
//////////////////////////////////////////////////
//
// EDIT: Warning, this doesn't seem to work well.
//
//////////////////////////////////////////////////
@Ilgrim
Ilgrim / rsacrypto.go
Created September 14, 2023 11:03 — forked from dadencukillia/rsacrypto.go
Golang rsa module with chunk encryption and decryption
// Adapted from: https://gist.github.com/miguelmota/3ea9286bd1d3c2a985b67cac4ba2130a
package rsacrypto
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"fmt"
@Ilgrim
Ilgrim / MoveSprite.asm
Created August 14, 2023 16:23 — forked from biomood/MoveSprite.asm
A C64 example in assembly that moves a sprite up/down/left/right
;*************************************************
;* Create and move a simple sprite x,y *
;*************************************************
processor 6502
org $1000
;helpful labels
CLEAR = $E544
GETIN = $FFE4