Skip to content

Instantly share code, notes, and snippets.

View georgeguimaraes's full-sized avatar
💭
🧰

George Guimarães georgeguimaraes

💭
🧰
View GitHub Profile

Keybase proof

I hereby claim:

  • I am georgeguimaraes on github.
  • I am georgeguimaraes (https://keybase.io/georgeguimaraes) on keybase.
  • I have a public key whose fingerprint is FCE8 DF97 5663 3A3D 0281 099E 3D24 7B42 2D56 8534

To claim this, I am signing this object:

class Product < ActiveRecord::Base
end
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
find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec
touch {}/.gitignore \;
# 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
/*
* 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[]) {
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

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
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"
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