Skip to content

Instantly share code, notes, and snippets.

View anathematic's full-sized avatar

Thomas anathematic

View GitHub Profile
TravelPrototype::Application.routes.draw do
root to: 'welcome#index'
get "/:page", to: "welcome#page"
end
## configure
thomass-imac:mysql-5.1.39 thomas$ ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-shared --with-plugins=innobase
checking build system type... i386-apple-darwin10.0.0
checking host system type... i386-apple-darwin10.0.0
checking target system type... i386-apple-darwin10.0.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
./configure: eval: line 3611: syntax error near unexpected token `('
./configure: eval: line 3611: `${SHELL} /Users/thomas/Desktop/Software (mac)/mysql-5.1.39/missing --run true'
@anathematic
anathematic / survey.md
Created November 16, 2009 10:10 — forked from radar/survey.md
  • What did you do to get good at Rails?
  • I wouldn't consider myself that good at rails however TDD and BDD (writing tests) REALLY helped me improve a lot
  • Who taught you what you know?
  • Mostly self fiddling / I've learnt a lot from the Mocra team (mostly Radar)
  • Do you have any fond (or not so fond) memories of your learning experiences?
  • Too many to list, this is a full time job for me
  • What was your first production app and what did you learn from it?
// Each object in the json has a name. That's it. This will sort them.
json = json.sort(function (a,b) {
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
});
## View
<% if current_user_authorised?(@venue, current_user) %>
Foo~
<% end %>
## Helper
def current_user_authorised?(record, current_user)
current_user ? (true if record.user == current_user or current_user.admin?) : false
end
test -f /etc/default/god && . /etc/default/god
[ $GOD_CONFIG ] || exit 0
. /lib/lsb/init-functions
RETVAL=0
case "$1" in
start)
echo -n "Starting $DESC: "
@anathematic
anathematic / Thinking Sphinx + God.rb
Created December 16, 2009 08:53
Thinking Sphinx God script
APP_PATH = "/home/wotvenue/rails_app/staging.foo.com"
RAILS_ROOT = "/home/wotvenue/rails_app/staging.foo.com/current/"
RAILS_ENV = "production"
God.watch do |w|
w.name = "thinking-sphinx-staging"
w.interval = 25.seconds # default
w.start = "cd #{RAILS_ROOT} && ruby script/ts:start RAILS_ENV=#{RAILS_ENV}"
w.stop = "cd #{RAILS_ROOT} && ruby script/ts:stop RAILS_ENV=#{RAILS_ENV}"
w.restart = "cd #{RAILS_ROOT} && ruby script/ts:index RAILS_ENV=#{RAILS_ENV}"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><%= APP_CONFIG[:app_name] %></title>
<%= stylesheet_link_tag "formtastic.css" %>
<%= stylesheet_link_tag "application.css" %>
source ~/.git-completion.bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names