Skip to content

Instantly share code, notes, and snippets.

@haixuanc
haixuanc / bash_cheatsheet.md
Created October 4, 2018 04:53 — forked from lee2sman/bash_cheatsheet.md
bash scripting cheatsheet

Bash scripting cheatsheet

  • by Lee2sman
  • Updated 2017-09-18

Bash shebang

  • #!/usr/bin/env bash for portability, or less good, #!/bin/bash

Commenting

@haixuanc
haixuanc / bash-cheatsheet.sh
Created October 4, 2018 04:53 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

Setup

Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug.

gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]

Using PRY

@haixuanc
haixuanc / index.html
Last active August 29, 2015 14:26 — forked from anonymous/index.html
JS Bin // source https://jsbin.com/folufu
<!DOCTYPE html>
<html ng-app="uploadApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-controller="UploadCtrl">
<file-uploader on-select="addFile(file)"></file-uploader>
curl -Lo- http://bit.ly/janus-bootstrap | bash
#errored out...had to install git first, derrr
sudo apt-get install git
curl -Lo- http://bit.ly/janus-bootstrap | bash
# error! had to install rake next
sudo apt-get install rake
curl -Lo- http://bit.ly/janus-bootstrap | bash

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname