Skip to content

Instantly share code, notes, and snippets.

View yvesf's full-sized avatar
🚒

Yves Fischer yvesf

🚒
  • Switzerland
View GitHub Profile
@yvesf
yvesf / gist:869381
Created March 14, 2011 16:09
hugh-kram
#coding: utf8
import image
import numpy as np
def hough(img,activation=None,edges=8,debug=None):
"""
Berechnet die Hough-Transformation für ein Bild.
Es wird parallel zum Bildraum ein 2-dimensionaler
Parameterraum angelegt ("hough_raum") mithilfe dessen
@yvesf
yvesf / kerberos.py
Created February 25, 2015 19:56
Python imaplib kerberos mixin
import base64
import kerberos
import imaplib
class IMAPGSSMixin(object):
def gss_cb(self,challenge):
input_token = base64.b64encode(challenge).decode('utf-8')
if self.step == 0:
@yvesf
yvesf / parse-chrome-pak.sh
Created May 2, 2015 20:35
Parse google-chrome .pak files in shell
#!/bin/bash
# Parse google-chrome .pak resourcefiles
parse_int() {
( echo "ibase=16; "; cat; echo -e "\n") | bc
}
endian_conversion() {
if [[ "$1" == "little" ]]; then
tac
#!/usr/bin/env python3
import json
import time
import netrc
import base64
import codecs
import urllib.request
import urllib.parse
from funcparserlib.lexer import make_tokenizer, Token, LexerError
@yvesf
yvesf / README.md
Created January 13, 2016 16:56
Grails 3 Run-Command

Grails 3 no longer contains the functionality to execute Scripts within an running application context. Grails 2.x contained the 'run-script' command and also allowed to run arbitrary scripts implemented as Gant tasks under $dir/scripts directory of any project.

As a substitute grails 3 offers ApplicationContext Commands. The downside is that they cannot be implemented in the actual project because they have to be in the gradle buildscript classpath as well. This is also not desirable because one don't want to pollute this classpath with application dependencies.

This project provides a workaround for that. It is on one side a grails project and registers exactly one command that

Keybase proof

I hereby claim:

  • I am yvesf on github.
  • I am yvesf (https://keybase.io/yvesf) on keybase.
  • I have a public key whose fingerprint is 1216 25F9 DA5C 7241 DAF7 E874 DD79 51D8 867D EED0

To claim this, I am signing this object:

@yvesf
yvesf / SaveCascadeSpec.groovy
Created February 17, 2017 12:53
Grails/GORM cascade on save with SimpleMapSession
package org.grails.datastore.gorm
import grails.gorm.tests.GormDatastoreSpec
import grails.persistence.Entity
import org.grails.datastore.mapping.dirty.checking.DirtyCheckable
class SaveCascadeSpec extends GormDatastoreSpec {
def "Test save() cascades on one-to-one"() {
given: "A domain model with a one-to-one"
@yvesf
yvesf / scrolling-x1-touchpad.sh
Last active April 11, 2017 21:53
Using touchpad as single scrolling area on Thinkpad X1 Carbon 5thgen/2017
#
# Completely disable the touchpad functionality but enable the whole touchpad for single-finger scrolling
#
# Disable touchpad mouse movements
xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 100000
# Disable touchpad mouse button events
xinput set-button-map 'SynPS/2 Synaptics TouchPad' map button 0
# Disable two finger scroll
package main
/*
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
void (*go_handler)(int, siginfo_t *, void *);
@yvesf
yvesf / fhsenv.nix
Created September 4, 2020 21:31
Running mediatek SP Flash Tool in nixos
let
pkgs = import <nixpkgs> {};
in pkgs.buildFHSUserEnv {
name = "fhs";
targetPkgs = pkgs: [
pkgs.nextcloud-client
pkgs.fontconfig
pkgs.freetype
pkgs.zlib
pkgs.wine