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 / 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 / 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 / libbson.uncrustify.cfg
Last active December 26, 2015 20:19
WIP on uncrustify config for libbson.
align_struct_init_span = 1
align_var_def_colon = true
align_var_def_span = 0
indent_align_string = true
indent_brace = 0
mod_paren_on_return = remove
nl_after_return = true
nl_func_var_def_blk = 1
align_enum_equ_span = 1
align_func_params = true
@chergert
chergert / md.py
Created October 9, 2013 06:05
a little helper program for working with markdown.
#!/usr/bin/env python
from markdown2 import markdown
import sys
if sys.argv[1:]:
for f in sys.argv[1:]:
print markdown(file(f).read())
else:
print markdown(sys.stdin.read())
@chergert
chergert / snippet.txt
Created September 21, 2013 22:08
embedded js example
snippet blah
```js
const GLib = imports.gi.GLib;
function getYear() {
let now = GLib.DateTime.new_now_utc();
return now.format('%Y');
}
```
${1:`getYear()`}
@chergert
chergert / fuzzy.txt
Created September 13, 2013 10:15
fuzzy matching output
Searching for "gwdtshw"
000008 : gtk_widget_show
000008 : gtk_widget_show_all
000008 : gtk_widget_show_now
000013 : gtk_widget_set_has_window
000015 : gtk_widget_get_no_show_all
000015 : gtk_widget_set_no_show_all
000020 : gtk_widget_device_is_shadowed
000023 : gtk_scrolled_window_get_shadow_type
000023 : gtk_scrolled_window_set_shadow_type
@chergert
chergert / 0001-completion-use-override-font-instead-of-cellrenderer.patch
Created September 12, 2013 09:56
override font instead of setting font on cell renderer
From 3ec34c456884b18ad5c70b57d5d9be285a246649 Mon Sep 17 00:00:00 2001
From: Christian Hergert <[email protected]>
Date: Thu, 12 Sep 2013 02:55:00 -0700
Subject: [PATCH] completion: use override font instead of cellrenderer font.
When setting the font on a cellrenderer, you cannot change important
markup such as <b>. However, simply overriding the widgets font does
in fact allow this.
---
gtksourceview/gtksourcecompletion.c | 5 ++---
@chergert
chergert / c.snippets
Created September 9, 2013 20:39
Snippets example for C in Builder.
snippet for
for (${1}; ${2}; ${3}) {
$0
}
snippet while
while (${1}) {
$0
}
snippet if
if (${1:condition}) {
From d48632fcd7b541c181d6c9104b623d15cb021e53 Mon Sep 17 00:00:00 2001
From: Christian Hergert <[email protected]>
Date: Mon, 19 Aug 2013 21:47:23 -0700
Subject: [PATCH] searchcontext: add GtkSourceSearchContext:found-tag
property.
Includes a getter to fetch the read-only property.
This is useful for consumers that want to access the text-tag.
---
@chergert
chergert / gtktextview+gtkpixecache.patch
Created August 15, 2013 08:02
Use GtkPixelCache inside of GtkTextView. This still doesn't feel interactive enough for me. There needs to be some tweaks on the size of the area to pre-render. Likely in the half-page or so on each boundary.
testdiff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 3aa1047..1dff1e2 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -53,6 +53,7 @@
#include "gtkcssstylepropertyprivate.h"
#include "gtkbubblewindowprivate.h"
#include "gtktoolbar.h"
+#include "gtkpixelcacheprivate.h"