Skip to content

Instantly share code, notes, and snippets.

View adagio's full-sized avatar
👨‍💻
practicing NestJS / learning about AI

Edu F adagio

👨‍💻
practicing NestJS / learning about AI
View GitHub Profile
@adagio
adagio / myaction.html.erb
Created August 30, 2014 22:47
Set a meaningful title using the defined method
<% title "Meaningful title #{@meaningful_text}" %>
@adagio
adagio / application.html.erb
Created August 30, 2014 22:50
Use title defined in the View
<title><%= content_for?(:title) ? yield(:title) + " | My Website" : "My Website" %></title>
@adagio
adagio / Gemfile
Created August 30, 2014 23:27
Include ActiveResource in Gemfile
gem 'activeresource', require: 'active_resource'
@adagio
adagio / week.rb
Last active August 29, 2015 14:05
Declare the model that inherits from ActiveResource::Base
class Week < ActiveResource::Base
self.site = "http://api.service.com/v1:3000"
end
@adagio
adagio / weeks_controller.rb
Created August 30, 2014 23:41
Create a Controller to simply retrieve all records for the entity
class WeeksController < ApplicationController
# GET /weeks
def index
@weeks = Week.all
end
end
@adagio
adagio / index.html.erb
Created August 30, 2014 23:48
Render @Weeks on index View
...
<%= render @weeks %>
...
@adagio
adagio / _week.html.erb
Created August 30, 2014 23:50
Partial for week properties
<tr>
<td><%= week.firstDay %></td>
<td><%= week.comment %></td>
<td><%= week.another_property %></td>
</tr>
@adagio
adagio / routes.rb
Created August 30, 2014 23:53
Include weeks in routes.rb
...
resources :weeks
...
@adagio
adagio / getListingShop.json
Last active November 27, 2015 00:43
Etsy API getListingShop response
{
"count": "6",
"results": {
"0": {
"(Data about Shop)"
},
"1": {
"(Error messages)"
},
"2": {
@adagio
adagio / .htaccess
Last active December 4, 2015 22:11 — forked from thoop/.htaccess
Official prerender.io .htaccess for Apache.
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
#RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On