Skip to content

Instantly share code, notes, and snippets.

View sgulics's full-sized avatar

Steve Gulics sgulics

  • New Jersey, USA
View GitHub Profile
# This should be triggered through a cron job at 6:15 PM on week days.
# Example cron: 15 18 * * 1,2,3,4,5 cd ~/code/jury_duty && ~/.rbenv/shims/ruby call.rb >> ~/code/jury_duty/call-log.txt 2>&1
# It uses Twilio to make a call based on TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_PHONE.
# It calls the JURY_PHONE, transcribes it, looks for JURER_NUMBER and texts the result to PERSONAL_PHONE.
require "rubygems"
require "bundler/setup"
Bundler.require(:default)
Dotenv.load
@x3ro
x3ro / stateful_popover.js
Created July 16, 2012 11:07
StatefulPopover for Twitter Bootstrap
!function ($) {
"use strict"; // jshint ;_;
/* POPOVER PUBLIC CLASS DEFINITION
* =============================== */
var StatefulPopover = function ( element, options ) {
this.contentWasSet = false
@innotekservices
innotekservices / jquery.spin.js
Created October 16, 2011 02:39
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@sgulics
sgulics / jquery_validate_steps.rb
Created June 30, 2011 18:13
Cucumber Step definitions for testing a form that uses jquery's validator plugin
# goes in features/step_definitions
Then /^I should see the "([^"]*)" error for "([^"]*)"$/ do |error, label|
field = find_field(label)
html_label = find("label[for=#{field[:id]}][class=error]")
html_label.text.should eql(error)
end
Then /^I should not see errors for "([^"]*)"$/ do |label|
field = find_field(label)
lambda {find("label[for=#{field[:id]}][class=error]")}.should raise_error(Capybara::ElementNotFound)