Skip to content

Instantly share code, notes, and snippets.

class Crap
attr_accessor :crappiness
def initialize(tolerability = 5)
@crappiness = 0
@tolerability = tolerability
end
def +(int)
result = dup
// example program
package main
import (
"fmt"
"os"
"github.com/garyburd/redigo/redis"
)
@gavinheavyside
gavinheavyside / .gitconfig
Created June 20, 2014 09:12
Clean up your leftover merged git branches
[alias]
cleanup = "!git fetch -p && git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d"
class HashWithIndifferentAccess < Hash
def [](key)
super(convert_key(key))
end
def []=(key, value)
super(convert_key(key), value)
end
def self.[] (*args)
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.heavyside.redis</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/redis-server</string>
<string>/usr/local/etc/redis.conf</string>
@gavinheavyside
gavinheavyside / edash_notifier.rb
Created May 26, 2010 20:47
A cruisecontrol.rb notifier for edash
# A cruisecontrol.rb plugin to send notifications to edash (http://github.com/edendevelopment/edash)
# - put it in $CRUISE_DATA_ROOT/builder_plugins and restart cruisecontrol.rb
#
# notify building status to edash
#
# You might need to change the host and port in the post line
require 'builder_error'
require 'rest_client'
class EdashNotifier < BuilderPlugin
(ns geotools.shape-viewer
(:import [org.geotools.data CachingFeatureSource FeatureSource FileDataStore FileDataStoreFinder])
(:import [org.geotools.map DefaultMapContext MapContext])
(:import [org.geotools.swing JMapFrame])
(:import [org.geotools.swing.data JFileDataStoreChooser]))
(defn show-shapefile
"Prompts the user for a shapefile and displays its content"
[]
(if-let [shapefile (JFileDataStoreChooser/showOpenFile "shp" nil)]
(defproject geotools-quickstart "1.0.0-SNAPSHOT"
:description "FIXME: write"
:repositories {"osgeo-geotools" "http://download.osgeo.org/webdav/geotools"}
:dependencies [[org.clojure/clojure "1.1.0"]
[org.clojure/clojure-contrib "1.1.0"]
[org.geotools/gt-main "2.6.4"]
[org.geotools/gt-shapefile "2.6.4"]
[org.geotools/gt-epsg-hsql "2.6.4"]
[org.geotools/gt-swing "2.6.4"]]
:dev-dependencies [[swank-clojure "1.2.1"]])
@gavinheavyside
gavinheavyside / core.clj
Created May 27, 2011 12:15
Pallet Experiment
(ns pallet_experiments.core
(:require
[pallet.core :as core]
[pallet.resource :as resource]
[pallet.crate.automated-admin-user :as automated-admin-user]))
(core/defnode mynode
"Test node for messing around"
{:os-family :amzn-linux
:location-id "eu-west-1"