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
.idea/* | |
*.pyc |
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
# nginx | |
description "nginx http daemon" | |
author "George Shammas <[email protected]>" | |
start on (filesystem and net-device-up IFACE=lo) | |
stop on runlevel [!2345] | |
env DAEMON=/opt/nginx/sbin/nginx | |
env PID=/var/run/nginx.pid |
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
class Category < ActiveRecord::Base | |
def ask_question(question) | |
begin | |
## Code to check some other system for the answer, Redis or Memcached maybe. | |
raise "System is unavailable, you should turn it on" | |
rescue Exception => e | |
## Do something with exception | |
puts "System is unavailable" | |
return nil |
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
class Category < ActiveRecord::Base | |
def ask_question(question) | |
## Code to check some other system for the answer, Redis or Memcached maybe. | |
raise "System is unavailable, you should turn it on" | |
end | |
end | |
params = {category_id: 1, question: "Why did the quick brown fox jump over the lazy dog?"} |
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
###### | |
###### Write a function that accepts a string of parenthesis, return true if it is a valid string, false if not. | |
###### Strings are valid if all parens close, ie: () or (()) or (()()()) are valid, ()), ((), )( etc. would be invalid. | |
###### An empty string is also valid. | |
###### | |
require 'test/unit' | |
def valid_parans(string) |
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
namespace :engineyard do | |
@environment = "your_application_production" | |
@git_tag = "HEAD" | |
desc "Upload Chef Deploy recipes" | |
task :upload_chef_recipes => [:environment, :set_eyrc] do | |
sh "cd ey-cloud-recipes && bundle exec ey recipes upload -e #{@environment}" | |
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
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime |
NewerOlder