Skip to content

Instantly share code, notes, and snippets.

View deletosh's full-sized avatar

Dele Tosh deletosh

View GitHub Profile
@deletosh
deletosh / sampler
Created July 8, 2015 14:29
something.asp
<!--#include virtual="/ajaxed/bootstrap.asp" -->
<!--#include virtual="/includes/authCheck.asp" -->
<!-- classes -->
<!--#include virtual="/ajaxed/class_email/email.asp" -->
<!--#include virtual="/class/split.inc" -->
<!--#include virtual="/class/csvparser.inc" -->
<%
@deletosh
deletosh / cap.rb
Last active August 29, 2015 14:14 — forked from kix/cap.rb
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
@deletosh
deletosh / gist:dacf27125961e3efd387
Created June 16, 2014 18:42
Sentry new license
Cartalyst PSL
Copyright (c) 2011-2014, Cartalyst LLC,
All rights reserved.
This license is a legal agreement between you and Cartalyst LLC for the use of
any package (*all versions*) Software (the "Software"). By downloading any
version of the Software you agree to be bound by the terms and conditions of
this license.
You may alter, modify, or extend the Software for your own use or for use in as
# From a fresh install of squeeze
apt-get install ruby rubygems # Need ruby to use fpm
gem1.8 install fpm --no-ri --no-rdoc
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -zxvf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125
rm -rf /tmp/ruby193
@deletosh
deletosh / gist:9027335
Created February 16, 2014 00:22
Free space for composer
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
(eval):3: unterminated string meets end of file (SyntaxError)
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/dsl/loader.rb:28:in `instance_eval'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/dsl/loader.rb:28:in `block in load'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/dsl/loader.rb:17:in `open'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/dsl/loader.rb:17:in `load'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/environment.rb:102:in `block (2 levels) in enumerate_and_load'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/environment.rb:101:in `glob'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/environment.rb:101:in `block in enumerate_and_load'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/environment.rb:91:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/deface-1.0.0.rc4/lib/deface/environment.rb:91:in `enu
Ruby 1.9.3
1. Copied spree/backend/app/assets to new extenion (geleyi)
2. deploy with capistrano
--Gemfile ---
source 'https://rubygems.org'
gem 'rails', '3.2.14'
@deletosh
deletosh / apache2.conf
Created July 9, 2013 20:20
default Apache2 conf file
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
#! /bin/sh
TEMPFILE=`tempfile`
cat /var/log/installer/initial-status.gz | gzip -d |grep '^Package:' | awk '{ print $2}' > $TEMPFILE
aptitude search -F %p '~i!~M' | awk '{ print $1}' | grep -v -F -f $TEMPFILE
rm $TEMPFILE

How to use MAMP with the mysql2 gem and Ruby 1.9.3-p194 via rbenv

Let's say you're a web developer who happens to work with both MAMP and Ruby when building different types of websites. Let's say you also like to keep your MySQL stuff in one place and don't like having to juggle both a local MySQL install as well as a MAMP MySQL install. Well, you can indeed connect your ruby apps to MAMP's MySQL. Here's a tutorial on how to do it.

Important! Before you do anything, download and install MAMP. MAMP Pro will work as well. At the time of this writing, MAMP 2.1.1 is the latest.

First, install Ruby via rbenv

  1. Install homebrew
  2. Install rbenv: brew install rbenv, follow any instructions homebrew gives you after the installation is complete.