Skip to content

Instantly share code, notes, and snippets.

View Genkilabs's full-sized avatar
😸
Writing software...

Alex Genkilabs

😸
Writing software...
  • Adept Mobile
  • Colorado
View GitHub Profile
@Genkilabs
Genkilabs / application.js
Last active November 18, 2017 11:16
Bootstrap 3 modals in Rails 4 confirms using bootstrap3-dialog JS plugin
//= require jquery
//= require jquery_ujs
//= require_tree .
// ^ I am assuming that bootstrap3-dialog is in the tree
//GLOBAL JQuery Functaionality
$(function(){
/*** CONFIRM MODAL OVERRIDE ***/
//override the use of js alert on confirms
@Genkilabs
Genkilabs / autosavable.js
Last active January 3, 2016 03:49
Debounced Autosave for EmberJS using 1.2.0-beta.4 and EmberData 1.0.0-beta.4+canary.3993001d with hooks for pacifier from http://ricostacruz.com/nprogress
// Debounced autosave for Ember.js
// Original code by Mitch Lloyd http://gaslight.co/blog/?author=mitchlloyd
// updated from http://gaslight.co/blog/an-autosave-pattern-for-ember-and-ember-data
// repo at https://github.com/gaslight/ember-autosaving
// Changed to work with latest Ember Data as of 2013-12-16 by Genkilabs
// Includes hooks for pacifier from http://ricostacruz.com/nprogress
// NOTE: This requires a 2 part install in which the controller and any models it loads have the corresponding mixin
// This is how long we will wait on a form before saving. I like to put this in App.AUTOSAVE_DELAY
var AUTOSAVE_DELAY = 1500
@Genkilabs
Genkilabs / autocomplete.js.coffee
Created February 20, 2012 19:39
Pass additional parameters into jQueryUI autocomplete widget in rails 3.1 coffeescript
#turn on our autocompletes if there are any
jQuery ->
if $('#user_autocomplete').length
index = 1
$('#user_autocomplete').autocomplete
source: (request, response) ->
#add our custom index parameter to the call
request["index"] = index++
#make our request and handle the response as normal
$.ajax(