Skip to content

Instantly share code, notes, and snippets.

Avatar

Max Horn fingolfin

  • TU Kaiserslautern
  • Germany
View GitHub Profile
View diff-highlight
#!/usr/bin/perl
package DiffHighlight;
use 5.008;
use warnings FATAL => 'all';
use strict;
# Use the correct value for both UNIX and Windows (/dev/null vs nul)
use File::Spec;
@fingolfin
fingolfin / bench.g
Created Jul 12, 2019
GAP benchmark function
View bench.g
# Benchmark( func[, optrec] )
#
# func - a function taking no arguments
# optrec - an optional record with various options
#
# Measures how long executing the given function "func" takes.
# In order to improve accuracy, it invokes the function repeatedly.
# Before each repetition, the garbage collector is run, and
# (unless turned off by an option) the random number generators
# are reset.
View gist:b641a0b305d1f4e2a6c6
### Keybase proof
I hereby claim:
* I am fingolfin on github.
* I am mhorn (https://keybase.io/mhorn) on keybase.
* I have a public key whose fingerprint is 031E 1B82 9D16 5EB8 DAD1 37F2 2292 55B2 5AE1 7B59
To claim this, I am signing this object:
@fingolfin
fingolfin / git-remote-hg
Created Apr 25, 2014
git-remote-hg with various patches added
View git-remote-hg
#!/usr/bin/env python
#
# Copyright (c) 2012 Felipe Contreras
#
# Inspired by Rocco Rutte's hg-fast-export
# Just copy to your ~/bin, or anywhere in your $PATH.
# Then you can clone with:
# git clone hg::/path/to/mercurial/repo/
View makedist.sh
#!/bin/sh -e
#
# This script generates a .tar.gz, .tar.bz2 and .zip for a GAP package.
# This requires that a tag has been set of the form "v3.1". You then
# may invoke this script like this:
# ./make_dist.sh PKGNAME 3.1
# and the rest happens automatically.
# If a checkout of the website repository is present, this script
# also copies relevant files (PackageInfo.g, documentation) there.
@fingolfin
fingolfin / makedoc.g
Created Jan 16, 2013
makedoc.g file for libsing
View makedoc.g
LoadPackage("gapdoc");;
MakeGAPDocDoc( ".", "libsing", [ "../PackageInfo.g" ], "libsing" );;
LoadPackage( "GAPDoc" );
# Determine GAPROOT
if IsRecord(GAPInfo.SystemEnvironment) and
IsBound(GAPInfo.SystemEnvironment.GAPROOT) then
@fingolfin
fingolfin / update-all.sh
Created Aug 15, 2012
Small shell script to update GAP repos as well as any package repositories
View update-all.sh
#!/bin/sh
HG_DIRS=". doc/DevManual"
GIT_DIRS=
# Find packages using Mercurial, if any
for pkg in pkg/*/.hg ; do
if [ $pkg = "pkg/*/.hg" ] ; then
break
fi
@fingolfin
fingolfin / gist:3206116
Created Jul 30, 2012
How to rebase TheSin's dpkg pull request
View gist:3206116
# Add alias for TheSin's fink tree, and fetch it
git remote add TheSin https://github.com/TheSin-/fink
git fetch TheSin
# Setup local branch 'thesin-dpkg' to track TheSin's master branch
git co -b thesin-dpkg TheSin/master
# The first commit that modified @addlist in perlmod/Fink/Bootstrap.pm
# was commit 7b3cc78525. Thus we want to insert a commit *before*
# it that changes @addlist to span multiple lines.
# Therefore, we want to rebase interactively on the *grandparent*.
@fingolfin
fingolfin / gist:3098740
Created Jul 12, 2012
Pathological speed in ConjugatorPermGroup, GAP 4.x
View gist:3098740
G:=Group( [
(26,51,76,101)(27,52,77,102)(28,53,78,103)(29,54,79,104)(30,55,80,105)
(31,56,81,106)(32,57,82,107)(33,58,83,108)(34,59,84,109)(35,60,85,110)
(36,61,86,111)(37,62,87,112)(38,63,88,113)(39,64,89,114)(40,65,90,115)
(41,66,91,116)(42,67,92,117)(43,68,93,118)(44,69,94,119)(45,70,95,120)
(46,71,96,121)(47,72,97,122)(48,73,98,123)(49,74,99,124)(50,75,100,125),
(2,16,26,77,44,7,91,54,108,50,37,67,93,74,8,96,104,60,63,48,47,42,17,41)
(3,21,51,103,75,13,121,80,39,57,68,98,124,85,14,106,30,87,94,59,58,73,23,71)
(4,6,76,29,82,19,31,102,70,88,99,109,35,112,20,36,52,118,125,90,89,84,9,81)
(5,11,101,55,113,25,61,28,97,119,110,40,62,43,22,66,78,49,32,117,120,115,15,111)
@fingolfin
fingolfin / readline6.info
Created Jun 14, 2012
Fink readline6 package
View readline6.info
Info4: <<
Package: readline6%type_pkg[-64bit]
Version: 6.2
Revision: 1
Maintainer: Fink Core Group <fink-core@lists.sourceforge.net>
Type: -64bit (boolean)
Architecture: ( %type_raw[-64bit] = -64bit ) powerpc, ( %type_raw[-64bit] = -64bit ) i386
#
Depends: %n-shlibs (= %v-%r), ( %type_raw[-64bit] = -64bit ) 64bit-cpu
BuildDepends: <<