This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
APP = __FILE__.split('/').last | |
pwd = Dir.pwd | |
if ARGV.include? '--enable' | |
post_commit = File.join(pwd,'.git/hooks/post-commit') | |
abort('post commit hook already exist!') if File.exists?(post_commit) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <zmq.h> | |
#include <pthread.h> | |
#include <assert.h> | |
static void * worker_routine (void *context) { | |
char buf; | |
void *socket = zmq_socket (context, ZMQ_PAIR); | |
assert( zmq_connect (socket, "inproc://linger") > -1 ); | |
assert( zmq_send(socket, &buf, 1, 0) > -1); // unblock main thread | |
// zmq_recv will block until context is terminated |