This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "search-domain-name", | |
icon: "http://instantdomainsearch.com/favicon.ico", | |
author: {name: "Pratham Kumar", email: "[email protected]"}, | |
description: "Checks availabilty of the domain name with com/net/org TLDs.", | |
homepage: "http://pratham.name/", | |
takes: {"example.com": noun_arb_text}, | |
preview: function (html, q) { | |
var params = {name: q.text}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (CmdUtils.parserVersion == 2) { | |
CmdUtils.CreateCommand({ | |
names: ["traffic"], | |
icon: "http://siteanalytics.compete.com/favicon.ico", | |
author: {name: "Pratham Kumar", email: "[email protected]"}, | |
description: "Get Compete traffic statistics.", | |
homepage: "http://pratham.name/", | |
arguments: [{role: 'object', nountype: noun_arb_text, label: 'example.com'}], | |
preview: function (html, q) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const | |
Google = 'http://www.google.com/', | |
GImage = 'http://image.google.com/', | |
GVideo = 'http://video.google.com/', | |
Gmail = 'https://mail.google.com/mail/', | |
GReader = Google +'reader/', | |
GCode = Google + 'codesearch', | |
GLogos = Google +'logos/', | |
GSgFAQ = 'suggest'.link('http://labs.google.com/suggestfaq.html'), | |
PPath = 'extensions.ubiquity.google.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#RUBYISMS | |
a = b.foo | |
if a.empty? | |
a = b.bar | |
else | |
a.reverse! | |
end | |
#can be simplied a little by assigning and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################## | |
#Ruby idioms | |
######################################## | |
#old school | |
breakfast = nil | |
if !breakfast | |
breakfast = "bacon" | |
end | |
#cool but is there a better way? | |
breakfast = "bacon" unless breakfast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Setting up chef..." | |
sudo apt-get -y update | |
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert | |
cd /tmp | |
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz | |
tar zxf rubygems-1.3.4.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'thor' | |
require 'chef' | |
require 'chef/node' | |
require 'chef/rest' | |
# Please see the readme for overview documentation. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ToadMate Bookmarklet | |
Adds clickable links to open the file/line from the | |
stacktrace on Hoptoad (http://hoptoadapp.com) into TextMate. | |
INSTALL: | |
Change the lpd variable to your local project directory. | |
It relies on your project folders being named after the main part | |
of your domain name (example.com => /example/). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ec2 ami-1515f67c | |
sudo sed -i 's/universe/multiverse universe/' /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert rubygems git-core rake librspec-ruby libxml-ruby thin couchdb zlib1g-dev libxml2-dev | |
sudo gem sources -a http://gems.opscode.com | |
sudo gem sources -a http://gemcutter.org # for nanite | |
sudo gem install cucumber merb-core nanite jeweler uuidtools json libxml-ruby --no-ri --no-rdoc | |
mkdir ~/src | |
cd ~/src | |
git clone git://github.com/opscode/chef.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# check_memcached.rb [email protected] 20091101 v0.1 | |
# Copyright 2009, Dennis Kong | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |