Legend:
- ✏️ method changes
this
. - 🔒 method does not change
this
.
Array<T>.prototype.*
:
concat(...items: Array): T[]
🔒 ES3
### --- 04/18/18 | elementaryOS --- ### | |
alias gc='git commit -am' | |
alias lsd='ls -la' | |
alias gco='git co' | |
alias gs="git status" | |
# ls aliases | |
alias ll='ls -alF' | |
alias la='ls -A' |
class Quill::BaseModel | |
include ActiveModel::Model | |
attr_accessor :id, :access_token | |
def self.special_attrs *attrs | |
return @special_attrs unless attrs.any? | |
@special_attrs = attrs | |
end | |
def self.inherited subclass |
# ls aliases | |
alias ll='ls -alF' | |
alias la='ls -A' | |
alias l='ls -CF' | |
alias d="ls -G" | |
alias lsd="ls -lahG" | |
# Add an "alert" alias for long running commands. Use like so: | |
# sleep 10; alert | |
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' |
require "bundler/capistrano" | |
server "96.126.100.112", :web, :app, :db, primary: true | |
set :application, "capteste" | |
set :user, "deployer" | |
set :deploy_to, "/home/#{user}/apps/#{application}" | |
set :deploy_via, :remote_cache | |
set :use_sudo, false | |
set :port, "3030" |
set :application, "sprai" | |
# RVM integration | |
# http://beginrescueend.com/integration/capistrano/ | |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) | |
require "rvm/capistrano" | |
set :rvm_ruby_string, "1.9.2-p290" | |
set :rvm_type, :user | |
# Bundler integration (bundle install) |
class Array | |
def self.toy(n=10, &block) | |
block_given? ? Array.new(n,&block) : Array.new(n) {|i| i+1} | |
end | |
end | |
class Hash | |
def self.toy(n=10) | |
Hash[Array.toy(n).zip(Array.toy(n){|c| (96+(c+1)).chr})] | |
end |
# app/models/my_model.rb | |
module MyApp | |
module Model | |
def self.included(base) | |
base.send :include, Mongoid::Document | |
base.send :include, Mongoid::Timestamps | |
base.send :include, ActiveAdmin::Mongoid::Patches | |
end | |
end |
# CLOSURES IN RUBY Paul Cantrell http://innig.net | |
# Email: username "cantrell", domain name "pobox.com" | |
# I recommend executing this file, then reading it alongside its output. | |
# | |
# Alteratively, you can give yourself a sort of Ruby test by deleting all the comments, | |
# then trying to guess the output of the code! | |
# A closure is a block of code which meets three criteria: | |
# |