- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
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)#!/usr/bin/env php | |
<?php | |
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page | |
set_time_limit(0); | |
$dir = $argv[1]; | |
$source = $argv[2]; | |
print_r($argv); | |
mkdir ($dir); | |
$src = file_get_contents($source); | |
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i'; |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
// CSS loader front-end | |
if( ! function_exists('theme_style_site')){ | |
function theme_style_site($var = ''){ | |
$url = base_url("assets/site/".$var); | |
return '<link rel="stylesheet" href="'.$url.'" >'; | |
} | |
} |
If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:
$ git config --global commit.gpgsign true
([OPTIONAL] every commit will now be signed)$ git config --global user.signingkey ABCDEF01
(where ABCDEF01
is the fingerprint of the key to use)$ git config --global alias.logs "log --show-signature"
(now available as $ git logs
)$ git config --global alias.cis "commit -S"
(optional if global signing is false)$ echo "Some content" >> example.txt
$ git add example.txt
$ git cis -m "This commit is signed by a GPG key."
(regular commit
will work if global signing is enabled)