Skip to content

Instantly share code, notes, and snippets.

import sbt._
class SbtPluginProject(info:ProjectInfo) extends PluginProject(info) {
// *-- Copy of ResolverPlugin contents because a project can't depend on itself
val resolverPath = propertyOptional[String](".resolver")
private def sbtPublishResolver = {
import java.io.FileInputStream
import java.util.Properties
val props = new Properties() { def apply(key:String) = this.getProperty(key) }
props.load(new FileInputStream(resolverPath.value))
trait User extends Credentials {
def credentials:WkCredentials
val uuid:Option[String]
val username:String = credentials.username
val password:String = credentials.password
val role:UserRole = credentials.role
val title:String = credentials.title
val active:Boolean = credentials.active
}
case class Credentials(
/***************************************************************************
Author : Joey Mazzarelli
Email : mazzarelli@gmail.com
Homepage : http://joey.mazzarelli.com/js-opts
Source : http://bitbucket.org/mazzarell/js-opts/
License : Simplified BSD License
Version : 1.0
Copyright 2010 Joey Mazzarelli. All rights reserved.
package com.bryanjswift.android.view;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.EditText;
import android.widget.ScrollView;
/**
var Card = new Class({
Implements: [Options, Events],
options: {
index: 0,
bg: null
},
initialize: function(el, options){
<!-- Custom CSS/JavaScript -->
<script type="text/javascript" src="<?= PERCH_LOGINPATH ?>/plugins/ui/usability.js"></script>
@bryanjswift
bryanjswift / ec2-dns.rb
Created December 2, 2010 04:55
Print out useful information about running ec2 instances
#!/usr/bin/env ruby
#
# This ruby script will print out useful information about running ec2
# instances
#
# Reads AWS access and secret keys from environment variables
#
# Requires the amazon-ec2 gem (gem install amazon-ec2)
#
# Author: Bryan J Swift (bryan.j.swift@gmail.com)
/* Graph */
#graph { padding: 5px; width: 477px; height: 299px; }
@bryanjswift
bryanjswift / Servlet.scala
Created June 11, 2011 04:51
Basic Servlet trait and helper objects to make HttpServletRequest and HttpServletResponse interactions easier
package com.example
import javax.servlet.http.{Cookie, HttpServlet, HttpServletRequest => Request, HttpServletResponse => Response}
import scala.util.matching.Regex
trait Servlet extends HttpServlet {
override def doGet(request:Request, response:Response) = doGet(new HttpHelper(request, response))
override def doPost(request:Request, response:Response) = doPost(new HttpHelper(request, response))
def doGet(http:HttpHelper) { }
def doPost(http:HttpHelper) { }