Skip to content

Instantly share code, notes, and snippets.

View asgeo1's full-sized avatar

Adam George asgeo1

View GitHub Profile
@asgeo1
asgeo1 / jquery.doubletap.js
Created January 21, 2012 14:35
doubletap event for jquery
//based on blog post that I saw here: http://www.sanraul.com/2010/08/01/implementing-doubletap-on-iphones-and-ipads/
(function($){
$.fn.doubletap = function(fn) {
return fn ? this.bind('doubletap', fn) : this.trigger('doubletap');
};
$.attrFn.doubletap = true;
$.event.special.doubletap = {
setup: function(data, namespaces){
@asgeo1
asgeo1 / README.md
Last active February 27, 2018 14:58
Alternative to backbone-offline.

Works with nested backbone models. Can sync the whole nested collection at once, or just an individual model.

This is just something I hacked together. The goal was to replace it with an updated backbone-offline once that library supports nested models.

Requires:

  • backbone 0.9.10
  • backbone.localStorage 1.0
  • backbone-relational 0.7.0

Probably requires changes for a newer backbone or backbone-relational.

Stored format

Qty over Unit price
1** 30
5 20
8 10

Display format

Quantity Unit price (each)
@asgeo1
asgeo1 / cordova.ios.js
Created April 11, 2013 06:39
Cordova 2.5 - but with cordova/channel and cordova/utils modules in the correct order (so it can be used with RequireJS)
// Platform: ios
// commit f50d20a87431c79a54572263729461883f611a53
// File generated at :: Tue Feb 26 2013 14:26:19 GMT-0800 (PST)
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
@asgeo1
asgeo1 / hax0r.vim
Created January 5, 2012 23:54 — forked from scrooloose/hax0r.vim
NERDTree custom mappings to make i and s reuse existing windows
let g:NERDTreeCustomReuseWindows = '1'
call NERDTreeAddKeyMap({
\ 'key': 'w',
\ 'scope': 'all',
\ 'callback': 'NERDTreeCustomToggleReuse',
\ 'quickhelpText': 'Toggle use existing windows' })
function! NERDTreeCustomToggleReuse()
let g:NERDTreeCustomReuseWindows = g:NERDTreeCustomReuseWindows ? 0 : 1

Setup Rails application production environment on Ubuntu

Add deploy user

ssh root@YOURDOMAIN
adduser deploy
# set default editor for visudo to vim 
update-alternatives --set editor /usr/bin/vim.tiny
visudo # Add deploy ALL=(ALL) ALL
@asgeo1
asgeo1 / refinery-jquery-ui-compatibility.css.scss
Last active August 29, 2015 14:04
Stylesheet which corrects several issues with RefineryCMS when the jquery-ui stylesheet is included
/*
* Styles so Refinery admin is compatible with jquery-ui
*/
.refinery-ui-corner-all {
border: none;
}
#menu {
&.ui-corner-all {