Skip to content

Instantly share code, notes, and snippets.

View thomasv314's full-sized avatar

Thomas Vendetta thomasv314

View GitHub Profile
@thomasv314
thomasv314 / check.js
Created November 19, 2012 15:11 — forked from acidtib/check.js
$(document).ready( function() {
//If state and city match then provide id
$('#postcard_state'),
$('#postcard_city')
.bind('change', function (e) {
if( $('#postcard_state').val() == "Alabama" && $('#postcard_city').val() == "Abbeville city") {
$("#hidden_town_id").html("<input id='postcard_town_id' name='postcard[town_id]' type='hidden' value='1'>");
}
else if( $('#postcard_state').val() == "Alabama" && $('#postcard_city').val() == "Adamsville city") {
$("#hidden_town_id").html("<input id='postcard_town_id' name='postcard[town_id]' type='hidden' value='2'>");
@thomasv314
thomasv314 / gist:4196532
Created December 3, 2012 17:27 — forked from anonymous/gist:4196426
form validator
$(document).ready(function() {
jQuery.validator.addMethod("password", function(value, element) {
var isValid = value.length >= 6 && /\d/.test(value) && /[a-z]/i.test(value);
return isValid;
}, "Password must be at least 8 characters and must contain one number and one character.");
jQuery.validator.addMethod("inUse", function(value, element){
var email_exists = false;
$.ajax({
type: 'POST',
url: "checkEmail",
@thomasv314
thomasv314 / save.php
Created December 6, 2012 21:30 — forked from acidtib/save.php
<?php
include('lib/crane.php');
$token = "XXXXXXXXXXXXXXXXXXXXXXXX";
$api = "https://api.foursquare.com/v2";
$api_v = "20120321";
$userinfo = file_get_contents("https://api.foursquare.com/v2/users/self?oauth_token=".$token);
$decoded_userinfo = json_decode($userinfo, true);
$name = $decoded_userinfo;

Hi everyone, I'm Chris Wanstrath.

When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But then I took a few moments and thought, Wait, why? Why me? What am I supposed to say that's interesting? Something about Ruby, perhaps. Maybe the future of it. The future of something, at least. That sounds keynote-y.