Skip to content

Instantly share code, notes, and snippets.

View danieljohnmorris's full-sized avatar
😀

Daniel Morris danieljohnmorris

😀
View GitHub Profile
@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;
#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)
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
page.should render_template(:index)
#Redirecting
page.should redirect_to(movies_path)
@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
@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 / 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 / email.html
Created September 16, 2014 18:55
desk replies - new theme
{% assign emails = case.emails %}
{% assign threadlength = emails.size|minus:1 %}
{% for email in emails reversed %}
{% if forloop.first %}
{{email.new_html}}
{% if email.agent %}
{% if email.agent.signature %}
@danieljohnmorris
danieljohnmorris / .bash_profile
Created April 11, 2014 14:35
Rails deploy scripts
# This goes in user root dir, ie ~
# So you can just call
alias deploy=./deploy.sh
alias deploy_ci=./deploy_ci.sh
alias deploy_live=./deploy_live.sh
# create new project
phonegap create my-app
# requires...
# - android sdk
# - brew install ant
# - adding tools and platform-tools to path
#PATH=$PATH:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/tools # android command
#PATH=$PATH:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools # adb command