⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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 'rubygems' | |
require 'http-access2' # from gem httpclient | |
tests = { | |
# A simple test: GET a URL and expect a successful response | |
"Home page" => { | |
:get => "http://www.myapp.com/", | |
:result => 200 | |
}, |
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
desc "Pull a database dump from remote server, drop the local database, then import the dump" | |
task :pull_database_to_local do | |
# Build out temporary file name with timestamp for uniqueness | |
timestamp = get_timestamp | |
temp_file_name = "database_dump_#{timestamp}" | |
remote_file_name = remote_mysqldump(temp_file_name) | |
download(remote_file_name, "/tmp/#{temp_file_name}.sql.gz") |
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
def open_file(filename) | |
word_list = [] | |
aFile = File.open(filename, "r+") | |
aFile.each do |line| | |
list = line.split(" ") | |
list.each do |word| | |
word_list << word | |
end | |
end |
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
#!/usr/bin/env bash | |
### | |
# Run this script as root | |
### | |
# Setup variables for this script | |
USER_NAME=vlucas | |
USER_EMAIL=vance@vancelucas.com | |
SSH_PUBLIC_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxoQkUlUr+GcEpY1Its3mXFq/xi6yUgknxcSfGx0Yl25zo9nLl5UpeA+r0SmTfnu5oj674i+Ccx7NgwIkhGONXyKZaWyQf7jQZRa6sAMyETQ8QFbkprLCcF6LXJ9B1Khj16ZgXgcuSjMQKmbi8FA3iCcP5jGeT/02x5QhC5hXNPZafODwR5Xty559mLqsZ3LwzQZ4YaQDi4fnEDz7z4iA5+2Xo44de4ypmAmRBsOJZ0mgiRyClDEa0TVCctIXLeOt5OU76DE/IXuKHmtpwWiAI+c6ZNLmXeidrMQzhS6XfDwtTS0YMNnXn4aSSSJNhuvRAhCj9qjAXT1lV1QPb2P84Q== vance@vancelucas.com" |
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
# Courtesy of PagerDuty | |
Capistrano::Configuration.instance(:must_exist).load do |config| | |
start_times = {} | |
end_times = {} | |
order = [] | |
on :before do | |
order << [:start, current_task] | |
start_times[current_task] = Time.now |
git init # initalize a empty git repo
git status # check modifications in the repo repo
git log # check commits in the git repo
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
wget -O- https://api.github.com/users/$1/repos 2>/dev/null | grep ssh_url | cut -d '"' -f 4 | awk '{ print "git clone " $0 }' | sh |
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
public class JTestbuild | |
{ | |
public static void main(String[] args) | |
{ | |
int i = 0; | |
while(i < 14) | |
{ | |
switch(i) | |
{ | |
case(0): |
OlderNewer