Skip to content

Instantly share code, notes, and snippets.

View esthervillars's full-sized avatar
😀

Esther Villars esthervillars

😀
  • Los Angeles, California
View GitHub Profile
@agarciadelrio
agarciadelrio / active_admin.js
Created April 17, 2012 20:30
Getting active_admin panels become collapsable with non-intrusive javascript with jquery
//....add this in app/assets/javascript/active_admin.js
$(function(){
// CONFIGURE PANELS COLLAPSER
$(".panel[data-panel]").each(function(){
var $this = $(this);
var $a = $("<a href='javascript:void(null)'>").on("click",function(event){
$(this).closest(".panel").find(".panel_contents").each(function(){
$(this).slideToggle();
});
$(this).closest("h3").each(function(){
@cfaulkingham
cfaulkingham / Select_to_Html.js
Created April 6, 2012 14:58
Convert Select ELement's to Dropdown group
/*!
* Convert <select> elements to Dropdown Group
*
* Author: John Rocela 2012 <[email protected]>
* Update: Fixed issue with selected showing value instead of text Colin Faulkingham <[email protected]> 2012
*/
jQuery(function($){
$('select').each(function(i, e){
if (!($(e).data('convert') == 'no')) {
$(e).hide().wrap('<div class="btn-group" id="select-group-' + i + '" />');
@amw
amw / database.yml
Created December 21, 2010 16:12
Standard rails database.yml with additional definition of live database
development:
adapter: mysql2 # must =~ /mysql/
database: adamDb # required
username: your_user
password: keep_secret
live:
ssh_user: # optional, use if live system user differs from your dev user
host: example.com # required, can be IP
adapter: mysql2 # must =~ /mysql/