Skip to content

Instantly share code, notes, and snippets.

@andyh
andyh / caprc.rb
Created December 7, 2008 22:31 — forked from topfunky/caprc.rb
# DESCRIPTION: Cap task to setup the current directory as git repository and then create and push to a remote repository via ssh.
#
# INSTALL: Copy to home directory as ~/.caprc
# RUN: cap git:setup scm=t
# If it's a Rails app run
# RUN: cap git:setup scm=t railsapp=t
#
# AUTHOR: Andy Henson (http://www.elaptics.co.uk) based on code by Geoffrey Grosenbach http://peepcode.com
#
set :application, "appname"
set :repository, "git@github.com:username/project.git"
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/var/apps/#{application}"
set :scm, :git
set :branch, "master"
set :typo3_local_folders, %W(fileadmin typo3temp uploads)
set :typo3_source, %W(index.php t3lib typo3)
namespace :deploy do
desc "Set up the expected application directory structure on all boxes"
task :setup, :except => { :no_release => true } do
sudo <<-CMD
mkdir -p #{deploy_to} #{releases_path} #{shared_path}
CMD
typo3_local_folders.each do |asset|
<?php
$TYPO3_CONF_VARS['SYS']['sitename'] = 'The Site Name [DEV]';
// Default password is "joh316" :
$TYPO3_CONF_VARS['BE']['installToolPassword'] = 'bacb98acf97e0b6112b1d1b650b84971';
$typo_db_extTableDef_script = 'extTables.php';
require '/full/path/to/the/project/config/db_settings.php';
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
Surround these with : e.g. :calling:
+1
-1
bulb
calling
clap
cop
email
feet
@andyh
andyh / calculate_vat.gemspec
Created October 18, 2011 22:08
Calculate Vat
Gem::Specification.new do |s|
s.name = 'calculate_vat'
s.version = '0.1.1'
s.platform = Gem::Platform::RUBY
s.author = 'Andy Henson'
s.email = 'andy@elaptics.co.uk'
s.summary = 'Calculate VAT stuff!'
s.description = 'Calculates UK VAT type stuff'
s.files = ['calculate_vat.rb']
class CreditCard < ActiveRecord::Base
attr_accessible :bank, :benefit_earn_rate, :benefit_type, :benefit_value, :interest, :name, :brand,
:goal_name, :goal_cost, :goal_value
def goal
self.goal_cost.to_f / self.goal_value.to_f
end
end
class SlidesController < ApplicationController
respond_to :html, :json, :pdf
def index
@slides = Slide.order("position")
respond_with(@slides)
end
def show
@slide = Slide.find(params[:id])