Skip to content

Instantly share code, notes, and snippets.

@beeftornado
beeftornado / app.coffee
Created November 16, 2013 00:14
Very rough, unoptimized, but functional plugin to Gridster.js that adds some responsiveness.
# Example to initialize gridster and handle resizing
# Module grid settings
WIDGET_BASE_DIMENSIONS_X = WIDGET_DESKTOP_X = 140
WIDGET_BASE_DIMENSIONS_Y = 20
WIDGET_CONTAINER_SELECTOR = '.widget-view'
WIDGET_MOBILE_CUTOFF_WIDTH = 768
NUM_WIDGETS = 15
$ ->
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= FoundationLinkRenderer
super.try :html_safe
end
class FoundationLinkRenderer < LinkRenderer
protected
@soffes
soffes / perferences.json
Created August 22, 2012 05:35
My Sublime Text 2 config
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],
@scottwb
scottwb / README.md
Created February 6, 2012 20:45
Monkey patches for a couple Rails Mime::Type.parse bugs.

Rails Mime::Type.parse Patches

There are two Rails issues in it's handling of the HTTP Accept header which cause a number of spurious exception emails via Airbrake. I am encountering this on Rails 3.0.7. One of these is fixed in a later version of Rails, but for other reasons I can't upgrade right now. The other bug is still present in Rails 3.2 and in master at the time of this writing. This gist includes some monkey patches you can apply to fix these issues until such time that they are fixed in Rails properly.

Rails Issue #736

Issue #736 is that Rails does not correctly parse a q-value in an Accept header when there is only one content-type specified. For example:

Accept: text/html;q=0.9
@splorp
splorp / comment-blacklist-for-wordpress.md
Last active November 26, 2023 08:47
Comment Blacklist Keywords for WordPress

Comment Blacklist for WordPress

Notice!

As of November 5th, 2013, this version of the blacklist will no longer be updated.

I have migrated the project to a full Git repository in order to better track changes, bugs, and feedback.

Check out Comment Blacklist for WordPress on GitHub.

@avibryant
avibryant / loess.js
Created August 17, 2011 15:45
Loess smoothing
//adapted from the LoessInterpolator in org.apache.commons.math
function loess_pairs(pairs, bandwidth)
{
var xval = pairs.map(function(pair){return pair[0]});
var yval = pairs.map(function(pair){return pair[1]});
console.log(xval);
console.log(yval);
var res = loess(xval, yval, bandwidth);
console.log(res);
return xval.map(function(x,i){return [x, res[i]]});