Skip to content

Instantly share code, notes, and snippets.

View zcourts's full-sized avatar

Courtney Robinson zcourts

View GitHub Profile
@zcourts
zcourts / pom.xml
Created November 28, 2012 22:09
generic Scala RPM pom.xml file
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>project</artifactId>
<groupId>com.company</groupId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Project</name>
@zcourts
zcourts / EventProcessor.java
Created April 9, 2013 13:24
Generic handler for Netty 4.
package io.higgs;
import com.google.common.base.Optional;
import io.higgs.events.ChannelMessage;
import io.higgs.events.HiggsEvent;
import io.higgs.events.listeners.ChannelEventListener;
import io.higgs.functional.Function1;
import io.higgs.queueingStrategies.CircularBufferQueueingStrategy;
import io.higgs.queueingStrategies.LinkedBlockingQueueStrategy;
import io.higgs.queueingStrategies.QueueingStrategy;
package info.crlog.bloomfilter;
/**
* <h1>Introduction</h1>
* A BitSet is a vector used by the {@link BloomFilter} to mark used locations.
* Since Java doesn't have a "bit" data type this class provides methods for manipulating
* the bits within a Java {@link Byte}. Java's bytes are signed which imposes a -127 + 128 limit.
* We work around this by controlling the MSB and interpreting it as just another bit in an 8-bit
* structure.
* <p/>
@zcourts
zcourts / sublime-text-3.sh
Last active December 23, 2015 21:39 — forked from henriquemoody/sublime-text-2.sh
Installs Sublime Text 3 on Linux machines that do not have pre-built packages
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 3
Comment=Edit text files
Exec=/usr/local/sublime-text-3/sublime_text
Icon=/usr/local/sublime-text-3/Icon/128x128/sublime-text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
@zcourts
zcourts / Setup.hs
Created December 13, 2013 08:07 — forked from jodonoghue/Setup.hs
--
-- Modified version of the wxcore Cabal setup.hs file which builds the C++ code in a buildhook
-- so that we have some control over how the linking works.
--
import Control.Monad (when)
import Data.List (foldl', intercalate, nub, lookup)
import Data.Maybe (fromJust)
import Distribution.PackageDescription
import Distribution.Simple
import Distribution.Simple.LocalBuildInfo (LocalBuildInfo, localPkgDescr, withPrograms, buildDir)
{-# LANGUAGE RecordWildCards #-}
import Prelude hiding (Either(..))
import Data.IntMap (IntMap)
import qualified Data.IntMap as IM
import System.IO (Handle)
import Network (withSocketsDo, listenOn, accept, PortID(..))
import qualified Data.ByteString as B
import Data.Aeson
#!/bin/bash
cabal configure && cabal build && cabal haddock --hyperlink-source \
--html-location='http://hackage.haskell.org/package/$pkg/docs' \
--contents-location='http://hackage.haskell.org/package/$pkg'
S=$?
if [ "${S}" -eq "0" ]; then
cd "dist/doc/html"
DDIR="${1}-${2}-docs"
cp -r "${1}" "${DDIR}" && tar -c -v -z -Hustar -f "${DDIR}.tar.gz" "${DDIR}"
CS=$?
@zcourts
zcourts / Murmur3.hs
Last active January 3, 2016 14:39
To wrap the ansi C fn void MurmurHash3_x86_32 (const void *key, int len, uint32_t seed, void *out);
{-# LANGUAGE ForeignFunctionInterface #-}
module Data.Dish.Murmur3(x86_32
--,x86_128,x64_128
) where
import Foreign.C -- get the C types
import Foreign.Ptr
import Foreign
import qualified Foreign.ForeignPtr.Unsafe as US
@zcourts
zcourts / hack.sh
Created January 23, 2014 16:46 — forked from dtsn/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2281636/hack.sh | sh
#
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1