Skip to content

Instantly share code, notes, and snippets.

View peel's full-sized avatar

Piotr Limanowski peel

View GitHub Profile
@rtomayko
rtomayko / optparse-template.rb
Last active June 3, 2023 03:16
Ruby optparse template
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
@ppurang
ppurang / SlogBuild.scala
Created August 22, 2011 17:19
scala sbt 10 multi module project
import sbt._
import Keys._
import sbt.Package._
import java.util.jar.Attributes.Name._
import com.github.siasia.WebPlugin._
//unashamed copy of scalaz's build
object SlogBuild extends Build {
override lazy val settings = super.settings :+
@klaeufer
klaeufer / unfiltered-simple-caching.scala
Created March 19, 2011 23:25
Simple Unfiltered example for providing OPTIONS, HEAD, and conditional GET
class RootPlan extends Plan {
val logger = Logger(classOf[RootPlan])
val creationDate = new java.util.Date
val eTag = hashCode.toString
val Head = Ok ~> Vary("Accept-Charset", "Accept-Encoding", "Accept-Language", "Accept")
val Caching =
CacheControl("max-age=3600") ~>
LastModified(DateUtils.formatDate(creationDate)) ~>
@uasi
uasi / vim.rb
Created November 30, 2010 16:46
Vim formula for Homebrew (EDIT: recent versions of official Homebrew distribution includes one)
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.682'
def features; %w(tiny small normal big huge) end