Skip to content

Instantly share code, notes, and snippets.

View hinzundcode's full-sized avatar

Chris hinzundcode

View GitHub Profile
@rootAvish
rootAvish / webview-snapshot.c
Last active February 14, 2024 00:30
This program will create an offscreen(invisible) webkit-web-view, and take a screenshot of the loaded document, the document/URL is passed as a command line argument to the program
#include <gtk/gtk.h>
#include <webkit/webkit.h>
static void destroyWindowCb(GtkWidget* widget, GtkWidget* window);
static gboolean closeWebViewCb(WebKitWebView* webView, GtkWidget* window);
static void
webkit_render_cb(WebKitWebView *webview,
@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
@davedevelopment
davedevelopment / app_bootstrap.php
Created November 26, 2012 23:45
Silex Route Helpers
<?php
use Silex\Application;
use Demo\Entity\Post;
use Demo\Controller\PostController;
$app = new Application;
$app['route_class'] = 'CustomRoute';
$app['dispatcher']->addSubscriber(new TemplateRenderingListener($app));
@glacjay
glacjay / tun-ping-linux.py
Created September 18, 2010 04:49
Reading/writing Linux's TUN/TAP device using Python.
import fcntl
import os
import struct
import subprocess
# Some constants used to ioctl the device file. I got them by a simple C
# program.
TUNSETIFF = 0x400454ca
TUNSETOWNER = TUNSETIFF + 2