Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@tkasha
tkasha / .tmux.conf
Created April 28, 2018 18:37 — forked from jnaulty/.tmux.conf
The best tmux and vim configuration in the universe
# Our .tmux.conf file
# Setting the prefix from C-b to C-s
set -g prefix C-s
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
set -sg escape-time 1
# Ensure that we can send Ctrl-S to other apps
bind C-s send-prefix
@tkasha
tkasha / .tmux.conf
Created April 28, 2018 18:37 — forked from tsl0922/.tmux.conf
vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# vi is good
@tkasha
tkasha / curl.md
Created November 17, 2017 12:47 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@tkasha
tkasha / deploy
Created September 18, 2017 12:24
server '18.194.50.206', port: 22, roles: [:web, :app, :db], primary: true
set :repo_url, '[email protected]:Clasher370/flashcards.git'
set :application, 'flashcards'
set :user, 'deploy'
set :puma_threads, [4, 16]
set :puma_workers, 0
# Don't change these unless you know what you're doing
set :pty, true
00:00 git:wrapper
01 mkdir -p /tmp
✔ 01 [email protected] 0.182s
Uploading /tmp/git-ssh-flashcards-production-tkasha.sh 100.0%
02 chmod 700 /tmp/git-ssh-flashcards-production-tkasha.sh
✔ 02 [email protected] 0.211s
00:00 git:check
01 git ls-remote [email protected]:Clasher370/flashcards.git HEAD
01 cf2ebfc32825172801765ffa1a4f0c3e957a121b HEAD
✔ 01 [email protected] 1.776s
RSpec.feature 'CreateCard', type: :feature do
describe 'new card' do
before do
@user = create(:user)
login
visit new_card_path
fill_in :card_original_text, with: 'white'
fill_in :card_translated_text, with: 'белый'
attach_file :card_image, 'app/assets/images/test_image.jpg'
click_button 'Create Card'
config.twitter.key = ENV['TWITTER_KEY']
config.twitter.secret = ENV['TWITTER_SECRET_KEY']
config.twitter.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=twitter"
config.twitter.user_info_mapping = {:email => "screen_name"}
config.facebook.key = ENV['FACEBOOK_KEY']
config.facebook.secret = ENV['FACEBOOK_SECRET_KEY']
config.facebook.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=facebook"
config.facebook.user_info_mapping = {:email => "email", :name => "name", :username => "username", :hometown => "hometown/name"}
config.facebook.scope = "email"
def callback
provider = auth_params[:provider]
if @user = login_from(provider)
redirect_to root_path, :notice => "Logged in from #{provider.titleize}!"
else
begin
@user = create_from(provider)
reset_session
auto_login(@user)
redirect_to root_path, :notice => "Logged in from #{provider.titleize}!"
class Card < ApplicationRecord
before_create :set_date
validates :original_text, :translated_text, :review_date, presence: true
validate :text_should_be_differ
scope :with_ready_date, -> { where('review_date <= ?', Date.today) }
scope :random_one, -> { order('RANDOM()').first }
private