Skip to content

Instantly share code, notes, and snippets.

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct cleanup_array
{
void (*routine)(void*);
void *arg;
// just throwing shit at the wall
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <libgen.h>
#include <sys/inotify.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#ifndef _AUTORELOAD_H
#define _AUTORELOAD_H
#include <pthread.h>
#include <sys/inotify.h>
#include <unistd.h>
#include <limits.h>
#include <fcntl.h>
#include <libgen.h>
#include <string.h>
@Jan200101
Jan200101 / json-to-cstruct.py
Created January 13, 2022 08:20
little srip
import json
import os
from typing import Union
INDENTION_SIZE = 4
INDENTION_CHAR = " "
TYPE_TO_STR = {
int: "int",
str: "char*",
@Jan200101
Jan200101 / github-red-issues.user.css
Last active November 9, 2022 07:42
Revert Red Closes back to using a red color instead of purple
/* ==UserStyle==
@name GitHub Red Closed Issues
@namespace GithubRed
@version 1.1.0
@description Change the GitHub closed Issue color back to red
@license CC-0
==/UserStyle== */
.octicon-issue-closed {
color: var(--color-fg-default) !important;
}
@Jan200101
Jan200101 / extract-images-out-of-pdf.php
Created September 7, 2021 13:49
This little script extracts all images of a certain type out of a PDF using just regex. I hope this is worth more to you than me
<?php
$re = '/\<\<.*\/Subtype.*\/Image.*\>\>.*stream\n+(.*)\n+endstream/JxisU';
$arquivo = 'file.pdf';
$path_parts = pathinfo($arquivo);
$str = file_get_contents($arquivo);
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
pub const c = @cImport({
@cInclude("gtk/gtk.h");
});
pub extern "c" fn gtk_init(*c_int, *[*][*]u8) void;
pub fn gtk_window_new(kind: c_int) [*c]c.GtkWidget {
return c.gtk_window_new(@intToEnum(c.GtkWindowType, kind));
}
// ==UserScript==
// @name twitter unhide
// @version 1.2
// @match https://twitter.com/*
// @run-at document-end
// @grant none
// ==/UserScript==
(function () {
'use strict';
profileName:
mods:
- name: AceOfShades-QuickRestart
version:
major: 1
minor: 3
patch: 1
enabled: true
- name: BasilPanda-RemoveAllyCap
version:
@Jan200101
Jan200101 / thing.c
Last active December 3, 2020 19:57
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define VARIABLESIGN '$'
struct var_t {
char* key;
char* value;