Skip to content

Instantly share code, notes, and snippets.

View bastos's full-sized avatar
:shipit:
Shipping something

Tiago Bastos bastos

:shipit:
Shipping something
View GitHub Profile
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base
require "rubygems"
require "dnssd"
require "set"
require "socket"
require "webrick"
module AliveJour
include Socket::Constants
Paste = Struct.new(:name, :host, :port)
@bastos
bastos / from.rb
Created December 12, 2008 15:49 — forked from bmizerany/from.rb
get '/:id' do
@vent = Vent.get(params[:id])
erb :show
end
# show post
get '/:id.xml' do
@vent = Vent.get(params[:id])
builder :show
end
#!/usr/bin/env python
# Drop.io Upload Tool for GNOME
# Copyright (C) 2008 Ryan Paul (SegPhault)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
// Based on apidock.org Ubiquity Search: http://gist.github.com/8132
CmdUtils.CreateCommand(
{
name: "github",
takes: {"function": noun_arb_text},
icon: "http://github.com/fluidicon.png",
homepage: "http://tiago.zusee.com",
author: {name: "Tiago Bastos", email: "[email protected]"},
license: "MPL,GPL",
description: "Search on Github",
// Based on apidock.org Ubiquity Search: http://gist.github.com/8132
CmdUtils.CreateCommand(
{
name: "code",
takes: {"function": noun_arb_text},
icon: "http://github.com/fluidicon.png",
homepage: "http://tiago.zusee.com",
author: {name: "Tiago Bastos", email: "[email protected]"},
license: "MPL,GPL",
description: "Search on Github Code Search",
@bastos
bastos / bashrc
Created November 11, 2008 20:31
my .bashrc with lots of dotfiles.org stuff :D
# If not running interactively, don't do anything
# [ -z "$PS1" ] && return
export EDITOR=emacsclient
export IOKE_HOME=~/code/ioke
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
! Global
Xft.antialias: true
Xft.rgba : rgb
Xft.hintstyle : hintfull
Xft.hinting : true
! URxvt
URxvt*xftAntialias: true
URxvt*background: #242424
URxvt*foreground: #fafffa
! Monaco Font: http://www.gringod.com/wp-upload/software/Fonts/Monaco_Linux.ttf
;; From http://alohakun.blog7.fc2.com/blog-entry-929.html with small changes...
(require-extension xlib)
(let ((dpy (xopendisplay #f)))
(assert dpy)
(let ((root (xdefaultrootwindow dpy)))
(xgrabkey dpy XK_F1 MOD4MASK root 1 GRABMODEASYNC GRABMODEASYNC)
(xgrabbutton dpy 1 MOD4MASK root 1 BUTTONPRESSMASK GRABMODEASYNC GRABMODEASYNC NONE NONE)
(xgrabbutton dpy 3 MOD4MASK root 1 BUTTONPRESSMASK GRABMODEASYNC GRABMODEASYNC NONE NONE)
(let ((event (make-xevent))
@bastos
bastos / gist:20804
Created October 29, 2008 19:55
Emacs lisp function to quick edit dot emacs file
;; from http://dotfiles.org/~lwu/.emacs
; code copied from XEmacs's Options\Edit Init File menu code
(defun edit-dot-emacs ()
"Edits the user's .emacs file"
(interactive)
(progn
(find-file (or user-init-file "~/.xemacs/custom.el"))
(or (eq major-mode (quote emacs-lisp-mode)) (emacs-lisp-mode))))