Skip to content

Instantly share code, notes, and snippets.

View cschramm's full-sized avatar

Christopher Schramm cschramm

  • Munich, Germany
View GitHub Profile
from gi.repository import Gio, GLib
bus = Gio.bus_get_sync(Gio.BusType.SESSION)
info = Gio.DBusNodeInfo.new_for_xml("""
<node name='/'>
<interface name='org.kde.StatusNotifierItem'>
<property name="Category" type="s" access="read"/>
<property name="Id" type="s" access="read"/>
<property name="Title" type="s" access="read"/>
@cschramm
cschramm / _usr_bin_blueman-assistant.1000.crash
Created August 22, 2020 15:13
Apport being a pain in the neck
ProblemType: Crash
CurrentDesktop: MATE
Date: Sat Aug 22 17:08:25 2020
ExecutablePath: /usr/bin/blueman-assistant
ExecutableTimestamp: 1597770305
InterpreterPath: /usr/bin/python3.8
ProcCmdline: /usr/bin/python3 /usr/bin/blueman-assistant
ProcCwd: /home/cschramm
ProcEnviron:
LANG=de_DE.utf8

Keybase proof

I hereby claim:

  • I am cschramm on github.
  • I am cschramm (https://keybase.io/cschramm) on keybase.
  • I have a public key whose fingerprint is 93C2 2423 2563 43DB 136F 0B20 9769 BD93 04CD C499

To claim this, I am signing this object:

@cschramm
cschramm / deliver_later_i18n.rb
Created February 20, 2015 11:54
Pass current locale to rails delivery jobs and use them in when performing
module ActionMailer
class DeliveryJob < ActiveJob::Base
def initialize(*args)
super(*args << I18n.locale.to_s)
end
alias_method :orig_perform, :perform
define_method :perform do |*args|
I18n.with_locale(args.pop) { orig_perform *args }
end
@cschramm
cschramm / gist:5395729
Last active December 16, 2015 06:59
Make devise 3 on Rails 4 work with signed_form.
class ParameterSanitizer < Devise::ParameterSanitizer
def for(kind)
@params.fetch @resource_name, {}
end
end
class ApplicationController < ActionController::Base
include SignedForm::ActionController::PermitSignedParams
protected