###Index
| # Filters added to this controller apply to all controllers in the application. | |
| # Likewise, all the methods added will be available for all controllers. | |
| class ApplicationController < ActionController::Base | |
| helper :all # include all helpers, all the time | |
| protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
| # Scrub sensitive parameters from your log | |
| # filter_parameter_logging :password | |
| end |
| # Returns true if key exists in the given locale | |
| def key_exists?(key, locale) | |
| I18n.translate(key, :raise => true, :locale => locale) | |
| return true | |
| rescue I18n::MissingInterpolationArgument | |
| return true | |
| rescue I18n::MissingTranslationData | |
| return false | |
| end |
| start() | |
| { | |
| echo "Starting PostgreSQL server" | |
| pg_ctl -D /usr/local/var/postgres -l logfile start | |
| return | |
| } | |
| stop() | |
| { | |
| echo "Stopping PostgreSQL server" |
| SELECT CONCAT(table_schema, '.', table_name), | |
| CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
| CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
| CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
| CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
| ROUND(index_length / data_length, 2) idxfrac | |
| FROM information_schema.TABLES | |
| ORDER BY data_length + index_length DESC | |
| LIMIT 10; |
A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.
Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer.
In that case, the programmer isn't allowed to say x = true; that would be an invalid program.
The compiler will refuse to compile it, so we can't even run it.
| # Gandi subdomain DNS configuration for Mailgun validation | |
| # - Add the SPF record as TXT and SPF | |
| # - Suffix the DKIM record and `email` CNAME with the subdomain | |
| # ex: `mg.domain.com` | |
| mg 10800 IN CNAME mailgun.org. | |
| @ 10800 IN SPF "v=spf1 include:mailgun.org ~all" | |
| @ 10800 IN TXT "v=spf1 include:mailgun.org ~all" | |
| mailo._domainkey.mg 10800 IN TXT "k=rsa; p=MIG...QAB" | |
| email.mg 10800 IN CNAME mailgun.org. | |
| @ 10800 IN MX 10 mxa.mailgun.org. |
This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL
| { | |
| "emojis": [ | |
| {"emoji": "π©βπ©βπ§βπ§", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👧", "category": "p", "order": ""}, | |
| {"emoji": "π©βπ©βπ§βπ¦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👦", "category": "p", "order": ""}, | |
| {"emoji": "π©βπ©βπ¦βπ¦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "👩‍👩‍👦‍👦", "category": "p", "order": ""}, | |
| {"emoji": "π¨βπ©βπ§βπ§", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👧", "category": "p", "order": ""}, | |
| {"emoji": "π¨βπ©βπ§βπ¦", "name": "family_children", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👦", "category": "p", "order": ""}, | |
| {"emoji": "π¨βπ©βπ¦βπ¦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "👨&zw |