Skip to content

Instantly share code, notes, and snippets.

// This is what it looks like in Diesel 1.0.
// This is a "bare minimum" set of impls, which do not result in a type that can be used everywhere
// a built in one can. There are 7 variants of `AsExpression` and an additional `ToSql` impl
// that a type needs to be used absolutely everywhere.
pub struct MyType;
#[derive(Debug, PartialEq)]
pub enum MyEnum {
Foo,
# A gksudo equivalent for Mac OS X
/usr/bin/osascript -e 'do shell script "make install" with administrator privileges'
@schoentoon
schoentoon / inotify.c
Last active February 27, 2024 22:13
Simple example of how to use inotify with libevent. Compile with gcc -o inotify inotify.c -levent
#include <stdio.h>
#include <event.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <sys/inotify.h>
static void displayInotifyEvent(struct inotify_event *i)
{
printf(" wd =%2d; ", i->wd);
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//