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 / gist:7db3cafc4bbc909d52ce773686bc456e
Last active January 10, 2024 21:26
install gtk4 macOS
## NOTE ##
If you just need to build, and you don't need to hack on GTK 4 itself, you can
probably just use brew. That is the simplest and fastest way to get started.
```
brew install gtk4
```
At that point, /usr/local/bin/gtk4-demo is there, and all the others.
@chergert
chergert / foo-widget.c
Last active May 2, 2023 17:25
simple widget example
#include "foo-widget.h"
struct _FooWidget
{
GtkBin parent_instance;
GtkLabel *label;
};
G_DEFINE_TYPE (FooWidget, foo_widget, GTK_TYPE_BIN)
@chergert
chergert / queue.h
Last active July 20, 2022 14:43
A thread-safe blocking LIFO or FIFO queue with maximum backlog.
#include <limits.h>
#include <pthread.h>
#include <stdlib.h>
typedef struct _queue_t queue_t;
typedef struct _queue_node_t queue_node_t;
struct _queue_node_t
@chergert
chergert / vdso-getcpu.c
Created September 17, 2015 08:48
example of fetching getcpu from the vsdo
#include <dlfcn.h>
#include <stdio.h>
#include <asm/vsyscall.h>
#include <sys/auxv.h>
int (*test_getcpu) (unsigned *cpu,
unsigned *node,
void *cache);
void *
using Gtk;
namespace Chimera
{
public class ChimeraTab : Gtk.Bin
{
ScrolledWindow scroller;
TextView text_view;
construct {
@chergert
chergert / TUTORIAL.md
Last active April 10, 2020 14:27
Getting Started with the MongoDB C Driver

Getting started with C Driver

Introduction

This page provides you with a little help getting started with the new MongoDB C driver.

For more information on the C API, please refer to the online API Documentation for the C driver.

@chergert
chergert / dropline-status-icon.c
Created October 24, 2012 00:41
example for status icon
#include "dropline-status-icon.h"
G_DEFINE_TYPE(DroplineStatusIcon, dropline_status_icon, GTK_TYPE_STATUS_ICON)
struct _DroplineStatusIconPrivate
{
/*
* XXX: Put stuff you need during runtime here.
*/
gpointer dummy;
@chergert
chergert / .buildconfig
Created December 10, 2018 23:38
example buildconfig
[default]
name=Default
config-opts=
run-opts=
prefix=/opt/gnome
app-id=
postbuild=
prebuild=scons
default=true
#include <stdio.h>
#include <assert.h>
typedef struct
{
double r;
double g;
double b;
double a;
} GdkRGBA;
@chergert
chergert / uber-build.sh
Created June 13, 2014 02:20
install mongo-c-driver on Ubuntu 14.04 with packages from git.
#!/usr/bin/env bash
sudo apt-get install gcc dpkg-dev cdbs automake autoconf libtool make libssl-dev libsasl2-dev git python-lxml pkg-config
git clone git://github.com/mongodb/mongo-c-driver.git
cd mongo-c-driver
./build/mci.sh --notest
cd ..
sudo dpkg --install libmongoc-*.deb libbson-*.deb