Skip to content

Instantly share code, notes, and snippets.

View binyamindavid's full-sized avatar
🏠
Working from home

Oster binyamindavid

🏠
Working from home
View GitHub Profile
@stefanneculai
stefanneculai / AWS_CONFIG.rb
Last active June 26, 2019 05:29
Amazon Signature Ruby
AWS_CONFIG = {
'access_key_id' => YOUR_ACCESS_KEY,
'secret_access_key' => YOUR_SECRET_ACCESS_KEY,
'bucket' => 'froala',
'acl' => 'public-read',
'key_start' => 'uploads/',
'region' => 's3' # For other regions than us-east-1, use s3-region. E.g.: s3-eu-west-1
}
@emad-elsaid
emad-elsaid / weather.rb
Created February 21, 2014 14:53
get wheather of any city using ruby
require 'open-uri'
require 'json'
require 'psych'
city = 'portsaid,egypt'
request = "http://api.openweathermap.org/data/2.5/weather?q=#{city}"
response = open(request).readlines.join
print Psych.dump( JSON.parse(response) )
=render @memory_page.approved_comments
= simple_form_for [@memory_page, Comment.new], html: {class: 'form-inline'} do |f|
.form-inputs
.row
.col-md-12
= f.input :comment, label: "Add Your Comment", input_html: {class: 'editable'}
.row#hidden_form_elements.hide //I have some JS callback that will display these fields once the parent input has been edited
.col-md-6
= f.input :name
.col-md-6