Skip to content

Instantly share code, notes, and snippets.

View danieljohnmorris's full-sized avatar
😀

Daniel Morris danieljohnmorris

😀
View GitHub Profile
@danieljohnmorris
danieljohnmorris / email.html
Created September 16, 2014 18:56
desk replies - old
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" style="color:#333; font-family:Arial; font-size:14px; line-height:150%; text-align:left;">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
@danieljohnmorris
danieljohnmorris / ajax.js
Last active August 29, 2015 14:13
Ajax apply jquery
$.ajax({
type: "POST",
url: "https://www.sofarsounds.com/competitions/jessie-j/apply",
data: { _method:'POST' },
success: function(msg) {
console.log("Request complete");
}
});
@danieljohnmorris
danieljohnmorris / pg_gem_fix
Created February 23, 2015 15:47
pg gem yosemite / mavericks
# WORKSSSS!
bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
# DOESNT INCLUDE INTO BUNDLE
#gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
page.should render_template(:index)
#Redirecting
page.should redirect_to(movies_path)
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@danieljohnmorris
danieljohnmorris / fb_pixels.html
Last active August 29, 2015 14:27
FB Conversion Pixel Ads
<!-- Facebook Conversion Code for Signup success - Fans of Alumni - Website Clicks -->
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;