Skip to content

Instantly share code, notes, and snippets.

View chergert's full-sized avatar
💭
I'm on GitLab https://gitlab.gnome.org/chergert

Christian Hergert chergert

💭
I'm on GitLab https://gitlab.gnome.org/chergert
View GitHub Profile
@chergert
chergert / bluez.xml
Created August 28, 2015 22:23
for the root object manager
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node><interface name="org.freedesktop.DBus.Introspectable"><method name="Introspect"><arg name="xml" type="s" direction="out"/>
</method></interface><interface name="org.freedesktop.DBus.ObjectManager"><method name="GetManagedObjects"><arg name="objects" type="a{oa{sa{sv}}}" direction="out"/>
</method><signal name="InterfacesAdded"><arg name="object" type="o"/>
<arg name="interfaces" type="a{sa{sv}}"/>
</signal>
<signal name="InterfacesRemoved"><arg name="object" type="o"/>
<arg name="interfaces" type="as"/>
</signal>
@chergert
chergert / glib-gripes.md
Created February 24, 2014 07:25
GLib Gripes

GLib Gripes

This is a list of things I wish were different in a future version of GLib. Most likely with an ABI and API break.

Primative Types

Landscape

GLib currently uses wrapper types such as gint, glong, guint32, etc. The are

@chergert
chergert / fig-idea.sh
Last active August 29, 2015 13:57
some ideas for fig
# initialize a new automake project in current dir
fig init
# Explicitely set the version ...
fig version 0.1.0
# add a new library to the project with a gobject
fig add-target --library --shared foobar-1.0
fig add-gobject foobar-1.0 FooBar
@chergert
chergert / gist:9659010
Created March 20, 2014 07:39
fig is a tool to manage automake projects. its a work in progress and barely does anything yet but boostrap.
[christian@stardust ~]$ mkdir foobar
[christian@stardust ~]$ cd foobar/
[christian@stardust foobar]$ fig init --help
Usage:
fig init [OPTION...]
Initialize a new autotools project.
Help Options:
-h, --help Show help options
@chergert
chergert / signames.c
Created April 1, 2014 16:31
print names of signal numbers.
#include <signal.h>
#include <stdio.h>
#include <string.h>
int
main (int argc,
char *argv[])
{
const char *str;
int i;

Keybase proof

I hereby claim:

  • I am chergert on github.
  • I am hergertme (https://keybase.io/hergertme) on keybase.
  • I have a public key whose fingerprint is 9018 D71E E3E7 F68A 8613 A713 34D1 9DFA F522 9486

To claim this, I am signing this object:

@chergert
chergert / yak.h
Created January 27, 2015 20:16
clear/set weak pointer helpers
#define ide_clear_weak_pointer(ptr) \
(*(ptr) ? (g_object_remove_weak_pointer((GObject*)*(ptr), (gpointer*)ptr),1) : 0)
#define ide_set_weak_pointer(ptr,obj) \
((obj!=*(ptr)) ? (ide_clear_weak_pointer(ptr),*(ptr)=obj,g_object_add_weak_pointer((GObject*)obj, (gpointer*)ptr),1) : 0)
@chergert
chergert / builder.stacktrace
Created February 4, 2015 00:38
why thank you libgit2.
#0 0x00007ffff185c830 in pthread_mutex_lock () from /lib64/libpthread.so.0
#1 0x00007ffff2933d8c in attr_cache_lock (cache=0x0) at /home/christian/Projects/libgit2-0.21.2/src/attrcache.c:14
#2 0x00007ffff2934307 in attr_cache_lookup (out_file=0x7fffd2ffc390, out_entry=0x7fffd2ffc398, repo=0x7fffc8006090, source=GIT_ATTR_FILE__FROM_FILE, base=0x7fffc8008ba0 "/home/christian/Projects/libide/", filename=0x7fffc8008d00 "/home/christian/Projects/libide/.gitattributes")
at /home/christian/Projects/libgit2-0.21.2/src/attrcache.c:175
#3 0x00007ffff293441f in git_attr_cache__get (out=0x7fffd2ffc3f0, repo=0x7fffc8006090, source=GIT_ATTR_FILE__FROM_FILE, base=0x7fffc8008ba0 "/home/christian/Projects/libide/", filename=0x7ffff2973180 ".gitattributes", parser=0x7ffff290fcec <git_attr_file__parse_buffer>)
at /home/christian/Projects/libgit2-0.21.2/src/attrcache.c:209
#4 0x00007ffff28d3682 in push_attr_file (repo=0x7fffc8006090, list=0x7fffd2ffc5b0, source=GIT_ATTR_FILE__FROM_FILE, base=0x7fffc8008ba0 "/home/ch
@chergert
chergert / build.log
Created February 5, 2015 21:23
libide managed to build something
[christian@starfield gnome-builder]$ ../libide/ide-build configure.ac
Build System: IdeAutotoolsBuildSystem
VCS: IdeGitVcs
Using device: IdeLocalDevice (x86_64-linux-gnu)
Build started.
Building into: /home/christian/.cache/libide/builds/gnome-builder/local/x86_64-linux-gnu
== Ensuring build directories are created.
== Checking if autogen.sh needs to be run.
== Checking if configure needs to be run.
checking whether NLS is requested... yes
@chergert
chergert / script1.js
Last active August 29, 2015 14:15
Quick example of custom search provider in LibIDE (GNOME Builder)
/* ~/.config/gnome-builder/scripts/script1.js */
const Ide = imports.gi.Ide;
const GObject = imports.gi.GObject;
/* just some examples of things you can access */
let Project = Context.get_project();
let BuildSystem = Context.get_build_system();
let Vcs = Context.get_vcs();