- Install fish via Brew
- Optionally install Oh My Fish!
- Add fish to known shells
- Set default shell to fish
brew install fish
curl -L https://get.oh-my.fish | fish
<?php | |
// check if the flexible content field has rows of data | |
if( have_rows('flexible_content') ): | |
// loop through the rows of data | |
while ( have_rows('flexible_content') ) : the_row(); | |
//check current row layout | |
if( get_row_layout() == 'pricing' ): |
brew install fish
curl -L https://get.oh-my.fish | fish
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0" | |
xmlns:content="http://purl.org/rss/1.0/modules/content/" | |
xmlns:dsq="http://www.disqus.com/" | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:wp="http://wordpress.org/export/1.0/" | |
> | |
<channel> | |
<?php | |
error_reporting(0); |
The Laracasts PHPStorm theme.
https://www.dropbox.com/s/f4l3qc2falnvq61/laracasts_theme_updated.icls
(Add to ~/Library/Preferences/WebIde80/colors
on Mac.)
Command | Sample | Description |
---|---|---|
pipe | - | Liga a saida de um comando na entrada de outro |
&& | cmd && cmd | Executa um comando logo após o outro |
cat | cat | Duplica o conteúdo digitado (ctrl+d = sair) |
cat | cat file.txt | Lê um arquivo (ctrl+d = sair) |
cat | cat > file.txt | Cria um arquivo com o conteúdo digitado (ctrl+d = sair) |
cd my_heroku_app | |
# Make sure DB doesn't update on Heroku. This may be enough depending on your needs. | |
heroku maintenance:on | |
# Dump from Heroku. | |
heroku pg:pull DATABASE_URL heroku_dump | |
pg_dump heroku_dump -Fc > /tmp/db.dump # Fc for binary dump (otherwise the import will complain) | |
# Restore to Dokku. |
def weighted | |
a = [] | |
(1..60).each do |i| | |
a << { value: "HIGH_#{i}", weight: 5 } | |
end | |
(1..30).each do |i| | |
a << { value: "MID_#{i}", weight: 3 } | |
end | |
(1..15).each do |i| | |
a << { value: "LOW_#{i}", weight: 2 } |
// api/index.js | |
import Request from 'superagent' | |
export const getUser (userId) { | |
return Request | |
.get('/api/user/:userId'); | |
} |
# File: app/models/concerns/boolean_store_accessor.rb | |
# | |
# When we submit a form in order to update a model, a booelan/checkbox field is posted | |
# as '1' or '0', and if we are using ActiveRecord::Store, posted value is stored in | |
# database as '1' or '0'. By the help of this module, we store '1' and '0' | |
# values as `true` or `false`. | |
# | |
# Example usage: | |
# | |
# ``` |