Skip to content

Instantly share code, notes, and snippets.

View gpampara's full-sized avatar

Gary Pamparà gpampara

  • Pretoria, South Africa
View GitHub Profile
@wsargent
wsargent / gist:5860224
Created June 25, 2013 16:58
Using ning async http client
import play.api.libs.ws.Response
import scala.concurrent.{Future, Promise}
import com.ning.http.client._
import com.ning.http.client.{Response => AHCResponse}
import com.ning.http.client.AsyncCompletionHandler
val url = "http://google.com"
val config = new AsyncHttpClientConfig.Builder()
@mpilquist
mpilquist / gist:3679896
Created September 8, 2012 21:26
Template approach to avoiding explicit type annotations
import scalaz._
/**
* Provides type aliases and utilities for working with state disjunctions.
*
* A state disjunction is a function `S => F[(S, L \/ R)]` wrapped in the StateT and EitherT monad
* transformers.
*
* See `StateDisjunctionT` and `StateDisjunction` for more information.
@kofemann
kofemann / adler32.py
Last active October 15, 2021 07:57
A script to calculate adler32 checksum of given files
#!/usr/bin/env python
'''A script to calculate adler32 checksum of given files'''
BLOCKSIZE=256*1024*1024
import sys
from zlib import adler32
for fname in sys.argv[1:]:
asum = 1
with open(fname,"rb") as f:
package pl.irc
import org.jibble.pircbot.PircBot
import dispatch._
import Http._
import net.liftweb.json._
import net.liftweb.json.JsonDSL._
import net.liftweb.json.Printer.{compact}
import java.io.{PrintStream, ByteArrayOutputStream}
@cdown
cdown / gist:1163649
Last active July 7, 2025 00:58
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in