This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo kill -9 `ps aux | grep [r]esque | grep -v grep | cut -c 10-16` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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 +@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = _ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.natalinobusa.jpa | |
| import javax.persistence.EntityManager | |
| import javax.persistence.EntityManagerFactory | |
| import javax.persistence.Persistence | |
| import scala.collection.JavaConversions._ | |
| object HibernateJpaScalaTutorial { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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. |