Easy to remember, easy to forget.
It's nice to be able to run subl in a terminal.
Easy to remember, easy to forget.
It's nice to be able to run subl in a terminal.
| #Open | |
| /etc/apt/sources.list | |
| #Add repos | |
| deb http://ppa.launchpad.net/mozillateam/thunderbird-next/ubuntu trusty main | |
| deb-src http://ppa.launchpad.net/mozillateam/thunderbird-next/ubuntu trusty main | |
| #Add repos key | |
| sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9D1A0061 |
| #!/bin/bash | |
| # Following the guide found at this page | |
| # http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html | |
| echo "\r\nUpdating system ...\r\n" | |
| sudo apt-get update | |
| # Create folder to place selenium in |
I'm hunting for the best solution on how to handle keeping large sets of DB records "sorted" in a performant manner.
Most of us have work on projects at some point where we have needed to have ordered lists of objects. Whether it be a to-do list sorted by priority, or a list of documents that a user can sort in whatever order they want.
A traditional approach for this on a Rails project is to use something like the acts_as_list gem, or something similar. These systems typically add some sort of "postion" or "sort order" column to each record, which is then used when querying out the records in a traditional order by position SQL query.
This approach seems to work fine for smaller datasets, but can be hard to manage on large data sets with hundreds (or thousands) of records needing to be sorted. Changing the sort position of even a single object will require updating every single record in the database that is in the same sort group. This requires potentially thousands of wri
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| //Use timeout to ignore changes events while object initialization. | |
| setTimeout(function() { | |
| var keys = Object.keys($scope.news); | |
| console.log('Keys [%o]', keys); | |
| for(var key in keys){ | |
| console.log('Watch property [%s]', keys[key]); | |
| var f = function(property) { | |
| console.log('Property [%o]', property); | |
| $scope.$watch("news."+property, | |
| function (value) { |
| Clients | |
| http://www.sqltabs.com/ - cool postgresql client with chats drawing and sharing | |
| http://dbeaver.jkiss.org/ - universal client | |
| Backup DB | |
| #!/bin/bash | |
| #MySQL Dump | |
| mysqldump DBNAME > dump-$( date '+%Y-%m-%d_%H-%M-%S' ).sql --single-transaction -u USERNAME -pPASSWORD | |
| #PostgreSQL Dump |