Skip to content

Instantly share code, notes, and snippets.

@bgotink
bgotink / ._what.md
Last active Jan 25, 2021
A small C++ program that converts grayscale EXR to transparent EXR
View ._what.md

gray2transparent

This small C++ program converts a grayscale OpenEXR image to an image with transparancy.

behaviour

  • takes only red channel of RGBA into account, prints message if color isn't gray
  • ignores pixels with transparancy already set tot a non-opaque value
  • makes lighter colors more transparant: alpha = 1 - red
@bgotink
bgotink / angstrom.md
Last active Aug 29, 2015
Angstrom compilation for beaglebone
View angstrom.md

Install dependencies

sudo <aptitute|apt-get> install git-core texinfo chrpath gawk

Install other dependencies when asked

Setup and compile

setup

View ._what.md

Badass git pull alternative

Add this in your path as git-up and git-reup (symbolic link) and it amps up your git pull by means of git up

  1. Adds in a list of the commits you're pulling down
  2. Auto-prunes remote branches
  3. Defaults to pull --rebase - gets rid of unnecessary merge commits. If you don't know what rebase does, this is probably safe for you. If you know what rebase does, you should know where this will not be safe for you.

Kyle Neath, Ryan Tomayko and then Zach Holman basically figured out how to do this. TheSpyder found a small error on case sensitive file systems.

@bgotink
bgotink / collatz.c
Created Sep 7, 2012
Collatz conjecture program in C, depends on libgmp
View collatz.c
#include <stdio.h>
#include <string.h>
#include <gmp.h>
/*
* Dependency: libgmp
* Compile using:
* gcc -o collatz -l gmp collatz.c
*/
@bgotink
bgotink / brew.log
Created Aug 16, 2012
"brew install --HEAD e2fsprogs" log
View brew.log
bram:~/Downloads/backup$ brew install --HEAD e2fsprogs
==> Cloning https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
Cloning into '/Library/Caches/Homebrew/e2fsprogs--git'...
remote: Counting objects: 33824, done.
remote: Compressing objects: 100% (7500/7500), done.
remote: Total 33824 (delta 27272), reused 32257 (delta 26058)
Receiving objects: 100% (33824/33824), 16.32 MiB | 139 KiB/s, done.
Resolving deltas: 100% (27272/27272), done.
==> Downloading patches
######################################################################## 100.0%
@bgotink
bgotink / mount_tmpfs.sh
Created Aug 6, 2012 — forked from koshigoe/mount-ram.sh
Like tmpfs in Mac OS X. This code is public domain.
View mount_tmpfs.sh
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#