Skip to content

Instantly share code, notes, and snippets.

View mcandre's full-sized avatar

Andrew mcandre

  • Milwaukee, WI
View GitHub Profile
@billdozr
billdozr / distributed-ping.hs
Last active October 8, 2015 18:08
Distributed ping (with boilerplate code, i.e. without Template Haskell)
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
import System.Environment (getArgs, getProgName)
import Control.Monad (forM_, replicateM_)
import Data.Binary (Binary, encode, decode)
import Data.Typeable (Typeable)
import Data.ByteString.Lazy (ByteString)
import Control.Concurrent (threadDelay)
import Data.Rank1Dynamic (toDynamic)
import Control.Distributed.Static
( Static
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@sashaphanes
sashaphanes / variableTransposer.pl
Created October 9, 2012 15:22
flexible transposer
#!/usr/bin/perl
use strict;
#use warnings;
require "getopts.pl";
use vars qw ($opt_f $opt_s $opt_h $opt_H);
&Getopts('f:s:hH:');
@qbit
qbit / gist:5483415
Last active February 25, 2024 13:35
KSH support for git-prompt
# ksh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).

Linux:

$ netstat | grep <port>

Mac OS X:

$ lsof -i :
System Preferences -> Mission Control -> Mouse Button 4 -> -
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@pyrtsa
pyrtsa / gist:6213784
Created August 12, 2013 18:46
When installing Haskell Platform fails on Mac OS X (with quick fix below)

When installing Haskell Platform fails on Mac OS X (with quick fix below)

I was fighting with Haskell last weekend. At first, I couldn't install some missing libraries with Cabal, and then, when trying to find out what's wrong, I ended up removing the whole Haskell installation — only to find out I could no longer install neither the Haskell Platform nor even just Cabal Install! The warnings I would see were more or less about the use of the single quote in source code:

Preprocessing library text-0.11.2.3...

Data/Text.hs:6:52:
     warning: missing terminating ' character [-Winvalid-pp-token]

-- Copyright : (c) 2009, 2010, 2011, 2012 Bryan O'Sullivan,

As you know, The first Witcher game was released for Mac on Steam a few days ago. It runs decently within a Wineskin wrapper, but it has been a polarizing issue for people who believed it should have been a native port rather than a "lazy" wrapped port.

In any case, I've been scouring the Internet for information on this game, and one particular post on the Inside Mac Games Forum stood out. Here is the link to the full post, but I've highlighted the important note here:

The Witcher: Mac Edition is using an older version of the Wineskin engine (WS8 1.3.7), so I swapped out the 1.3.7 engine with the very latest 1.5 engine and performance has improved SIGNIFICANTLY. I mean it.

I thought that was really interesting, so I searched around some more and found a few more links from other forums linking to the same post and asking how to do it. The poster actually went into some detail on the instructions, but assumes some pri

@jmoiron
jmoiron / valuer.go
Created October 14, 2013 18:03
Example uses of sql.Scanner and driver.Valuer
package main
import (
"bytes"
"compress/gzip"
"database/sql/driver"
"errors"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"