Skip to content

Instantly share code, notes, and snippets.

@albfan
albfan / .gitignore
Last active January 7, 2020 19:06 — forked from kontez/freeotp_backup.md
A guide to back up and recover 2FA tokens from FreeOTP (Android)
apps/
@albfan
albfan / main.py
Last active December 24, 2018 06:29
Creating an UI with GtkBuilder that includes a GtkSourceView
#!/usr/bin/env python3
import gi
gi.require_version('GtkSource', '4')
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GtkSource, GObject
from os.path import abspath, dirname, join
current_dir = abspath(dirname(__file__))

Keybase proof

I hereby claim:

  • I am albfan on github.
  • I am albfan (https://keybase.io/albfan) on keybase.
  • I have a public key whose fingerprint is CA53 4245 9EA6 68AF D59F 5533 823F 59D7 3608 8822

To claim this, I am signing this object:

#!/usr/bin/env bash
seenReplace=''
for arg in "$@"; do
if test "$arg" == '--replace'; then
seenReplace='true'
break
fi
done
@albfan
albfan / gtk3-theme-switch
Created January 12, 2018 17:07
gtk3 theme switcher
#!/bin/bash
# script to config gtk theme
GTK_VERSION=3
TWEAK_APP=lxappearance
# paths
user_home=/home/${USER}
theme_name=$@ # all arguments....

Keybase proof

I hereby claim:

  • I am albfan on github.
  • I am albfan (https://keybase.io/albfan) on keybase.
  • I have a public key whose fingerprint is E106 BDA5 525B CDDC 4ADD DA21 12AF 2D81 E821 66C6

To claim this, I am signing this object:

@albfan
albfan / VariableDepthCopier.java
Created October 14, 2016 08:47 — forked from thinkbigthings/VariableDepthCopier.java
Handy utility for copying domain objects into a response.
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import org.springframework.beans.BeanUtils;
@albfan
albfan / cpanfile
Last active March 3, 2016 09:33 — forked from mix3/cpanfile
requires "SQL::Translator::Producer::PlantUML";
requires "DBD::Pg";