Skip to content

Instantly share code, notes, and snippets.

View dsrw's full-sized avatar

Scott Wadden dsrw

View GitHub Profile
@dsrw
dsrw / className.nim
Last active December 26, 2015 00:19
type TMember = object
proc className(t:typedesc):string =
astToStr(t)
template className2(t: expr):string =
astToStr(t)
echo TMember.className # => t
echo TMember.className2 # => TMember
@dsrw
dsrw / gist:5680261
Created May 30, 2013 19:02
Cherry-pick values from a scope
def self.create_personalized
m = Member.find(current_scope.where_values.find {|n| n.left.name == "member_id"}.right)
find_or_create_by_provider(m.name)
end
production:
adapter: mysql
encoding: utf8
reconnect: false
database: flowtown_production
pool: 5
username: root
password:
<%= "password: #{IO.read(ENV["HOME"] + "/config/production_password")}" rescue nil%>
begin
require 'vlad'
Vlad.load :scm => :git, :app => :passenger
set :web_command, "sudo /etc/init.d/apache2"
set :deploy_to, "/home/deploy/apps/#{vhost}"
namespace :vlad do
remote_task :create_vhost do
conf = "<VirtualHost *:80>