Skip to content

Instantly share code, notes, and snippets.

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    

Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4 or 5
@jaybobo
jaybobo / notes.md
Created July 26, 2017 02:39 — forked from monicao/notes.md
Deploying Sinatra to Heroku

It's time to deploy your app! H0Lee S#!T...
-- Khurram Virani, 2014

Introduction

Localhost is great and all, but at some point you might want to deploy other app to the wild (the internets) for others to be able to use it.

When an app is live, it’s often referred to as the "production" instance/server of your app. Your your local server (on localhost) which only you can use is referred to the "development" instance.

There are many options on how and where to deploy your web app. The simplest approach is to use a Platform as a Service (PaaS). A PaaS abstracts away many of the complexities associated with setting up, configuring and deploying to a machine in the cloud. Heroku is the most popular platform of this kind.

Bug Report

===================

1. Introduction

1.1 Purpose

This report provides a summary of the error results of test performed within the Staging Environment.

1.2 Scope

This summary will:

  • Identify a range of low to high priority performance bugs
  • Lists the activity and outcome of the user experience
  • Identify the bugs
@jaybobo
jaybobo / gist:7cb8c6df849b50f680620f780944e5fc
Created September 12, 2016 15:24 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@jaybobo
jaybobo / MultiExporter.jsx
Last active August 29, 2015 14:23 — forked from TomByrne/MultiExporter.jsx
For Adobe Illustrator
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to tom@tbyrne.org
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@jaybobo
jaybobo / tmux.md
Last active August 29, 2015 14:12 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

[core]
excludesfile = /home/rstovall/.gitignore
[alias]
st = status
ci = commit
co = checkout
br = branch
[user]
name = Snuggs
email = rashaun.stovall@clash-media.com