This file contains hidden or 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
- | |
name: set locale | |
lineinfile: | |
dest=/etc/environment | |
line='LC_ALL="en_US.UTF-8"' | |
state=present | |
backup=true | |
sudo: true | |
tags: [ locale ] |
This file contains hidden or 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
[color] | |
branch = auto | |
diff = auto | |
interactive = auto | |
status = auto | |
ui = auto | |
pager = true | |
[merge] | |
tool = vimdiff | |
summary=true |
This file contains hidden or 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
#### Tmux configuration file #### | |
# \; - used for separating commands on binding | |
# Right colors for tmux | |
set -g default-terminal 'screen-256color' | |
# remapping command prefix to "Ctrl + a" and unbind "Ctrl+b" | |
set -g prefix C-a | |
unbind C-b |
This file contains hidden or 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
class A | |
def test | |
StorageClient.configure do |config| | |
config.host = "http://127.0.0.1" | |
config.api_version = "v1" | |
config.app_id = "123" | |
config.token = "adfasdfadsfasdf" | |
end |
This file contains hidden or 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 'bundler/setup' | |
Bundler.require | |
require 'minitest/autorun' | |
require 'webmock/minitest' | |
# colorize test output | |
require 'minitest/pride' | |
Minitest::PrideIO.pride! |
This file contains hidden or 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
set :branch do | |
tag = ENV['TAG'] || Capistrano::CLI.ui.ask("What tag do you want to deploy? ") | |
if tag.empty? | |
logger.important 'tag is emtpy, exiting' | |
exit | |
else | |
tag | |
end | |
end |
This file contains hidden or 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 'net/http' | |
uri = URI('http://localhost:8080/') | |
req = Net::HTTP::Post.new uri | |
file = File.open('spec/test_files/small.mp4', 'r') do |file| | |
count = 0 | |
range_size = 500 | |
while(block = file.read(range_size)) do |
This file contains hidden or 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
module ApiHelper | |
def require_auth | |
head :forbidden unless current_client | |
end | |
def current_client | |
@client ||= Client.find_by_api_token(params[:api_token]) | |
end | |
end |
This file contains hidden or 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
class Client < ::Weary::Client | |
domain "http://google.com" | |
def initialize | |
headers("Authorization" => "13") | |
end | |
get :test, "search" do | |
end |
This file contains hidden or 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
class Web::SessionsController < Web::ApplicationController | |
def new | |
@user = User.new | |
end | |
def create | |
@user = User.find_by_email(params[:user][:email]) | |
if @user && @user.authenticate(params[:user][:password]) | |
sign_in(@user) | |
@user.admin? ? redirect_to(admin_root_path) : redirect_to(client_root_path) |