Skip to content

Instantly share code, notes, and snippets.

View Aupajo's full-sized avatar

Pete Nicholls Aupajo

  • Christchurch, New Zealand
View GitHub Profile
@Aupajo
Aupajo / scheduler-rails-logging.md
Last active August 29, 2015 14:24
Heroku scheduler, Rails, and logging

Script

puts "Plain puts"
warn "Plain warn"

$stdout.puts "Explicit stdout puts"
$stderr.puts "Explicit stderr puts"

# Rails log level is set to INFO (although future versions of Rails will default to DEBUG in production)
Africa - Abidjan
Africa - Accra
Africa - Addis Ababa
Africa - Algiers
Africa - Asmara
Africa - Asmera
Africa - Bamako
Africa - Bangui
Africa - Banjul
Africa - Bissau
@Aupajo
Aupajo / github-code-search.js
Created November 29, 2008 20:58 — forked from bastos/github-code-search.js
Different command.
// 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: "comechao@gmail.com"},
license: "MPL,GPL",
description: "Search on Github Code Search",
@Aupajo
Aupajo / git ps1 and completion on leopard
Created February 8, 2009 01:27
git ps1 and completion on leopard
curl -o ~/.git-completion.bash http://github.com/git/git/raw/master/contrib/completion/git-completion.bash
echo "source ~/.git-completion.bash" >> ~/.profile
echo "export PS1='\u:\W\$(__git_ps1 \"\[\e[32m\][%s]\[\e[0m\]\")$ '" >> ~/.profile
source ~/.profile
@Aupajo
Aupajo / timeline.as
Created February 8, 2009 02:17
easy actionscript movieclip switching
/*
Paste the code into the timeline. Set up your library so each clip has a class, and:
switchClip(Menu);
switchClip(Film);
It also returns the new clip, so you can chain methods like this:
switchClip(Film).addEventListener(Event.ENTER_FRAME, function(event:Event) {
trace('The film is playing!');
@Aupajo
Aupajo / gist:61649
Created February 10, 2009 22:45 — forked from anonymous/gist:61647
Top used commands
history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
83 nano
55 git
47 ssh
47 ghproxy
47 cd
36 ls
24 ping
19 sudo
@Aupajo
Aupajo / gist:61793
Created February 11, 2009 03:05
GistBot's first moments
GistBot joined the chat room.
[3:52pm] Aupajo: !gist anyone wanna see a cool gist trick?
[3:52pm] GistBot: http://gist.github.com/61788
[3:53pm] Aupajo: https://github.com/Aupajo/gistbot/tree/master
[3:53pm] rjbs: Bah. I want to push /all/ my branches to a remote.
[3:53pm] rjbs: Is there no trivial way?
[3:54pm] BonzoESC: Aupajo: that's nothing
[3:54pm] BonzoESC: http://gist.github.com/4280
[...]
[3:58pm] Aupajo: anything you private message to gistbot gets turned into a private gist too
@Aupajo
Aupajo / magic.markdown
Created February 12, 2009 04:13
A quick markdown test.

This is a header.

  1. This is the first list item.
  2. This is the second list item.

Here's some example code:

return shell_exec("echo $input | $markdown_script");
require 'sinatra'
require 'dm-core'
class Post do
include 'DataMapper'
property :title, String, :length => 255
property :content, Text
end
get '/' do
@posts = Post.all
erb :posts
@Aupajo
Aupajo / custom_before_header.rb
Created February 23, 2009 01:32
Custom Sinatra header
before do
response.header['X-Quote'] = 'Imagination, not intelligence, made us human.'
end