Skip to content

Instantly share code, notes, and snippets.

#define GLEW_STATIC
#include <glew.h>
#include <glfw3.h>
#include <iostream>
#include <string>
#include <fstream>
#include "main.h"
set(PostgreSQL_ADDITIONAL_VERSIONS "9.4" "9.4.4")
find_package(PostgreSQL REQUIRED)
set(SOURCE_FILES main.cpp)
add_executable(test_libpqxx ${SOURCE_FILES} main.cpp)
target_link_libraries(test_libpqxx pq)
target_link_libraries(test_libpqxx pqxx)
#!/bin/bash
wget=/usr/bin/wget
CONFIG=""
CONFIG_GUESS_URL='http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
CONFIG_SUB_URL='http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
update-configure(){
for CONFIG in $(find -name config.guess) ; do
$wget -q -O $CONFIG $CONFIG_GUESS_URL
$ make
=== making jpeg ===
Archiving ../lib/libfltk_jpeg.a...
=== making zlib ===
Compiling adler32.c...
Compiling compress.c...
Compiling crc32.c...
Compiling uncompr.c...
Compiling deflate.c...
Compiling trees.c...
//Example of how to create a minimal MFC application
//1. Create a new Win32 project, select empty project
//2. Go to project options > Use MFC in a shared library (.dll)
//3. Make a new resource file with an empty dialog
//4. Give the dialog the name "IDD_INTERFACE1"
//5. Build and run.
//---------------------------------------
#include <afxwin.h>
#include "resource.h"
//---------------------------------------
[package]
name = "servoembeddingtest"
version = "0.1.0"
authors = ["felix"]
[dependencies]
embedding = { path = "../servo/ports/cef" }
%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (Adobe-Identity-UCS)
%%Title: (Adobe-Identity-UCS Adobe Identity 0)
%%Version: 1
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
@fschutt
fschutt / errors.rs
Created April 4, 2017 00:35
Error handling in Rust
//! Everything that could go wrong is in errors::Error, for error generalization
//! *NOTE* : In order to use the macros, you must include the error module before the
//! module that uses the macros
//! This is why in /src/lib.rs the error module is the first module listed
use std::fmt::Display;
use std::fmt::Formatter;
use std::fmt;
/// Macro for returning {1} if {0} doesn't match Some(0)
@fschutt
fschutt / notification.rs
Created December 24, 2017 09:25
Example of how to make a DBus Notification in Rust
extern crate dbus;
use dbus::{Connection, Message, BusType, MessageItem};
fn main() {
let c = Connection::get_private(BusType::Session).unwrap();
let mut m = Message::new_method_call(
"org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
"org.freedesktop.Notifications",
@fschutt
fschutt / solution.txt
Created December 24, 2017 13:55
How to enable two-finger scrolling using xinput (ThinkPad T420)
I can't say that this will work for everyone, but here's what I did:
First, list the input devices:
xinput list
You should get output like this:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]