Skip to content

Instantly share code, notes, and snippets.

$('a.next').on("click", function(){
var h3 = $("h3.active").text();
switch (h3) {
case "1. Select Your Organization":
$('div.your_org').children('h3').removeClass('active');
$('div.your_info').children('h3').addClass('active');
$('.your_info').slideDown('slow');
$('.your_org').slideUp('slow');
$('a.back').show();
class DowncaseEmailAddresses < ActiveRecord::Migration
def up
# Downcase all User emails
User.update_all('email = LOWER(email)')
# Downcase all ContactRequest emails
ContactRequest.update_all('email_address = LOWER(email_address)')
# Downcase all Reservation emails
Reservation.update_all('renter_email = LOWER(renter_email)')
(function($) {
var options = { show: false };
var $modal = $('#tag-modal');
// Initialize the modal
$modal.modal(options);
$modal.on('hidden', function() {
resetTagModal();
@iacutone
iacutone / .zshrc
Created September 19, 2013 00:26
ZSH
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="miloshadzic"
# Example aliases
@iacutone
iacutone / get.js
Last active December 28, 2015 19:49
jQuery.get('/organizations/' + org_id + '/free_quantities', function(data) {
$('.span2').on('change', function(){
var input_value = $('input.span2').val();
var total_quant_in_stock_diff = data.total_in_stock - input_value;
var total_available_free_for_user = data.free_available - input_value;
$('.show_quantity_left').append('<p class="quantity_left">('+ (total_quant_in_stock_diff) +' in stock)</p>');
if ((total_available_free_for_user + 1) > 0){
function removeCommas(str) {
return(str.replace(/,/g,''));
}
filterInt = function (value) {
if(/^\-?([0-9]+|Infinity)$/.test(value))
return Number(value);
return NaN;
}
@iacutone
iacutone / view.html.haml
Created January 6, 2014 04:00
add column heading to a table
:javascript
$('<th>'+ 'Total' +'</th>').insertAfter('th:last');
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.timemachine-backup</string>
<key>ProgramArguments</key>
<array>
<string>/Users/iacutone/scripts/timemachine-backup</string>
</array>
@iacutone
iacutone / counter.elm
Created May 15, 2017 20:39
Basic Elm App
import Html exposing (..)
import Html.Events exposing (onClick)
main: Program Never Model Msg
main =
Html.program
{ init = init
, view = view
, update = update
, subscriptions = subscriptions
require 'pry'
class Test
attr_reader :list
def initialize
@list = []
end
def mult(n, m)