Skip to content

Instantly share code, notes, and snippets.

View deletosh's full-sized avatar

Dele Tosh deletosh

View GitHub Profile
require 'prawn/layout'
require 'prawn/format'
bill_address = @order.bill_address
ship_address = @order.ship_address
image "#{RAILS_ROOT}/public/images/site/client_logo.jpg", :at => [0,720], :scale => 0.65
image "#{RAILS_ROOT}/public/images/site/invoice_label.png", :at => [300,720], :scale => 0.65
move_down 75
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@loonies
loonies / hierarchy.php
Created November 20, 2011 21:39 — forked from devi/hierarchy.php
MySQL "Closure Table" for Kohana based on Bill Karwin design.
<?php defined('SYSPATH') or die('No direct script access.');
/**
* MySQL "Closure Table" for Kohana based on Bill Karwin design.
*
* @link http://www.slideshare.net/billkarwin/models-for-hierarchical-data
* @TODO improve
*
* sql schema:
* CREATE TABLE `closures` (
* `id` int(11) NOT NULL AUTO_INCREMENT,
@Fannon
Fannon / Monokai-FannonEdition.tmTheme
Created March 1, 2012 08:20
Sublime Theme: Monokai FannonEdition
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai FannonEd</string>
<key>settings</key>
<array>
<dict>
@mustmodify
mustmodify / cancan.php
Created March 30, 2012 20:02
How to implement URP in PHP using a cancan-style interface
<?php
class User
{
public $admin;
public $roles = array();
function roles()
{
if (isset($this))
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@johnantoni
johnantoni / mysql.txt
Created August 7, 2012 18:57
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@kix
kix / cap.rb
Created October 5, 2012 08:04
Capistrano cheat sheet
http://www.dizzy.co.uk/cheatsheets
This work is licensed under the Creative Commons
Attribution-NonCommercial-NoDerivs 2.0 License. To
view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-nd/2.0/uk
########## Shell Commands ##########
Installation:
$ gem install capistrano
@jparrill
jparrill / Vagrant_CheatSheet
Created November 27, 2012 22:04
Cheat Sheet for Vagrant
# Vagrant commands
vagrant reload #!
vagrant status
vagrant suspend
vagrant resume
vagrant halt
vagrant up
vagrant package
vagrant destroy
vagrant box add <nombre> <url>
@pete-otaqui
pete-otaqui / bumpversion.sh
Created December 2, 2012 11:08
Bump a software project's VERSION, add the CHANGES, and tag with GIT
#!/bin/bash
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or a newly entered value.