Skip to content

Instantly share code, notes, and snippets.

View Zibri's full-sized avatar
❤️‍🔥

Zibri Zibri

❤️‍🔥
View GitHub Profile
@gquere
gquere / dump_i2c_eeprom.c
Created August 17, 2020 13:44
dump I2C EEPROM memory from Linux device ioctl
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
#define READ_SIZE (256)
#define NB_PAGES (256)
@Zibri
Zibri / crt.css
Last active April 2, 2023 13:02
CRT effect with flickering scanlines and RGB grid.
// CRT effect with flickering scanlines and RGB grid.
// By zibri@zibri.org
// <html class="crt"> </html>
@keyframes flicker {
50% {
top: -3px
}
}
// Uncompressed version of
// https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#include <stdbool.h> // 2008-2019
const int HEIGHT = 40;
const int WIDTH = 80;
@munificent
munificent / generate.c
Last active March 18, 2024 08:31
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@Zibri
Zibri / inlineworker.js
Created June 28, 2018 08:09 — forked from SunboX/inlineworker.js
Create web workers without a separate worker JS files. Source: http://jsbin.com/owogib/8/
function worker() {
setInterval(function() {
postMessage({foo: "bar"});
}, 1000);
}
var code = worker.toString();
code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}"));
var blob = new Blob([code], {type: "application/javascript"});
@kylemanna
kylemanna / gpioke.c
Created March 30, 2018 01:07
Read Intel PCH GPIOs and Display Interrupt Enable status
/*
* See:
* - http://lxr.free-electrons.com/source/drivers/mfd/lpc_ich.c
* - http://lxr.free-electrons.com/source/drivers/gpio/gpio-ich.c
* - Intel document 252516-001 (ICH5)
* - Intel document 330550-002 (9 Series PCH)
* - Intel documents 332690-004 and 332691-002EN (100 Series PCH)
* - Original source: https://lab.whitequark.org/notes/2017-11-08/accessing-intel-ich-pch-gpios/
*/
@Zibri
Zibri / WishSortPrice.js
Created January 6, 2018 12:14 — forked from LiquidSebbey/WishSortPrice.js
Sort Wish.com results by price
$("<style>.overlay { position:absolute; background-color: white; top:0; left:0; width:100%; height:100%; z-index:1000; } .loader { position: fixed; top: 1em; padding: 15px; maring: 15px; border: 1px solid #000000; border-radius: 10px; background-color: #CC0000; color: #FFFFFF; right: 1em; z-index: 999999999999; }</style>").appendTo("head");
$("body").append("<div id='overlay' class='overlay'></div><div id='loader' class='loader'><b>Bezig met inladen en sorteren ...</b></div>");
maxProducts = prompt("Hoeveel producten wil je inladen? (max. 500)");
var app = setInterval(function(){
if ($(".feed-product-item").length < maxProducts){
@evil5hadow
evil5hadow / breachcompilation.txt
Created December 19, 2017 12:33
1.4 billion password breach compilation wordlist
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
@zeph1e
zeph1e / bashrc_id.sh
Created March 8, 2017 07:18
bashrc_id.sh
#!/bin/bash
export CRED=root@id
SSH=$(whereis ssh | awk '{print $2}')
JQ=$(whereis jq | awk '{print $2}')
SCP=$(whereis scp | awk '{print $2}')
if [ -z "$SSH" ]; then
echo "Unable to find ssh" 1>&2
return 1