Skip to content

Instantly share code, notes, and snippets.

View gabyx's full-sized avatar
👌
More Single Layer of Abstraction please ...

Gabriel Nützi gabyx

👌
More Single Layer of Abstraction please ...
View GitHub Profile
@gabyx
gabyx / Points class
Created August 19, 2017 19:18
Points class with names to access columns
class Points(np.matrixlib.defmatrix.matrix):
def __new__(cls, *args, names=[], **kwargs):
o = np.matrixlib.defmatrix.matrix.__new__(cls, *args, **kwargs)
# We need to adjust here __class__
# such that o is of type Points and the __init__ get
# automatically called
o.__class__ = Points
return o
@gabyx
gabyx / # llvm - 2018-01-11_22-51-52.txt
Created January 11, 2018 22:16
llvm on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for llvm on macOS 10.11.6
Build date: 2018-01-11 22:51:52
@gabyx
gabyx / fileRegexReplace.sh
Last active June 13, 2018 14:51
Powerfull and Safe Find/Replace Bashscript (using perl)
#!/bin/bash
# =============================================================================
#
# Find and Replace Files inplace.
#
# @author Gabriel Nützi
# @date 02.05.2018
#
# fileRegexReplace -h for Help!
# =============================================================================
From b3191a0b675823edc8ea6eef29b7e36dba1f646f Mon Sep 17 00:00:00 2001
From: Gabriel Nuetzi <gnuetzi@gmail.com>
Date: Thu, 11 Jan 2018 23:51:47 +0100
Subject: [PATCH 1/2] Revert "llvm: remove lldb patch"
This reverts commit 8f84c9238a9a5f8d85a08755c20eff9c8040a6b1.
---
Formula/llvm.rb | 6 ++++++
1 file changed, 6 insertions(+)
@gabyx
gabyx / StringConversion.cpp
Created February 8, 2018 22:19
Fast String Conversion
#include <iostream>
#include <type_traits>
#include <iomanip>
#define white_space(c) ((c) == ' ' || (c) == '\t')
#define valid_digit(c) ((c) >= '0' && (c) <= '9')
namespace StringConversion
{
namespace detail
@gabyx
gabyx / installVirtualMachine.sh
Last active July 13, 2023 00:58
Unattended installation of any virtual machine with Virtual Box 6
#!/bin/bash
#
# Unattendet installation of any virtual machine with
# Virtual Box 6.
# The script walks you through the needed options with
# default values.
#
# Usage:
# `installVirtualMachine.sh --force-delete \
# --post-script-url "https://server.com/script.sh"`
@gabyx
gabyx / testGitExamples.sh
Last active June 4, 2020 13:55
testGitExamples.sh
#!/bin/bash
# shellcheck disable=SC2015
repoDir="$1"
example="$2"
function die() {
echo -e "$@" >&2
exit 1
}
#!/bin/bash
# shellcheck disable=SC2015
repoDir="$1"
example="$2"
function die() {
echo -e "$@" >&2
exit 1
}
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import tempfile
import operator
from functools import partial, reduce
import subprocess
from tqdm import tqdm
#!/usr/bin/env python3
# based on https://github.com/newren/git-filter-repo/blob/main/contrib/filter-repo-demos/insert-beginning
"""
This is a simple program that will insert some regular file into the root
commit(s) of history, e.g. adding a file named LICENSE or COPYING to the
first commit. It also rewrites commit hashes in commit messages to update
them based on these changes.
"""
import argparse