Skip to content

Instantly share code, notes, and snippets.

PROMPT_COMMAND='history -a'
PATH=/usr/local/sbin:$PATH
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
@casualjim
casualjim / jquery.tweetArea.coffee
Created August 11, 2012 23:34
CoffeeScript version of jQuery text area with offset calculation for pasted urls
$ = jQuery
$.fn.extend
tweetArea: (options) ->
settings =
offset: 21
charDisplay: '#char-count'
warnAt: 120
postBox: '#tweet-area'
max: 140
@casualjim
casualjim / r.js
Created July 20, 2012 09:58
A plugin to use require.js from sbt (requires node)
/**
* @license r.js 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
/*
* This is a bootstrap script to allow running RequireJS in the command line
* in either a Java/Rhino or Node environment. It is modified by the top-level
* dist.js file to inject other files to completely enable this file. It is
post("/login") {
basicAuth
logger.debug("The user %s was successfully logged in.".format(params("userName")))
}
error {
case ex => logger.error("there was an error requesting %s" format request.path, ex)
}
protected def basicAuth() = {
@casualjim
casualjim / jsl.conf
Created May 2, 2012 10:34
Default jsl conf
#
# Configuration File for JavaScript Lint 0.3.0
# Developed by Matthias Miller (http://www.JavaScriptLint.com)
#
# This configuration file can be used to lint a collection of scripts, or to enable
# or disable warnings for scripts that are linted via the command line.
#
### Warnings
# Enable or disable warnings based on requirements.
@casualjim
casualjim / hack.sh
Created March 31, 2012 23:15 — forked from nrk/hack.sh
OSX For Hackers
#!/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/2108403/hack.sh | sh
#
<?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>bundleUUID</key>
<string>452017E8-0065-49EF-AB9D-7849B27D9367</string>
<key>fileTypes</key>
<array>
<string>scala</string>
</array>
@casualjim
casualjim / WebSocketClient.scala
Created February 13, 2012 19:42
A Netty based WebSocket client and server in scala
package mojolly.io
import org.jboss.netty.bootstrap.ClientBootstrap
import org.jboss.netty.channel._
import socket.nio.NioClientSocketChannelFactory
import java.util.concurrent.Executors
import org.jboss.netty.handler.codec.http._
import collection.JavaConversions._
import websocketx._
import java.net.{InetSocketAddress, URI}
@casualjim
casualjim / source_mojolly_env.sh
Created February 10, 2012 12:52
Source a file in a directory hierarchy if found in zsh
function chpwd() {
moj_root=$(pwd -P 2>/dev/null || command pwd)
while [ ! -e "$moj_root/.mojolly-env" ]; do
moj_root=${moj_root%/*}
if [ "$moj_root" = "" ]; then break; fi
done
if [ -r "$moj_root/.mojolly-env" ]; then source "$moj_root/mojolly-env"; fi
}
import sbt._
import Keys._
import java.io.PrintWriter
import collection.mutable
import scala.io.Source
import Project.Initialize
import sbt.classpath.ClasspathUtilities
import io.backchat.sbt._