FriendlyIdSchema is a micro gem that combines FriendlyId with ActiveRecordSchema
Call #permalink inside a model like this:
class Post| # encoding: utf-8 | |
| module Mongoid #:nodoc: | |
| module Associations #:nodoc: | |
| module EmbeddedCallbacks | |
| def _send_to_each_embedded_document(method, *args, &block) | |
| self.class.associations.each_pair do |name, meta| | |
| if meta.association == Mongoid::Associations::EmbedsMany | |
| assoc = self.send(name) |
| html{color:#000;background:#FFF}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,select,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,button,caption,cite,code,dfn,em,input,optgroup,option,select,strong,textarea,th,var{font:inherit}del,ins{text-decoration:none}li{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:baseline}sub{vertical-align:baseline}legend{color:#000}body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small}select,input,textarea,button{font:99% arial,helvetica,clean,sans-serif}table{font-size:inherit;font:100%}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%}h1{font-size:138.5%}h2{font-size:123.1%}h3{font-size:108%}h1,h2,h3{padding:0 0 0.5em}h1,h2,h3,h4,h5,h6,strong,dt{font-weight:bold}optgroup |
| { | |
| var thisParser = this; | |
| function resolveSymbol(parser, sym){ | |
| return (parser.symbols || {})[sym]; | |
| } | |
| function flatten(array){ | |
| var flat = []; | |
| for (var i = 0, l = array.length; i < l; i++){ |
FriendlyIdSchema is a micro gem that combines FriendlyId with ActiveRecordSchema
Call #permalink inside a model like this:
class Post| Gem::Specification.new do |s| | |
| s.name = 'paperclip_schema' | |
| s.summary = 'A Ruby Micro Gem for use Paperclip with ActiveRecordSchema and S3.' | |
| s.version = '0.0.2' | |
| s.platform = Gem::Platform::RUBY | |
| s.files = %w(paperclip_schema.rb) | |
| s.require_path = '.' | |
| s.author = 'Maurizio Casimirri' |
| #!/usr/bin/env ruby -wKU | |
| # Create and open file bundle for Textmate 2 | |
| # Key equivalent: @N | |
| $: << ENV['TM_SUPPORT_PATH'] + '/lib' | |
| require "ui" | |
| filename = TextMate::UI.request_string(:title => "Create and open file", | |
| :prompt => "Enter the file name", |
| Gem::Specification.new do |s| | |
| s.name = 'google_fonts_helper' | |
| s.summary = 'Google fonts helper for Ruby on Rails' | |
| s.version = '0.0.1' | |
| s.platform = Gem::Platform::RUBY | |
| s.files = %w(google_fonts_helper.rb) | |
| s.require_path = '.' | |
| s.author = 'Maurizio Casimirri' |
| module StaticMapHelper | |
| def static_map_for(location, options = {}) | |
| params = { | |
| :center => [location.lat, location.lng].join(","), | |
| :zoom => 15, | |
| :size => "300x300", | |
| :markers => [location.lat, location.lng].join(","), | |
| :sensor => true | |
| }.merge(options) |
| <VirtualHost *:80> | |
| ServerAdmin webmaster@localhost | |
| DocumentRoot /var/www | |
| <Directory /> | |
| Options FollowSymLinks | |
| AllowOverride None | |
| </Directory> | |
| <Directory /var/www/> | |
| Options Indexes FollowSymLinks MultiViews |
| #!/bin/bash | |
| MyUSER="root" # USERNAME | |
| MyPASS="spigola2" # PASSWORD | |
| WpMySqlUser="wpuser" | |
| WpMySqlPass="spigola2" | |
| MyHOST="localhost" # Hostname |