Skip to content

Instantly share code, notes, and snippets.

View bewuethr's full-sized avatar

Benjamin Wuethrich bewuethr

View GitHub Profile
@mbafford
mbafford / README.md
Last active July 8, 2024 16:53
Compare two PDFs using ImageMagick - provides a visual comaprison and a perceptual hash comparison (numerical)

PDF tools for comparing PDFs visually (overlaying two PDFs to see changed areas) and using a perceptual hash (numerical value indicating visual difference between the two files).

Useful for command line review of PDFs and de-duplication. Configure git to use these tools for better PDF history / comparison in git.

These scripts require imagemagick and poppler. Both installed from homebrew.


Setup git to use a custom diff using:

fun findSubFunctions(input: List<List<String>>, maxFunctionLength: Int, maxSubFunctions: Int): List<List<String>>? {
if (input.isEmpty()) {
return emptyList()
}
if (maxSubFunctions == 0) {
return null
}
for (i in 1..input[0].size) {
val candidate = input[0].subList(0, i)
if (candidate.joinToString(",").length > maxFunctionLength) {
@kohoeric
kohoeric / GoConCanada.md
Last active June 4, 2019 13:28
Some thoughts about the talks at Go Con

WebRPC

Peter Kieltyka

This was a great opening talk. There is a lot of boiler plate involved in writing modern applications. Peter presented a tool that will write this for you.

Inspired by Rails, WebRPC will take a data type definition and generate boilerplate for Go and Typescript. With the monotonus parts of development taken care of there is more time for actually developing your application.

Effective Goroutine Cancellation

Topher Bullock

A highly practical talk for Go developers. Go routines are a light weight concurrency mechanism. Go routines are Go’s main selling point. They allow developers to use increasing core counts of CPUs in a simpler manner compared to most other languages.

@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@Wunkolo
Wunkolo / compact.cpp
Last active May 5, 2024 20:21
Ascii Raymarcher(old)
#include <math.h>
#include <algorithm>
#include <string>
#include <immintrin.h>
using namespace std;typedef float R;
#define _W 79
#define _H 39
#define EP 0.01f
#define OP operator
#define C const
@XVilka
XVilka / TrueColour.md
Last active October 29, 2024 09:43
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@MicahElliott
MicahElliott / colortrans.py
Created November 29, 2010 07:57
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code