#Mac OS X
#!/bin/sh | |
DIR=/Users/sbrown/backups | |
FILE=`date +"%Y%m%d"`-pinboard-backup.json | |
URL=https://USERNAME:PASSWORD@api.pinboard.in/v1/posts/all?format=json | |
cd $DIR | |
wget $URL -O $FILE |
# Here are some ways by which you can define an anonymous class | |
# 1 | |
class Rubyist | |
def self.who | |
"Geek" | |
end | |
end | |
# 2 |
This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.
# Ensure system is in ship-shape.
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev
by Jonathan Rochkind, http://bibwild.wordpress.com
Capistrano automates pushing out a new version of your application to a deployment location.
I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".
AddEncoding gzip .gz | |
RewriteEngine on | |
RewriteCond %{HTTP:Accept-encoding} gzip | |
RewriteCond %{HTTP_USER_AGENT} !Konqueror | |
RewriteCond %{REQUEST_FILENAME}.gz -f | |
RewriteRule ^(.*)\.css$ $1.css.gz [QSA,L] | |
RewriteRule ^(.*)\.js$ $1.js.gz [QSA,L] | |
RewriteRule ^(.*)\.html$ $1.html.gz [QSA,L] |
(defn itunes [command] | |
(let [mgr (javax.script.ScriptEngineManager.) | |
engine (.getEngineByName mgr "AppleScript")] | |
(.eval engine (str "tell application \"iTunes\" to " command)))) | |
(itunes 'pause) | |
(itunes 'play) | |
(itunes 'stop) | |
;; ... |
{% if page.title %}<meta property="og:title" content="{{ page.title }}" /><meta itemprop="name" content="{{ page.title }}" />{% endif %} | |
{% if page.author %}<meta name="author" content="{{ site.author }}" /> | |
<meta property="article:author" content="https://plus.google.com/+JeremyMorgan" /> | |
<meta property="og:type" content="article" />{% endif %} | |
{% if page.date %}<meta property="article:published_time" content="{{ page.date }}" />{% endif %} | |
{% capture category %}{% if page.categories %}{{ page.categories }}{% endif %}{% endcapture %} | |
{% if page.categories %}<meta property="article:section" content="{{ page.categories }}" />{% endif %} | |
{% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ content | raw_content }}{% endif %}{% endcapture %} | |
<meta name="description" content="{{ description | strip_html | condense_spaces | truncate:150 }}" /> | |
<meta property="og:description" content="{{ description | strip_html | condense_spaces | truncate:150 }}" /> |
#!/usr/bin/env ruby | |
# 1. export your RIL bookmarks | |
# 2. save this file to the same directory where your ril_export.html is | |
# 3. change username and password in the script bellow | |
# 4. run 'ruby ril_to_instapaper.rb' in terminal | |
require "cgi" | |
require "net/http" | |
require "net/https" |
# ... | |
desc "Deploy website to s3/cloudfront via aws-sdk" | |
task :s3_cloudfront => [:generate, :minify, :gzip, :compress_images] do | |
puts "==================================================" | |
puts " Deploying to Amazon S3 & CloudFront" | |
puts "==================================================" | |
# setup the aws_deploy_tools object | |
config = YAML::load( File.open("_config.yml")) |