- package control
- autocomplete
- sublime linter
- vintageous
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sinatra/base" | |
require "sinatra/namespace" | |
require "multi_json" | |
require "api/authentication" | |
require "api/error_handling" | |
require "api/pagination" | |
module Api | |
class Base < ::Sinatra::Base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First attempting to use Capybara directly, you will run into issues when trying to set HTTP headers; e.g. | |
# using Basic HTTP Authentication requires setting the header. | |
# Also we need to set the Content-Type and Accept headers to ensure that our API negotiates content types correctly. | |
# When using Rack, Capybara delegates request and response handling down to Rack::Test. | |
# So use Rack::Test directly in step definitions, and it works. | |
# Rack::Test has a module called Rack::Test::Methods that can be mixed into a class to provide it | |
# with methods for get, post, put, delete as well as last_request, last_response, header and more. | |
# The Rack::Test::Methods can be mixed into the Cucumber world at the top of our API steps file like so: | |
############################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create the directory structure | |
mkdir -p features/step_definitions | |
mkdir -p features/support | |
# Create a placeholder for the step_definitions folder | |
touch features/step_definitions/"$(basename `pwd`)_steps.rb" | |
# Create the environment file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# This vagrant script relies on | |
# vagrant plugin install vagrant-triggers | |
VM_NAME = "vbox-dev" | |
VM_CPUS = 1 | |
VM_MEMORY = 2 * 1024 # in MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
manifest_url='http://releases.ubuntu.com/releases/trusty/ubuntu-14.04.3-desktop-amd64.manifest' | |
manifest_file=$(echo $manifest_url | sed -e 's#.*/##g') | |
if [ ! -e $manifest_file ]; then | |
wget -q $manifest_url | |
fi | |
cat $manifest_file | cut -f1 | sort -u > default_installed.txt | |
aptitude search '~i !~M' -F '%p' --disable-columns | sort -u > currently_installed.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# check modified (M) ruby (.rb) files with rubocop | |
git status --porcelain | grep '^ M.*.rb' | cut -c4- | xargs -r rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faraday' | |
require 'faraday_middleware' | |
class Client | |
JSON_CONTENT = 'application/json' | |
attr_reader :conn | |
# Initialize a new client | |
def initialize | |
@base_uri = 'https://api.example.org' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Useful GIT Functions | |
#### Cutting a release with a log of recent pull requests merged to master | |
git_release_commits () | |
{ | |
git pull | |
git fetch -p | |
git log --oneline --decorate | grep 'Merge pull request' | head -n25 |
OlderNewer