Skip to content

Instantly share code, notes, and snippets.

View alexyorke's full-sized avatar

Alex Yorke alexyorke

View GitHub Profile
@aelij
aelij / RoslynDeterministic.md
Last active March 7, 2024 16:09
Deterministic Builds in C#

Deterministic Builds in C#

Status

The C# compiler (Roslyn) supports deterministic builds since Visual Studio 2015. This means that compiling assemblies under the same conditions (permalink) would produce byte-for-byte equivalent binaries.

If you also intend on shipping non-portable (permalink) PDBs, you must also make sure that paths in the PDBs are absolute using path mapping. The recommended way would be to map the enlistment (repo) root to a fixed path, such as C:\.

For more information, see this blog post

@DavidYKay
DavidYKay / simple_cb.py
Last active June 26, 2023 00:52
Simple color balance algorithm using Python 2.7.8 and OpenCV 2.4.10. Ported from: http://www.morethantechnical.com/2015/01/14/simplest-color-balance-with-opencv-wcode/
import cv2
import math
import numpy as np
import sys
def apply_mask(matrix, mask, fill_value):
masked = np.ma.array(matrix, mask=mask, fill_value=fill_value)
return masked.filled()
def apply_threshold(matrix, low_value, high_value):
@mpasternacki
mpasternacki / freebsd_on_mbp.md
Created January 23, 2015 17:12
FreeBSD on a MacBook Pro

FreeBSD on a MacBook Pro

Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki

@niksumeiko
niksumeiko / git.migrate
Last active April 30, 2024 12:54
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
gnome-cups-manager
------------------
Once upon a time there was a printer who lived in the woods. He was a
lonely printer, because nobody knew how to configure him. He hoped
and hoped for someone to play with.
One day, the wind passed by the printer's cottage. "Whoosh," said the
wind. The printer became excited. Maybe the wind would be his
friend!