Skip to content

Instantly share code, notes, and snippets.

View hayeah's full-sized avatar
🕳️
Focusing

blah blah hayeah

🕳️
Focusing
View GitHub Profile
(defun my-align-regexp (start end regexp)
"repeat alignment with respect to
the given regular expression"
(interactive "r\nsAlign regexp: ")
(align-regexp start end
(concat "\\(\\s-*\\)" regexp) 1 1 t))
require 'rubygems'
require 'sinatra/base'
require 'dress'
require 'pp'
class Site < Dress::Maker
layout {
html {
head { title("Admin") }
body { content }
require 'rubygems'
require 'thin'
require 'versapay'
require 'run/common'
# t = Thread.new {
# puts "thread: #{Thread.current}"
# }
###################
# #### RUBY STUFF
define eval
call(rb_p(rb_eval_string_protect($arg0,(int*)0)))
end
define redirect_stdout
call rb_eval_string("$_old_stdout, $stdout = $stdout, File.open('/tmp/ruby-debug.' + Process.pid.to_s, 'a'); $stdout.sync = true")
# unicorn_rails -c uni.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
When a self-help book urges you to bend reality, I
think what it boils down to is that people can
take a lot of a abuse. But most of us are not
psychopathic enough to take advantage of
people. Unfortunately for us individually,
fortunately for us as a society.
It's really a phenomenon of the modern world. In
prehistoric time, I suppose, if you fuck somebody,
@hayeah
hayeah / gist:271105
Created January 7, 2010 09:20
Custom ActionController for Dress
require 'dress'
class Dresser < ActionController::Base
class Page < Dress::ActiveView
# TODO layout should render in the context of the page
layout do
html {
head {
meta("content" => "text/html; charset=UTF-8", "http-equiv" => "Content-Type")
title("VersaPay EFT Admin")
}
┌[~/tr][pts/5]
└> ENV=dev rake db:migrate
(in /home/howard/vp/transaction)
Migrating database vp_dev
-- add_column("authorizations", "recipient_user_id", :integer)
-> 0.2137s
-- rename_column("authorizations", "originator", "sender_user_id")
-> 0.0015s
-- rename_column("authorizations", "sender", "sender_account_id")
-> 0.0018s
[It is often said that if only we can hear each other, then we will
fall in love. What separates us, always, isn't space, but vacuum. We
can be close, yet never be together. We stand facing each other, but
are incapable of seeing each other. So it is, we are doomed to eternal
loneliness. Yearning for a love, clearly seen, within grasp, but
separated by a glass wall.
The woman is trapped in a glass chamber, and the man, lost in his
wandering, chanced upon her, and finds her suffocating, slowly dying
from her own exhalation. Only a sheet of glass separates them,
Thinkers and Doers
There's really no such thing as being a "thinker"
who can't get things done and being a "doer" who
doesn't think much.
Each of us has a fixed quantity of energy we can
use any given day. Thinking and doing are both
activities that consume the energy.