Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Beyer matthiasbeyer

View GitHub Profile
View gist:08d8ea7ee810cb3a371e
1. function pointer:
type (*ptr)(args)
which would be our style, will result in
type (* ptr)(args)
@matthiasbeyer
matthiasbeyer / uncrustify.cfg
Created Sep 30, 2014
Uncrustify configuration
View uncrustify.cfg
# Uncrustify 0.60
#
# General options
#
# The type of line endings
newlines = lf # auto/lf/crlf/cr
# The original size of tabs in the input
@matthiasbeyer
matthiasbeyer / brachetmatcher.hs
Created Nov 19, 2014
Stack-based bracket matcher in Haskell
View brachetmatcher.hs
module Main
where
data Node = Node { chr :: Char
, next :: Maybe Node }
deriving (Show)
prepareInput :: String -> String
prepareInput str = filter (\c -> c `elem` ['(', ')']) str
View base-configuration.nix
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
@matthiasbeyer
matthiasbeyer / dmenu.bash
Created Feb 8, 2015
dmenu-like bash script
View dmenu.bash
list=""
for p in $(echo $PATH | sed 's,:, ,g')
do
list="$list $(find $p -type f -o -type l -executable 2>/dev/null)"
done
currlist=$list
x=".*"
while read -n 1 y;
View modulemod-1.rs
use runtime::Runtime;
use std::error::Error;
use std::fmt::Formatter;
use std::fmt::Result as FMTResult;
use std::fmt::Display;
use std::path::Path;
use std::result::Result;
use module::todo::TodoModule;
@matthiasbeyer
matthiasbeyer / razorlight.vim
Last active Nov 3, 2015
razorlight vim colorscheme
View razorlight.vim
"
" Version 1.0
" Author: Matthias Beyer <mail@beyermatthias.de>
" Date: 03-11-2015
" License: Public Domain
"
" ---
"
" Colorscheme for vim and neovim. Created mainly with vim.ink
"
@matthiasbeyer
matthiasbeyer / straceout
Created Jan 4, 2016
strace output of musescore on segfault
View straceout
read(10, "712//\t\tINTERNAL\t\tIBM12712\t\t1\nmod"..., 4096) = 2847
read(10, "", 4096) = 0
close(10) = 0
munmap(0x7feaad925000, 4096) = 0
futex(0x7feaa6c688d0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
open("/etc/X11/egl/atiapfxxES.blb", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/X11/atiogl_perfcount.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
gettid() = 17783
gettid() = 17783
open("/etc/X11/atiogl.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
@matthiasbeyer
matthiasbeyer / Makefile
Created Jan 8, 2016
codelistings error with pandoc-crossref
View Makefile
#
#
#
# Variables
#
#
#
DOCUMENT_CLASS=article
SETTING_FONTSIZE=11pt
@matthiasbeyer
matthiasbeyer / mass-update.sh
Created Apr 12, 2016
nix package update apply helper
View mass-update.sh
#!/usr/bin/env bash
EXEC=$(dirname ${BASH_SOURCE[0]})/nixpkgs-update-pkg.sh
if [[ ! -e $1 ]]; then
echo "Does not exist: $1"
echo "Exit."
exit 1
fi
You can’t perform that action at this time.