Skip to content

Instantly share code, notes, and snippets.

View erobit's full-sized avatar

Eric Robitaille erobit

  • Sudbury, Ontario
View GitHub Profile
@erobit
erobit / errors
Created June 7, 2015 20:45
Controller
Error: permission_denied: Client doesn't have permission to access the desired data.
destroy called for FirebaseArray: https://MYURL.firebaseio.com/contacts
Error: Cannot call $add method on a destroyed $firebaseArray object
@erobit
erobit / incident.tmpl
Last active August 29, 2015 14:16
Incident manager concept
<tr id="incident_new" class="newi">
<td>
<span class="display-mode" style="display:none;"></span>
<input type="text" name="incident" class="edit-mode form-control" />
</td>
<td>
<span class="display-mode" style="display:none;"></span>
<select name="severity" class="edit-mode form-control">
{{#severity}}
<option value="{{value}}">{{text}}</option>
@erobit
erobit / scanner.js
Last active August 29, 2015 14:15
Input field scanner - to detect when input is entered extremely fast (i.e. by a scanner and not a human) and execute a callback method
function Scanner(id, opts, cb) {
this.robot = false;
this.count=0;
this.tick = 0;
this.total = 0;
this.avg = 0;
this.timer = null;
this.callback = arguments.length == 3 ? cb : opts;
this.opts = arguments.length == 2 ? {} : opts;
@erobit
erobit / gist:57bb3c2a617f26cd5e6e
Last active August 29, 2015 14:15
Input scanner
$(document).ready(function(){
function Scanner(el) {
this.robot = false;
this.count = 0;
this.tick = 0;
this.total = 0;
this.avg = 0;
this.scanThreshold = 10;
this.minChars = 25;
@erobit
erobit / reverse_id publisher fix
Created December 6, 2010 14:44
When the new public page is created (using the copy_page method) - the reverse_id was being set to None
from cms.exceptions import NoHomeFound
from cms.models.managers import PageManager, PagePermissionsPermissionManager
from cms.models.placeholdermodel import Placeholder
from cms.utils.helpers import reversion_register
from cms.utils.i18n import get_fallback_languages
from cms.utils.page import get_available_slug, check_title_slugs
from cms.utils.urlutils import urljoin
from datetime import datetime
from django.conf import settings
from django.contrib.sites.models import Site