Skip to content

Instantly share code, notes, and snippets.

@nwcell
nwcell / auto_save.coffee
Last active August 29, 2015 13:57
Django Pieces for Autosave Feature
# Debounce to keep too many events from firing
# For notes: http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
debounce = (func, threshold, execAsap) ->
timeout = null
(args...) ->
obj = this
delayed = ->
func.apply(obj, args) unless execAsap
timeout = null
if timeout
@nwcell
nwcell / 0_reuse_code.js
Created April 5, 2014 05:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nwcell
nwcell / tasy_trouble.py
Created April 5, 2014 08:58
Trouble with TasyPie
class Provider(models.Model):
name = models.CharField(max_length=50)
class Meta:
verbose_name_plural = "Providers"
def __unicode__(self):
return self.name
def get_absolute_url(self):
@nwcell
nwcell / render_fix.css
Created April 23, 2014 16:34
If you website isn't rendering elements (fonts, images, etc.) until you force a repaint by resizing the browser window, then you are running into an obscure chrome bug. People have found the issue, but it has showed up and disappeared several times on some of my websites so far. This hack will safely keep your stuff rendered properly. Just run i…
body
{
-webkit-animation-duration: 0.1s;
-webkit-animation-name: fontfix;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: linear;
-webkit-animation-delay: 0.1s;
}
@-webkit-keyframes fontfix{
@nwcell
nwcell / README.md
Last active January 13, 2016 16:29
Evernote Tip: Filter for Incomplete Reminders

##Incomplete Reminders Search:

The script is pretty basic and goes like the following:

-reminderDoneTime:00011231 reminderOrder:00011231

###How it works To start with, reminderDoneTime:[datetime] returns true if it finds a date that is on or after what is listed. We can invert this by prepending the query with a -. As a result, -reminderDoneTime:[datetime] returns true if the note either has no timestamp or if it has a date before [datetime].

@nwcell
nwcell / .zshrc
Last active February 26, 2019 16:12
Oh My .zshrc File
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="$PATH:/Applications/Sublime Text.app/Contents/SharedSupport/bin"
export PATH="$PATH:$HOME/.bin"
export PATH="/usr/local/opt/gettext/bin:$PATH"
export PATH="/usr/local/opt/openssl/bin:$PATH"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
export PATH="/usr/local/opt/node@10/bin:$PATH"