Skip to content

Instantly share code, notes, and snippets.

View jaredatron's full-sized avatar

Jared Grippe jaredatron

View GitHub Profile
class Regexp
def to_proc
lambda {|arg| match(arg)}
endhttp://gist.github.com/images/modules/gist/save_button.png
end
puts /whatever/.to_proc.call(5,6)
# => untitled:3: warning: multiple values for a block parameter (2 for 1)
<html>
<head>
<title>JavaScript Test</title>
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
function init() {
$.getJSON(
"http://127.0.0.1:3000/",
function(data) {
alert('hello world');
<html>
<head>
<title>JavaScript Test</title>
<script src="/test/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$.getJSON(
"http://127.0.0.1:3000/",
function(data) {
alert('hello world');
<html>
<head>
<title>JavaScript Test</title>
<script src="/test/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
console.log("I'm JavaScript and I'm getting ready to fail but not let you know why.");
$.getJSON(
"http://127.0.0.1:3000/",
function(data) {
diff --git a/features/step_definitions/auth_steps.rb b/features/step_definitions/auth_steps.rb
index aac8d15..7f79dd2 100644
--- a/features/step_definitions/auth_steps.rb
+++ b/features/step_definitions/auth_steps.rb
@@ -3,5 +3,5 @@ Given /^I am not logged in$/ do
end
Given /^I have an account with email "([^"]*)"$/ do |email|
- User.find(:first, :conditions => {:email => email})
+ User.find_by_email(email)
diff --git a/features/step_definitions/auth_steps.rb b/features/step_definitions/auth_steps.rb
index aac8d15..7f79dd2 100644
--- a/features/step_definitions/auth_steps.rb
+++ b/features/step_definitions/auth_steps.rb
@@ -3,5 +3,5 @@ Given /^I am not logged in$/ do
end
Given /^I have an account with email "([^"]*)"$/ do |email|
- User.find(:first, :conditions => {:email => email})
+ User.find_by_email(email)
App.User = Ember.Object.extend({
email: null,
name: {
first: null,
last: null,
location: null,
persistLogin: false,
roles: []
},
fullName: function() {
@jaredatron
jaredatron / git-branch-details.rb
Created April 22, 2016 19:14 — forked from pariser/git-branch-details.rb
git-branch-details
We couldn’t find that file to show.
@jaredatron
jaredatron / gists_modeling.sql
Last active May 11, 2019 17:48
Data modeling for gist clone service
CREATE EXTENSION IF NOT EXISTS uuid-ossp;
CREATE TABLE IF NOT EXISTS users (
user_id uuid PRIMARY KEY DEFAULT uuid_generate_v1mc(),
email text UNIQUE,
password_hash text,
username text,
avatar_url text
);