⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Keyboard shortcuts for browsing pages of lists | |
(function($) { | |
$(document).keydown(handleKey); | |
function handleKey(e) { | |
var left_arrow = 37; | |
var right_arrow = 39; | |
if (e.target.nodeName == 'BODY' || e.target.nodeName == 'HTML') { | |
if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) { | |
var code = e.which; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
12306 Auto Query => A javascript snippet to help you book tickets online. | |
Copyright (C) 2011-2012 Jingqin Lynn | |
Includes jQuery | |
Copyright 2011, John Resig | |
Dual licensed under the MIT or GPL Version 2 licenses. | |
http://jquery.org/license | |
Includes Sizzle.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem "eventmachine", "0.12.10" | |
gem "rack" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dump all databases once every 24 hours | |
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz | |
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night) | |
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze" | |
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet" | |
# re-index all databases once a week | |
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# note: MySQL_maintenance.pl can be obtained from http://danbuettner.net/mysql-tools/ | |
# check, optimise and repair MySQL databases (extended check on Sunday, quick every other day) | |
15 3 * * 0 root nice -n 19 /usr/local/sbin/MySQL_maintenance.pl --check-type=extended --optimize --repair --exclude-dbs=information_schema | |
15 3 * * 1-6 root nice -n 19 /usr/local/sbin/MySQL_maintenance.pl --check-type=quick --optimize --repair --exclude-dbs=information_schema > /dev/null | |
# dump all mysql databases once every 24 hours | |
15 4 * * * root nice -n 19 mysqldump --opt --all-databases --allow-keywords | gzip -9 > /var/local/backup/mysql/mysql_all.sql.gz |
Notes:
- Instructions written for CentOS 6.3
- Change, me, myhost, myip etc. to your username, hostname, ip address and so on.
- Run all commands as root unless otherwise directed.
- You might want to look at mounting /var and /home on separate partitions.
- I've just allowed all members of the wheel group to operate as root. This is the height of laziness and highlights the fact that I'm just a developer that's stolen a sysadmin's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRANT CONNECT ON DATABASE $dbName TO $user; | |
GRANT USAGE ON SCHEMA $schema TO $user; | |
GRANT SELECT ON ALL TABLES IN SCHEMA $schema TO $user; | |
Default privileges | |
ALTER DEFAULT PRIVILEGES IN SCHEMA $schema | |
GRANT SELECT ON TABLES TO $user; | |
see more at http://www.postgresql.org/docs/9.0/static/sql-alterdefaultprivileges.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- DEPRECATED GIST | |
-- **** Moved to a repo: https://github.com/imperialwicket/postgresql-time-series-table-partitions **** | |
-- | |
-- You should check the repository, this gist won't receive updates. | |
-- | |
-- | |
-- | |
-- | |
-- |
OlderNewer