Skip to content

Instantly share code, notes, and snippets.

package m
import shapeless.HMap
object leData {
object Name
object Age
object Address
object Street
protected [helpers] val singleSession = databaseConnection.createSession
val noDataSource = new JdbcDataSource {
def createConnection(): Connection = throw new RuntimeException("Tried to allocate another connection in test mode. This is an issue because the test database assumes that only one database connection in used. RolledbackDatabase needs to be improved.")
def close(): Unit = ()
}
// backend.BaseSession
class DelegatingSession(session: backend.SessionDef) extends backend.SessionDef {
override def database = session.database
From 57dc6a58baeed762981d1a28c0855e651c46982a Mon Sep 17 00:00:00 2001
From: Tim Harper <timcharper@gmail.com>
Date: Sat, 4 Oct 2008 10:05:49 -0600
Subject: [PATCH] add a sensible suffix to the log path, to get rid of all the of tiny unix epoch suffixed files
---
config/environments/production.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config/environments/production.rb b/config/environments/production.rb
@timcharper
timcharper / init.rb
Created November 20, 2008 21:41
very messy! (need to take out inline javascript and refactor)
require 'tabset_helpers.rb'
ActionView::Base.send(:include, TabsetHelpers)
#!/bin/bash
branch_name=$(sed 's|ref: refs/heads/||' .git/HEAD)
remote_name=${1:-origin}
remote_branch=${2:-$branch_name}
if [ "$branch_name" == "$(cat .git/HEAD)" ]; then
echo "You're not on a branch"
exit 1
fi
@timcharper
timcharper / ruby-enterprise.spec
Created December 13, 2008 06:43
Ruby Enterprise Edition RPM spec
cat ruby-enterprise.spec
Summary: Ruby Enterprise Edition
Name: ruby-enterprise
Version: 1.8.6
Release: 20081205
License: GPL
Group: Applications/System
Source: ruby-enterprise-%{version}-%{release}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}
%description
# put on the server
# put in /etc/puppet/custom/plugins/facter/custom_facts.rb
require 'yaml'
if File.exist?("/etc/puppet/custom_facts.yml")
YAML.load_file("/etc/puppet/custom_facts.yml").each do |key, value|
Facter.add(key.to_sym) do
setcode { value }
end
end
html = <<-EOF
<html>
<body>
<table>
<tr>
<td>
One
<table><tr><td>Nested Cell #1</td></tr></table>
</td>
</tr>
html = <<-EOF
<html>
<body>
<table>
<tr>
<td>
One
<table><tr><td>Nested Cell</td></tr></table>
</td>
</tr>
top_left = new GLatLng(point.lat() - radius, point.lng() - radius),
bottom_right = new GLatLng(point.lat() + radius, point.lng() + radius)
this.rectangle = new GRectangle(
this.map,
top_left,
bottom_right,
{
line_color: (this.kind == "home") ? "#3355ff" : "#ff5533",
fill_color: (this.kind == "home") ? "#335599" : "#995533",