Skip to content

Instantly share code, notes, and snippets.

View Nicolas-93's full-sized avatar
😶
Focusing

Nicolas Nicolas-93

😶
Focusing
  • France
View GitHub Profile
@TheTechRobo
TheTechRobo / how2twitter.avi
Last active August 30, 2024 21:39
How I archive twitter accounts and hashtags and how you can too
Hello!
======
Table of Contents;
The Fast Way
The Thorough Way
Wait, how do I read this file?
Archiving Twitter accounts and hashtags is easy, even without an API key. Here's how!
@Lewiscowles1986
Lewiscowles1986 / extract_har.py
Last active May 31, 2025 07:50 — forked from kafran/extract_har.py
Python 3 script to extract images from HTTP Archive (HAR) files
import json
import base64
import os
import pathlib
from urllib.parse import urlparse
# list of supported image mime-types
# Special thanks to https://gist.github.com/FurloSK/0477e01024f701db42341fc3223a5d8c
# Special mention, and thanks to MDN
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
@szymonszl
szymonszl / patch_flash.md
Created January 12, 2021 01:31
patching out the timebomb in pepper flash

de-timebombing pepper flash

well, only a matter of time before Chrome turns off pepper plugins at all, but let's have fun while we can

flash player keeps a floating point timestamp of the time when flash should stop working, it can be patched to Infinity (thanks, floats!) and flash should keep working forever

on my version (straight from arch repos, md5sum b6da1630859c4f9c47c8ac26ec9c57a3) the timebomb timestamp is at offset 00EB7760, you need to change 00 00 40 46 3E 6F 77 42 to 00 00 00 00 00 00 F8 7F. here's a script to automate that, it also makes a backup

in case the timestamp isnt there, or you have a different md5 hash, you can just search for the timestamp with any hex editor

@meatcar
meatcar / README.md
Last active March 17, 2025 14:44
A better "Reboot to {OS}" script for rEFInd Next Boot selection for Windows
@bojanpotocnik
bojanpotocnik / enable_drag_and_drop_on_python_files.py
Created November 15, 2018 13:00
Enable drap-drop functionality on Windows for Python files
import enum
import subprocess
import sys
import winreg
from winreg import *
__author__ = "Bojan Potočnik"
# noinspection SpellCheckingInspection
@parente
parente / README.md
Last active December 26, 2023 14:31
Jupyter Tidbit: Use nbconvert to clear notebook outputs

Summary

nbconvert has a preprocessor that clears cell outputs from notebook files, leaving cell inputs intact.

Example

The following shell command reads my_input_notebook.ipynb, removes its cell outputs, prints the cleaned notebook to stdout, and redirects that output to a new notebook file named my_output_notebook.ipynb.

jupyter nbconvert my_input_notebook.ipynb --to notebook --ClearOutputPreprocessor.enabled=True --stdout > my_output_notebook.ipynb
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active March 16, 2026 17:20
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@aschmu
aschmu / pypi-mirror.md
Last active April 24, 2025 10:07
Setting up a PyPi mirror

I) Introduction

Taken from: [https://groups.google.com/forum/#!topic/devpi-dev/S-3ioWILTiY]).

We wanted to do some python developpement but we had a problem : our working network is completely isolated from any internet access, only having servers providing services like distribution packages repository mirror and web servers. The question then was how to make a full pypi mirror for usig pip install and pip search.

This is possible to be done using devpi, a web server, bandersnatch and an external hard drive. The idea is to dump all pypi packages with bandersnatch, transfer them to the server with the hard drive,

@Darkhogg
Darkhogg / !RebootToOs.md
Last active July 28, 2025 02:18
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.

@dryman
dryman / union.c
Created March 20, 2017 14:37
Polymorphism by GCC transparent union extension (works in clang as well)
typedef enum GenericType GenericType;
typedef struct A A;
typedef struct B B;
enum GenericType
{
TYPE_A = 0,
TYPE_B = 1,
};