$ rails g model User
belongs_to
has_one
# Classes are the only place CoffeeScript generates named functions. | |
# This might seem messy, but the extra wrapping is necessary in order | |
# to have consistent behavior in IE. See the FAQ for more details: | |
# https://github.com/jashkenas/coffee-script/wiki/FAQ | |
class square | |
constructor: (x) -> return x * x # constructors require an explicit return | |
console.log square 5 # 25 | |
console.log square.name # square |
<%= search_form_for @q, url: production_status_changes_path, class: 'form-inline' do |f| %> | |
<%= f.label 'Create At' %> | |
<%= f.search_field :created_at_beginning_of_day, class: 'form-control input-sm', 'datepicker' => true %> | |
<%= f.search_field :created_at_end_of_day_lt, class: 'form-control input-sm', 'datepicker' => true %> | |
<% end %> |
config.json | |
reading-image.png |
#!/bin/bash | |
HOSTSFILE="/etc/hosts" | |
BAKFILE="$HOSTSFILE.bak" | |
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$" | |
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" | |
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$" | |
backup() | |
{ |
if (!window.location.origin) { // Some browsers (mainly IE) does not have this property, so we need to build it manually... | |
window.location.origin = window.location.protocol + '//' + window.location.hostname + (window.location.port ? (':' + window.location.port) : ''); | |
} |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
this.collection.comparator = 'id'; | |
this.collection.sort(); | |
this.collection.trigger('reset'); |