Today I learned about LIMIT and OFFSET in PostgreSQL, which differs slightly from its MySQL cousin.
Category Archives: Programming
jQuery document ready
I’m always forgetting the syntax for the jQuery ‘document ready’ event. Which is an embarrassment because it’s so simple:
$( document ).ready( handler ) $().ready( handler ) (this is not recommended) $( handler )
I used to use the $( document ).ready( handler ) syntax, but starting today I use the $( handler ) syntax.
Datepicker for Bootstrap
Today I used the Datepicker for Bootstrap. I grabbed the files from the CDN.
psql show tables
I wanted to know what the analogue for MySQL ‘show tables’ was in PostgreSQL, and I found the answer, use the information_schema, here:
mysql: SHOW TABLES postgresql: \d postgresql: SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'; mysql: SHOW DATABASES postgresql: \l postgresql: SELECT datname FROM pg_database; mysql: SHOW COLUMNS postgresql: \d table postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table'; mysql: DESCRIBE TABLE postgresql: \d+ table postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';
HTML Singleton Tags
Found a list of HTML Singleton Tags, the tags that don’t require a closing tag.
PHP min
PHP call_user_func_array
Used call_user_func_array today, in Slib…
PHP define() vs const
Reading about define() vs const…
PHP htmlentities encoding
I needed to know my options for htmlentities character encoding support today. The PHP documentation had everything I needed to know. I ended up adding these constants to my code:
const UTF8_ENCODING = 'UTF-8'; const ASCII_ENCODING = 'ISO-8859-1';
Newlines…
A great article on Wikipedia about Newlines…