Skip to content

Instantly share code, notes, and snippets.

sudo kill -9 `ps aux | grep [r]esque | grep -v grep | cut -c 10-16`
package object mail {
implicit def stringToSeq(single: String): Seq[String] = Seq(single)
implicit def liftToOption[T](t: T): Option[T] = Some(t)
sealed abstract class MailType
case object Plain extends MailType
case object Rich extends MailType
case object MultiPart extends MailType
namespace :deploy
desc "Restart Application serially on all servers"
task :restart, :roles => :app do
find_servers_for_task(current_task).each do |server|
run "touch #{jboss_home}/standalone/deployments/#{application}-knob.yml.dodeploy", :hosts => server.host
logger.info "Waiting for TorqueBox to finish restarting..."
# Sleep until the app appears to be started again
run "while ls #{jboss_home}/standalone/deployments/#{application}-knob.yml.dodeploy > /dev/null 2>&1; do sleep 1; done", :hosts => server.host
end
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
package test.monads
import scalaz._, Scalaz._, effect._, IO._
import javax.persistence.EntityManager
import javax.persistence.EntityManagerFactory
import javax.persistence.Persistence
import scala.collection.JavaConversions._
object testMonadicHibernate {
package com.natalinobusa.jpa
import javax.persistence._
@Entity
@Table(name = "buddy")
class Buddy(first: String, last: String) {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
var id: Int = _
package com.natalinobusa.jpa
import javax.persistence.EntityManager
import javax.persistence.EntityManagerFactory
import javax.persistence.Persistence
import scala.collection.JavaConversions._
object HibernateJpaScalaTutorial {
#!/bin/sh
set -e
APP=$1
APP_PATH="/srv/${APP}/current"
RAILS_ENV=$2
UNICORN_CONFIG="/etc/unicorn/${APP}.rb"
UNICORN_PID_FILE="/tmp/unicorn.${APP}.pid"
#!/bin/bash
#
# Install Postgres 9.2 on a clean Ubuntu 12.04
"""
LC_ALL issue
comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file.
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.