Skip to content

Instantly share code, notes, and snippets.

View christianromney's full-sized avatar
🏠
Working from home

Christian Romney christianromney

🏠
Working from home
View GitHub Profile
####<Jul 25, 2008 5:04:19 PM EDT> <Error> <HTTP> <nclwebdevapp02> <NCLWEBDEVAPP02> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<WLS Kernel>> <> <BEA-101019> <[ServletContext(id=67489679,name=myncl,context-path=/myncl)] Servlet failed with IOException
java.io.FileNotFoundException: /home/weblogic/bea/user_projects/domains/NCLWEBDEVdom/./NCLWEBDEVAPP02/.wlnotdelete/extract/NCLWEBDEVAPP02_myncl_myncl/jsp_servlet/_common/_layout/__home_template.java (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at java.io.FileWriter.<init>(FileWriter.java:73)
at weblogic.servlet.jsp.Jsp2Java.makeOutputStream(Jsp2Java.java:301)
at weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:337)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:286)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:388)
# Only fixes the structural stupidity, not the retardedness
# of the underlying method of package finding
def get_cruise_package(cruise_package_code)
returning(package = nil) do |pack|
[
:getPreHotelPackage, :getPostHotelPackage, :getShorexPackage,
:getPreTransfersPackage, :getPostTransfersPackage, getMotorcoachPackage
].detect do |find_by_package_type|
pack = send(find_by_package_type, cruise_package_code)
end
--- /Users/christian/Desktop/abe.txt 2008-08-13 13:28:39.000000000 -0400
+++ /Users/christian/Desktop/cbe.txt 2008-08-13 13:28:55.000000000 -0400
@@ -1,16 +1,20 @@
.
..
+.DS_Store
README.txt
TimeAndMoney
ant-contrib-1.0b1
#!/bin/bash
# Backup existing JAR
cp user_projects/domains/NCLWEBDEVdom/applications/CS/WEB-INF/lib/cms-dependencies.jar backups/cms/cms-dependencies.jar.`date -u +%Y-%m-%dT%H:%M:%SZ`
# Copy latest from cruise control
scp cruisecontroller@167.118.131.11:/var/cruisecontrolrb/projects/cms/work/dist/cms-dependencies.jar user_projects/domains/NCLWEBDEVdom/applications/CS/WEB-INF/lib/
# Make sure we own the file
chown weblogik:ncldevadm user_projects/domains/NCLWEBDEVdom/applications/CS/WEB-INF/lib/cms-dependencies.jar
@christianromney
christianromney / upgrade-git.rb
Created August 21, 2008 19:24
My script to upgrade Git
#!/usr/bin/env ruby -w
require 'fileutils'
include FileUtils
Version = ARGV.first
Downloads = File.join(ENV['HOME'], "Downloads")
BashCompletion = File.join(ENV['HOME'], ".bash_completion", "git_bash_completion")
# Create src download directory, if needed
mkdir_p(Downloads) unless File.exists?(Downloads)
[
'rubygems',
'irb/completion',
'net/http',
'wirble',
'map_by_method',
'what_methods'
].each {|lib| require lib}
def log
# Need to handle all of these....
# [x] Reservation.find(123)
# [ ] Reservation.find(123,456,769)
# [ ] Reservation.find(:all)
# [ ] Reservation.find(:all, :conditions => ['foo = ?', 'bar'])
module Cacheable
@@store = nil
class PersonalInfo < Section
immutable_fields :title, :birthdate, :country_of_birth,
:citizenship, :language, :email, :first_time_cruiser
validates_presence_of *(ImmutableFields - [:email])
end
mapper = Hash.new do |h,k|
[k.upcase, lambda {|x| x}]
end
@christianromney
christianromney / gist:20405
Created October 28, 2008 15:30
Crazy Control Flow Branching with Ruby Blocks
# One of the coolest things about lambdas is that they allow you to create your
# own control-flow structures. Of course, we often want control flow structures
# to branch. The built-in if/else control flow mechanism has branching. But, in Ruby,
# there's no way to specify that a method accepts two blocks
# and still retain the do..end syntactic sugar. Here's how you accept (and use) two blocks:
def odd(number, is_odd, is_even)
if number % 2 != 0
is_odd.call if is_odd.respond_to?(:call)
else