Skip to content

Instantly share code, notes, and snippets.

View tschoonj's full-sized avatar

Tom Schoonjans tschoonj

View GitHub Profile
@tschoonj
tschoonj / github-updater.c
Created July 8, 2013 18:34
Some code I wrote to have my software package XMI-MSIM check on github for available updates, by looking if git tags were pushed to the repository and comparing the version numbers
#include <curl/curl.h>
#include <json-glib/json-glib.h>
#include <string.h>
#include <stdlib.h>
/*
*
* This code allows for the checking of available updates by parsing the JSON output obtained
* through requesting the tags from the GitHub repo of XMI-MSIM
@tschoonj
tschoonj / gtkextra-print-export.c
Last active December 20, 2015 00:19
gtkextra3 example that demonstrates how the plot canvas can be exported or printed
/*
* compile with gcc -o gtkextra-print-export `pkg-config --cflags gtkextra-3.0` gtkextra-print-export.c `pkg-config --libs gtkextra-3.0`
*/
#include <gtkextra/gtkextra.h>
#include <cairo-ps.h>
#include <cairo-pdf.h>
#include <math.h>
#include <string.h>
#python bindings will only be built if all buildtools are available, hence the following automake conditional
if ENABLE_PYTHON
#our python extension module
pyexec_LTLIBRARIES = _mytest.la
_mytest_la_CFLAGS = $(PYTHON_CFLAGS) -I$(top_srcdir)/include $(PYTHON_CPPFLAGS)
#link to the C-library
#probably on Windows one will need to link against the python dll as well
_mytest_la_LIBADD = ../src/mytest.la
#the source code for our extensions module
#nodist because this file will be generated by swig
@tschoonj
tschoonj / gtk-runtime-win64.ts.nsi
Last active August 29, 2015 13:56
NSIS code for a Gtk 2 Runtime Environment Installer for Windows 64-bit
; NSIS2 Script for GTK2-Runtime
; by Alexander Shaduri <ashaduri 'at' gmail.com>.
; Compatible with NSIS Unicode 2.45.
; Public Domain
; The naming convention is:
; Product: GTK2-Runtime;
; Directory and package names: gtk2-runtime.
; The reason for this is that when gtk3 comes out, it
@tschoonj
tschoonj / ax_check_cuda.m4
Created May 10, 2014 14:56
gists for blogpost on cuda device library
#####
#
# SYNOPSIS
#
# AX_CHECK_CUDA
#
# DESCRIPTION
#
# Figures out if CUDA Driver API/nvcc is available, i.e. existence of:
# cuda.h
2015-05-25 14:55:34 +0100
./configure
--prefix=/usr/local/Cellar/gdal/1.11.2_1
--mandir=/usr/local/Cellar/gdal/1.11.2_1/share/man
--disable-debug
--with-local=/usr/local/Cellar/gdal/1.11.2_1
--with-threads
--with-libtool
--with-pcraster=internal
@tschoonj
tschoonj / Makefile.am
Last active August 29, 2015 14:24
plplot extcairo gtkmm drawingarea
bin_PROGRAMS = plplot-test
plplot_test_SOURCES = main.cpp \
PLplotWindow.h \
PLplotWindow.cpp \
PLplotDrawingArea.h \
PLplotDrawingArea.cpp
plplot_test_CPPFLAGS= $(plplotcxx_CFLAGS) $(gtkmm_CFLAGS)
plplot_test_LDADD = $(plplotcxx_LIBS) $(gtkmm_LIBS)
@tschoonj
tschoonj / gdl-plplot.patch
Created July 9, 2015 17:17
gdl patch to make it compatible with plplot 5.11.0
diff --git a/CMakeModules/FindPlplot.cmake b/CMakeModules/FindPlplot.cmake
index a503f8c..ad13e7a 100644
--- a/CMakeModules/FindPlplot.cmake
+++ b/CMakeModules/FindPlplot.cmake
@@ -9,8 +9,8 @@
#
-find_library(PLPLOT_LIBRARY NAMES plplotd)
-find_library(PLPLOTCXX_LIBRARY NAMES plplotcxxd)
@tschoonj
tschoonj / gio.patch
Last active September 21, 2015 15:31
diff --git a/gio/Makefile.am b/gio/Makefile.am
index e993e2f..6eab656 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -131,7 +131,7 @@ endif
if OS_COCOA
settings_sources += \
- gnextstepsettingsbackend.c
+ gnextstepsettingsbackend.m
diff --git a/src/gui/canvasview.cpp b/src/gui/canvasview.cpp
index 076f704..9cf4504 100644
--- a/src/gui/canvasview.cpp
+++ b/src/gui/canvasview.cpp
@@ -33,7 +33,7 @@
# include <config.h>
#endif
-#include <sigc++/adaptors/hide.h>
+#include <sigc++/sigc++.h>