^ beginning of string
$ end of string
. any character (wildcard)
* match 0 or more times
+ match 1 or more times
? match 0 or 1 time
| alternative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Item: | |
def __init__(self, width, height, quantity): | |
self.width = width | |
self.height = height | |
self.quantity = quantity | |
class MaterialSheet: | |
def __init__(self, width, height): | |
self.width = width | |
self.height = height |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: http://technet.microsoft.com/en-us/library/bb490894.aspx | |
:: F7 = history | |
:: Alt+F7 = history -c | |
:: F8 = Ctrl+R | |
:: Use & to run multiple commands e.g.: command1 & command2 | |
:: | |
:: 1. Go to your Windows folder and find regedit.exe | |
:: 2. Head over to: | |
:: HKEY_LOCAL_MACHINE\Software\Microsoft\Command | |
:: or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
call plug#begin('~/.vim/plugged') | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'danilo-augusto/vim-afterglow' | |
Plug 'thoughtbot/vim-rspec' | |
Plug 'tomasr/molokai' | |
Plug 'tpope/vim-commentary' | |
Plug 'tpope/vim-dispatch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
call plug#begin('~/.vim/plugged') | |
Plug 'MaxMEllon/vim-jsx-pretty' | |
Plug 'danilo-augusto/vim-afterglow' | |
Plug 'dense-analysis/ale' | |
Plug 'jparise/vim-graphql' | |
Plug 'junegunn/fzf', { 'do': './install --bin' } | |
Plug 'junegunn/fzf.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|tmp\|coverage' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
"--- Vundle | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
map <Leader>t :call RunCurrentSpecFile()<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MemberUniquelizer | |
refine Array do | |
# makes each member within an array | |
# unique by appending a unique number | |
def uniquelize(ary = self) | |
ary.map { |member| format_member(member) } | |
.flatten | |
.uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Node Class | |
using MemberUniquelizer | |
class Node < HashWithIndifferentAccess | |
attr_reader :id | |
# constructs a new hash based on injected | |
# headers and attributes | |
def self.from_rows(headers, attributes) | |
headers = uniqualize_headers(headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming you champioin your other DB connection with a class. | |
module OtherDb | |
class Connection < ActiveRecord::Base | |
establish_connection :other_db | |
self.abstract_class = true | |
end | |
end | |
# Alway use the connection for other/legacy connections. |
NewerOlder