abbr | expanded |
---|---|
m50 | margin: 50px |
p20 | padding: 20px |
m50-20 | margin: 50px 20px |
m0-auto | margin: 0 auto |
w20 | width: 20px |
w20p | width: 20% |
; Ported from https://www.autohotkey.com/board/topic/1257-half-qwerty-one-handed-typing/ | |
; Many thanks to Chris for helping me out with this script. | |
mirror_1 = 0 | |
mirror_2 = 9 | |
mirror_3 = 8 | |
mirror_4 = 7 | |
mirror_5 = 6 | |
mirror_q = p | |
mirror_w = o |
class Recipe < ApplicationRecord | |
belongs_to :user | |
end | |
class User < ApplicationRecord | |
end |
gem 'turbolinks' | |
gem 'jquery-turbolinks' |
(The blockquote style does not look so well so I just pasted directly, but these are all quoted from the links in the bottom of this page)
You should not implement to_str
unless your object acts like a string, rather than just having a string representation. The only core class that implements to_str
is String itself.
[to_i and to_s] are not particularly strict: if an object has some kind of decent representation as a string, for example, it will probably have a to_s method… [to_int and to_str] are strict conversion functions: you implement them only if you object can naturally be used every place a string or an integer could be used.
to_str
is used by methods such as String#concat
to convert their arguments to a string. Unlike to_s, which is supported by almost all classes, to_str
is normally implemented only by those classes that act like strings. Of the built-in classes, only Exception
and String
implement to_str
%span.css3_loader<
%figure>
%figure>
%figure>
%figure>
%figure>
class Subscription < Struct.new(:id, :type) | |
attr_reader :allow_export | |
alias_method :allow_export?, :allow_export | |
def initialize(id, type) | |
super | |
@allow_export = id.present? && type == 'business' | |
end | |
end |
module AppName | |
class UserSubdomainConstraint | |
def self.matches?( request ) | |
request.subdomain.present? && request.subdomain != 'www' | |
end | |
end | |
end | |
AppName::Application.routes.draw do | |
devise_for :users |
class Customer... | |
private TemporalCollection addresses = new SingleTemporalCollection(); | |
public Address getAddress(MfDate date) { | |
return (Address) addresses.get(date); | |
} | |
public Address getAddress() { | |
return getAddress(MfDate.today()); | |
} | |
public void putAddress(MfDate date, Address value) { | |
addresses.put(date, value); |
Array.prototype.shuffle = function() { | |
var len = this.length; | |
var i = len; | |
while (i--) { | |
var p = parseInt(Math.random()*len); | |
var t = this[i]; | |
this[i] = this[p]; | |
this[p] = t; | |
} | |
}; |