Skip to content

Instantly share code, notes, and snippets.

Jared Grippe deadlyicon

View GitHub Profile
@deadlyicon
deadlyicon / gists_modeling.sql
Last active May 11, 2019
Data modeling for gist clone service
View gists_modeling.sql
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
);
We couldn’t find that file to show.
View gist:8512370
App.User = Ember.Object.extend({
email: null,
name: {
first: null,
last: null,
location: null,
persistLogin: false,
roles: []
},
fullName: function() {
View thing.diff
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)
View gist:669553
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)
View gist:206450
<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) {
View gist:206448
<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');
View gist:206446
<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');
View gist:107173
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)
You can’t perform that action at this time.