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
paper.customAttributes.arc = function (centerX, centerY, startAngle, endAngle, innerR, outerR) { | |
var radians = Math.PI / 180, | |
largeArc = +(endAngle - startAngle > 180); | |
// calculate the start and end points for both inner and outer edges of the arc segment | |
// the -90s are about starting the angle measurement from the top get rid of these if this doesn't suit your needs | |
outerX1 = centerX + outerR * Math.cos((startAngle-90) * radians), | |
outerY1 = centerY + outerR * Math.sin((startAngle-90) * radians), | |
outerX2 = centerX + outerR * Math.cos((endAngle-90) * radians), | |
outerY2 = centerY + outerR * Math.sin((endAngle-90) * radians), | |
innerX1 = centerX + innerR * Math.cos((endAngle-90) * radians), |
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 | |
# This pre-commit hook will prevent any commit to forbidden branches | |
# (by default, "staging" and "production"). | |
# Put this file in your local repo, in the .git/hooks folder | |
# and make sure it is executable. | |
# The name of the file *must* be "pre-commit" for Git to pick it up. | |
FORBIDDEN_BRANCHES = ["staging", "production"] |
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
1) Bring up Directory Utility (/Applications/Utilities/Directory Utility) | |
2) Click “Show Advanced Settings”. | |
3) Click “Mounts” | |
4) Click the lock to make the changes | |
5) Click “+” to add an entry | |
6) Add you entry, expand the mount parameters box and enter net in the options. If you have other options to add, add them as well, comma-separated. | |
7) At this point, you can either wait for some time for the autofs to detect the change and reload the maps or run the automount -cv command to load the changes. |
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
# Creating the template spatial database. | |
$ createdb -E UTF8 template_postgis | |
$ createlang -d template_postgis plpgsql # Adding PLPGSQL language support. | |
# Allows non-superusers the ability to create from this template | |
$ psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" | |
# Loading the PostGIS SQL routines | |
$ psql -d template_postgis -f /usr/local/share/postgis/postgis.sql | |
$ psql -d template_postgis -f /usr/local/share/postgis/spatial_ref_sys.sql |
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 bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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
# Requires the following gems: prawn, barby and rqrcode | |
require "prawn" | |
require "prawn/measurement_extensions" | |
require "barby" | |
require "barby/barcode/code_128" | |
require "barby/outputter/prawn_outputter" | |
barcode = Barby::Code128.new('12345','A') | |
badge = Prawn::Document.new(:page_size => "A5", :page_layout => :landscape, :margin => 0) do |pdf| |
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
.group:after { | |
content: "."; | |
display: block; | |
height: 0; | |
clear: both; | |
visibility: hidden; | |
overflow: hidden; | |
} | |
* html .group { |
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
1) Make sure .ssh directory exists on remote server | |
2) Generate SSH key using ssh-keygen -t rsa | |
3) Copy public key onto remote server and append to ~/.ssh/authorised_keys2 | |
4) Test password-less SSH onto remote server, might need to edit ~/.ssh/config | |
Host shortname | |
HostName ipaddr | |
Port blah (if port not 22) | |
User blah (if user not the same as local user) |
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
# From: http://afreshcup.com/home/2009/9/2/migrating-to-snow-leopard-for-rails-development-a-definitive.html | |
sudo gem install rvm | |
rvm-install | |
rvm install 1.8.6 -C --enable-shared,--with-readline-dir=/usr/local | |
rvm install 1.8.7 -C --enable-shared,--with-readline-dir=/usr/local | |
rvm install 1.9.1 -C --enable-shared,--with-readline-dir=/usr/local | |
rvm install 1.9.2 -C --enable-shared,--with-readline-dir=/usr/local | |
rvm 1.8.7 --default |
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 | |
def output_config | |
puts <<-END | |
graph_category App | |
graph_title passenger status | |
graph_vlabel count | |
sessions.label sessions | |
max.label max processes |