1. Stop using .innerHTML = '';
when removing children to a DOM element.
On modern browsers it seems to be about 400× (!!) slower than this DOM-friendly method:
while (el.firstChild)
el.removeChild(el.firstChild);
Postgres provides us several options to do backup just like we want. I’ve tried several strategies in the past, and here is the one I stick to now, for both its simplicity and efficiency.
Backup your database with:
# This is using Postgres custom format
pg_dump -Fc dbname > filename
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
ZIP,LAT,LNG | |
00601,18.180555, -66.749961 | |
00602,18.361945, -67.175597 | |
00603,18.455183, -67.119887 | |
00606,18.158345, -66.932911 | |
00610,18.295366, -67.125135 | |
00612,18.402253, -66.711397 | |
00616,18.420412, -66.671979 | |
00617,18.445147, -66.559696 |
<?php | |
/** | |
* Plugin Name: Multiple Roles per User | |
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful. | |
* Version: 1 | |
* Author: nikolov.tmw | |
* Author URI: http://paiyakdev.com/ | |
* License: GPL2 | |
*/ | |
/* |
/**************************************************************************** | |
*** Gravity styles *** | |
****************************************************************************/ | |
/*Form Body | |
contains the main form content*/ | |
body .gform_wrapper .gform_body {border: 1px solid red} | |
/*Form List Container | |
unordered list used to structure all of the form elements*/ |
/* -------------------------------------------------------- */ | |
/* IDX BROKER WIDGET RESETS */ | |
/* -------------------------------------------------------- */ | |
/* SHOWCASE WIDGET | |
----------------------------------------------------------- */ | |
.IDX-showcaseTable { | |
max-width: 100% !important; | |
} | |
.IDX-showcaseCell { |
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
Backbone.serverSync = Backbone.sync; | |
Backbone.pingUrl = '/Ping'; | |
Backbone.localID = function() { | |
var localID = (localStorage.localID ? parseInt(localStorage.localID) : 0); | |
localID++; | |
localStorage.localID = localID.toString() | |
return -localID; | |
} |