Skip to content

Instantly share code, notes, and snippets.

View jasherai's full-sized avatar

Pritesh jasherai

  • Phatforge
  • London
View GitHub Profile
//Note: This command was automatically generated by the create-bookmarklet-command command.
CmdUtils.makeBookmarkletCommand({
name: "readability",
url: "javascript:(function(){readStyle='style-newspaper';readSize='size-large';readMargin='margin-medium';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='screen';document.getElementsByTagName('head')[0].appendChild(_readability_css);_readability_print_css=document.createElement('LINK');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readabil
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
@jasherai
jasherai / _README.md
Created November 23, 2009 11:05 — forked from kneath/_README.md

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
@jasherai
jasherai / build_chef_0.8
Created December 1, 2009 13:41 — forked from btm/build_chef_0.8
Chef 0.8 alpha on ec2 process
# 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
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 --no-ri --no-rdoc
mkdir ~/src
cd ~/src
git clone git://github.com/opscode/chef.git
Usage: ./knife-app sub-command (options)
-k, --key KEY API Client Key, defaults to OPSCODE_KEY
-c, --config CONFIG The configuration file to use
-e, --editor EDITOR Set the editor to use for interactive commands
-l, --log_level LEVEL Set the log level (debug, info, warn, error, fatal)
-L, --logfile LOGLOCATION Set the log file location, defaults to STDOUT
-u, --user USER API Client Username, defaults to OPSCODE_USER
-p, --print-after Show the data after a destructive operation
-v, --version Show chef version
-y, --yes Say yes to all prompts for confirmation
# install_chef.sh
#
# John Merrells <john@merrells.com>
logfile="/root/log.txt"
echo "-----" >> $logfile
# New sources.list
cat > /etc/apt/sources.list << EOF
deb http://gb.archive.ubuntu.com/ubuntu/ karmic main restricted
# ...
# append following lines
Dir[ File.join(File.dirname(__FILE__), 'tasks', '*.rake') ].sort.each do |f|
load f
end
#!/bin/sh
# Demo how your can merge opscode chef-repo & cookbooks
# and perm. keep up to date with opscode cookbooks (the last "git" cmd)
% git clone git://github.com/opscode/chef-repo.git
Initialized empty Git repository in /home/tim/src/chef-repo/.git/
remote: Counting objects: 107, done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 107 (delta 45), reused 0 (delta 0)
Receiving objects: 100% (107/107), 16.14 KiB, done.
Resolving deltas: 100% (45/45), done.
# Author:: Adam Jacob <adam@opscode.com>
# Author:: Joshua Timberman <joshua@opscode.com>
#
# Copyright 2009-2010, Opscode, Inc
#
# 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
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'