sudo apt-get install libgpgme11-dev
sudo gem install ruby-gpgme
sudo apt-get install libgpgme11-dev
sudo gem install ruby-gpgme
$ gem sources -a http://gems.whatever.com |
All members of this public Slack channel are required to agree with the following code of conduct. Organisers will enforce this code. We are expecting cooperation from all participants to help ensuring a safe environment for everybody.
Contact adam@deskbeers.com, the owner of the Slack organisation that provides the #howtodrinkber channel, or one of the members of the @staff group.
def alexandra | |
p "hello alexandra. how old are you?" | |
age = gets.chomp | |
age.to_i.times { p "HAPPY BIRTHDAY" ; sleep 1 } | |
"ROARRRR!!!" | |
end |
.container { | |
width: 96%; | |
max-width: 920px; | |
margin: auto; | |
padding: 2px; | |
} | |
.site { | |
color: #383838; | |
padding-top: 70px; |
#!/bin/bash | |
# Usage: | |
# | |
# $ gemfile sinatra | |
# $ cat Gemfile | |
# source 'https://rubygems.org' | |
# gem 'sinatra' | |
function gemfile { |
trigger_app GET /apps/:id/trigger(.:format) apps#trigger | |
app_hooks GET /apps/:app_id/hooks(.:format) hooks#index | |
POST /apps/:app_id/hooks(.:format) hooks#create | |
new_app_hook GET /apps/:app_id/hooks/new(.:format) hooks#new | |
edit_app_hook GET /apps/:app_id/hooks/:id/edit(.:format) hooks#edit | |
app_hook GET /apps/:app_id/hooks/:id(.:format) hooks#show | |
PATCH /apps/:app_id/hooks/:id(.:format) hooks#update | |
PUT /apps/:app_id/hooks/:id(.:format) hooks#update | |
DELETE /apps/:app_id/hooks/:id(.:format) hooks#destroy | |
apps GET /apps(.:format) apps#index |
via Gregory Brown (@seacreature) on Twitter:
Wrong way to deal with the 1.9.2 removal of . from the loadpath:
require "./foo/bar"
forces you to run code from your project root$LOAD_PATH.unshift(".")
recreates security issue, and pollutesRight way to deal with the 1.9.2 removal of . from the loadpath:
require_relative "foo/bar"
if you don't need Ruby 1.8 compatibility# my_array is an array of arrays | |
if my_array.any? | |
my_array.each do |my_sub_array| | |
if my_sub_array.any? | |
my_sub_array.each do |my_thing| | |
my_thing.do_something | |
end | |
end | |
end | |
end |
require 'fog' | |
con = Fog::Storage.new( | |
provider: 'AWS', | |
aws_secret_access_key: 'ABC123', | |
region: 'eu-west-1', | |
aws_access_key_id: 'ABC123' | |
) | |
=> Fog::AWS::Storage object |