Skip to content

Instantly share code, notes, and snippets.

View rrichards's full-sized avatar
💭
Rocking the CLI

Ryan Richards rrichards

💭
Rocking the CLI
  • R3 Technologies, Inc.
  • Oklahoma City, OK
  • X @rrichards
View GitHub Profile
CmdUtils.CreateCommand({
name: "search-domain-name",
icon: "http://instantdomainsearch.com/favicon.ico",
author: {name: "Pratham Kumar", email: "pratham@pratham.name"},
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};
if (CmdUtils.parserVersion == 2) {
CmdUtils.CreateCommand({
names: ["traffic"],
icon: "http://siteanalytics.compete.com/favicon.ico",
author: {name: "Pratham Kumar", email: "pratham@pratham.name"},
description: "Get Compete traffic statistics.",
homepage: "http://pratham.name/",
arguments: [{role: 'object', nountype: noun_arb_text, label: 'example.com'}],
preview: function (html, q) {
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.',
#RUBYISMS
a = b.foo
if a.empty?
a = b.bar
else
a.reverse!
end
#can be simplied a little by assigning and
##########################################
#Ruby idioms
########################################
#old school
breakfast = nil
if !breakfast
breakfast = "bacon"
end
#cool but is there a better way?
breakfast = "bacon" unless breakfast
#!/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
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
@rrichards
rrichards / README
Created November 13, 2009 02:31 — forked from avit/README
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/).
# 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
#!/usr/bin/env ruby
# check_memcached.rb ko.de.r.de@googlemail.com 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
#