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. |
The Laracasts PHPStorm theme.
https://www.dropbox.com/s/f4l3qc2falnvq61/laracasts_theme_updated.icls
(Add to ~/Library/Preferences/WebIde80/colors
on Mac.)
<?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); |
- 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' ): |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
Rails' use of strict naming conventions means a lot of core code SHOULD be in the same format whoever writes it? It could be written by a friend, colleague or a computer... it shouldn't matter because the same Rails rules apply to everyone.
This means that Rails can actually do some tasks for you! It can actually build things and write code on your behalf...
Coming from another language like PHP, this can seem like magic.
By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk.
This process is outlined at the Nginx ngx_http_fastcgi_module page manual page.