Skip to content

Instantly share code, notes, and snippets.

View evantill's full-sized avatar

Eric Vantillard evantill

View GitHub Profile
@cee-dub
cee-dub / dnsmasq.conf
Created January 14, 2012 23:23
Generic configuration files for *.#{hostname}.local wildcard DNS with dnsmasq and mDNSResponder
# Add domains for which you want to force to an IP address here.
# This is the magic sauce for making *.#{hostname}
# always route to the localhost
address=/#{hostname}/127.0.0.1
address=/#{hostname}/::1
mx-host=#{hostname},#{hostname},10
# Extra options that make dnsmasq play nice
log-queries
@relrod
relrod / gist:1736528
Created February 4, 2012 09:00
SBT Install Script for Linux
# bash < <(curl -L http://da.gd/sbtinstall)
# Or, of course:
# bash < <(curl https://raw.github.com/gist/1736528/e9e978c81cc1f8a550973151d3922eede4c9b12a/gistfile1.sh)
mkdir -pv ~/bin/
curl -o ~/bin/sbt-launch.jar http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.11.2/sbt-launch.jar
echo 'java -Xmx512M -jar `dirname $0`/sbt-launch.jar "$@"' > ~/bin/sbt
chmod u+x ~/bin/sbt
echo 'Make sure ~/bin/ is in your $PATH and that you have a working `java` command.'
echo '* DONE *'
@stuarthalloway
stuarthalloway / gist:2321773
Created April 6, 2012 18:15
Datomic schema query, constrained by attribute namespace
;; Datomic sample code
;; schema query for attribute types in specified namespaces
(q '[:find ?attr
:in $ [?include-ns ...] ;; bind ?include-ns once for each item in collection
:where
[?e :db/valueType] ;; all schema types (must have a valueType)
[?e :db/ident ?attr] ;; schema type name
[(datomic.Util/namespace ?attr) ?ns] ;; namespace of name
[(= ?ns ?include-ns)]] ;; must match one of the ?include-ns
@rodionmoiseev
rodionmoiseev / gist:2484934
Created April 25, 2012 00:41
Setting up Play 2.0 in build.gradle
apply plugin: 'java'
apply plugin: 'scala'
// For those using Eclipse or IntelliJ IDEA
apply plugin: 'eclipse'
apply plugin: 'idea'
def findPlay20(){
def pathEnvName = ['PATH', 'Path'].find{ System.getenv()[it] != null }
for(path in System.getenv()[pathEnvName].split(File.pathSeparator)){
for(playExec in ['play.bat', 'play.sh', 'play']){
@tobiash
tobiash / categorypages.plugin.coffee
Created May 17, 2012 16:44
Dynamically generate pages for Docpad (from categories)
path = require 'path'
fs = require 'fs'
balUtil = require 'bal-util'
Backbone = require 'backbone'
module.exports = (BasePlugin) ->
class Category extends Backbone.Model
constructor: ->
@alecthegeek
alecthegeek / fixgitprompt.sh
Created August 21, 2012 05:09
Fix for Git Prompt in Homebrew
# Upgraded git using Homebrew and now your __git_ps1() fails. Try something like this
# NB Still very fragile as had embedded version no
# enable git programmable completion features
if [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
. /usr/local/etc/bash_completion.d/git-completion.bash
fi
# enable git prompt
@ayosec
ayosec / CORSDirectives.scala
Created December 18, 2012 03:28
CORS with Spray
package foo.bar
import spray.routing._
import spray.http._
import spray.http.StatusCodes.Forbidden
// See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
case class Origin(origin: String) extends HttpHeader {
import annotation.implicitNotFound
@implicitNotFound(msg = "This message can never appear!")
trait ~>[A, B] { self =>
def apply(a: A): B
def invert(b: B): A = inverse.apply(b)
def inverse: B ~> A = new ~>[B,A] {
def apply(b: B) = self.invert(b)
override def invert(a: A) = self(a)
}
import scalaz._, Scalaz._, NonEmptyList._
sealed trait Interval[+A] {
val min: A
val max: A
def map[B: Order](f: A => B): Interval[B] =
Interval(f(min), f(max))
def merge[AA >: A](i: Interval[AA])(implicit E: Enum[AA]): Option[Interval[AA]] =
@balupton
balupton / README.md
Last active April 29, 2019 11:57
DocPad: Use DocPad, GitHub & Prose as a Wiki

Use DocPad, GitHub and Prose as a Wiki

This guide will walk you through how you can use a GitHub repository to house your wiki content, have DocPad render it, and automatically update on changes. It's also really nice as we get to benefit from the github project workflow for our wiki, that is issues, pull requests, etc.

We use this workflow heavily by linking the DocPad Website and the DocPad Documentation repositories allowing us to have users edit and submit pull requests for improvements to our documentation, and once merged, the website regenerates automatically.

1. Create a new repository for your Wiki Content