Skip to content

Instantly share code, notes, and snippets.

View Trolobezka's full-sized avatar

Richard Kokstein Trolobezka

View GitHub Profile
@takekazuomi
takekazuomi / csharp.gitignore
Created April 17, 2014 05:47
.gitignore for C#
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
@DGriffin91
DGriffin91 / simple_imgui_example.py
Last active April 4, 2024 06:39
A simple pyimgui example using the GLFW backend
#pip install imgui[glfw]
import imgui
import glfw
import OpenGL.GL as gl
from imgui.integrations.glfw import GlfwRenderer
def impl_glfw_init(window_name="minimal ImGui/GLFW3 example", width=1280, height=720):
if not glfw.init():
print("Could not initialize OpenGL context")
@valerionew
valerionew / README.md
Last active January 18, 2024 14:40
Batch compress onenote handwritten PDF into raster PDF

So here's the story: a friend of mine wanted to share on the web some notes he wrote in OneNote. The PDF was 155 pages and weighted 270MB. This was exceeding the 100MB max file size limit of the service we were using.

After doing some research on the internet, i discovered this was pretty common for OneNote files, in particular if you have active the pressure sensitivity. Searching the internet did not produce any result, so after a day of research i finally got a method working that reduce the 278MB file into a 24MB file, with no significant loss.

The key to this process is the rasterization, where we transform the nicely-indefinitely-zoomable vector traces into a picture of the page, and put the picture in the PDF page instead of the vector notes. You loose the flexibility of having a vector based PDF, but you can compress a PDF much more.