Skip to content

Instantly share code, notes, and snippets.

View georgeguimaraes's full-sized avatar
💭
🧰

George Guimarães georgeguimaraes

💭
🧰
View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvvVbZp3zf4KYVyvioOzeSFoDz6MNEJaHZcUHqTApqyB6u0pbFqwUU/vq/vhQQ410ETy5EdO5pzgBBy018tB9DhXMZXlJIpM4CLwejdnRszJcIPhXgG9vXJNhYpwGKGeifNNC/PlII7GQtWozpEP8fP+TIaYNfp/53dWpuVvVWNLVM8x/alE0DbY7CSR2lkzN/8s/Acl3thdl0QAIxxddTqhjN3koivssxv12DZ9Df+htZmhmyqTTFwIpWEi226bA4ZhFjwcnxOy00l4FJ20dq6Y3ATpqUCgLBD81anbSEVBE5X+4ne2Zs5ln7VO3TXx1egriMl0zXnltyElI1J3kpQ== george@lap
require 'rubygems'
require 'atom'
xhtml = Atom::Content::Xhtml.new("<p>Some text</p>")
entry = Atom::Entry.new do |e|
e.title = "some title"
e.updated = 12345
e.content = xhtml
end
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js
class CanonicalHost
def initialize(app, host=nil, &block)
@app = app
@host = (block_given? && block.call) || host
end
def call(env)
if url = url(env)
[301, { 'Location' => url }, ['Redirecting...']]
else
/*
* is this cool enough that it warrants a blog post?
*
* trigger breakpoint in GDB, from code.
*/
#include <stdio.h>
int main(int argc, char *argv[]) {
# collect information about a running process
# ruby debug.rb <pid>
begin
raise ArgumentError unless pid = ARGV[0]
pid = pid.to_i
Process.kill(0,pid)
rescue TypeError, ArgumentError
raise 'pid required'
rescue Errno::ESRCH
find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec
touch {}/.gitignore \;
http://cms.site.mydomain.com/cms/login
POST /cms/login HTTP/1.1
Host: cms.site.mydomain.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10
class Product < ActiveRecord::Base
end