Skip to content

Instantly share code, notes, and snippets.

@jexchan
jexchan / gist:5037517
Last active April 23, 2024 08:18 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

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".

@jexchan
jexchan / chef_solo_bootstrap.sh
Last active December 14, 2015 10:10 — forked from ryanb/chef_solo_bootstrap.sh
Ubuntun Install Ruby before Chef
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev make
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p374.tar.gz
tar -xvzf ruby-1.9.3-p374.tar.gz
cd ruby-1.9.3-p374/
./configure --prefix=/usr/local
make
make install
@jexchan
jexchan / Intro-to-Vagrant-for-Drupal.md
Last active December 14, 2015 18:19 — forked from dergachev/Intro-to-Vagrant-for-Drupal.md
Intro to Vagrant for Drupal

Vagrant tutorial

  • Slideshow structure
    • About me - Alex Dergachev, co-founder @evolvingweb (follow me gh/twitter: @dergachev)
    • The problem
    • The solution - Chef & Virtualbox & Vagrant
      • Benefits
        • repo + sql dump + cookbooks + ubuntu ISO = Drupal stack
        • prod vs dev consistency
  • sysadmin code reuse
@jexchan
jexchan / deploy.rb
Created March 11, 2013 09:25
capistrano deploy script
require 'bundler/capistrano'
require "rvm/capistrano"
# Development server info
set :rvm_ruby_string, 'ruby-1.9.3-p286@global'
set :rvm_type, :system
set :application, "newclass.org"
set :scm, :git
set :repository, "git@github.com:jexchan/re-education.git"
@jexchan
jexchan / TeXIt.tex
Last active August 4, 2023 05:55 — forked from arcthur/TeXIt.tex
Latex with Chinese Support
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% 以上设定默认使用 XeLaTeX 编译,并指定 Unicode 编码,供 TeXShop 自动识别
% XeLaTeX 示例
\documentclass[12pt]{article}
% XeTeX 配合 fontspec 可以非常方便的设置字体
This post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown)
using [knitr](http://yihui.name/knitr/) in Rstudio 0.96.
This combination of tools provides an exciting improvement in usability for
[reproducible analysis](http://stats.stackexchange.com/a/15006/183).
Specifically, this post
(1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96;
(2) provides a basic example of producing console output and plots using R Markdown;
(3) highlights several code chunk options such as caching and controlling how input and output is displayed;
(4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and
(5) discusses the implications of R Markdown.
@jexchan
jexchan / r-tutorial.r
Created May 12, 2013 13:40 — forked from bobthecat/r-tutorial.r
R Tutorials
### R code from vignette source 'Presentation.Rnw'
### Encoding: UTF-8
###################################################
### code chunk number 1: init
###################################################
options(width=60)
###################################################
@jexchan
jexchan / basic_r_example.R
Created May 27, 2013 14:10
Basic R Examples
## BASICS
# Setup some scalars
x <- 3
y <- 4
z <- sqrt(x*x + y*y)
use.dots.in.names <- z - 5
# Print out z
print(z)
# The default action is print()
@jexchan
jexchan / osx setting shell scripts
Last active September 8, 2019 11:21 — forked from brandonb927/osx-for-hackers.sh
OSX Setting Shell Scripts
# ~/.osx — http://mths.be/osx
# root check
if [[ $EUID -ne 0 ]]; then
echo "################################";
echo "## YOU ARE NOT RUNNING AS ROOT #";
echo "################################";
echo "#";
echo "# USAGE: sudo $0";
exit;
@jexchan
jexchan / frontendDevlopmentBookmarks.md
Created June 22, 2013 11:03 — forked from dypsilon/frontendDevlopmentBookmarks.md
Frontend Development Resources