Skip to content

Instantly share code, notes, and snippets.

View mrjamesriley's full-sized avatar

James Riley mrjamesriley

View GitHub Profile
@mrjamesriley
mrjamesriley / gist:6f12eb8c21584e641fd33f3a0eb461aa
Created December 16, 2016 12:06
Instagram issue with obtaining an API Oauth access token
Instagram issue with obtaining an API Oauth access token
Note that this is with a newly created, sandboxed app
1) send user to authorise at Instagram:
GET https://www.instagram.com/oauth/authorize?client_id=XXX&redirect_uri=http://localhost:3500&response_type=code
Instagram sends user to your redirect URL with: /?code=YYYY
2) post code to Instagram to exchange for access token:
curl -F 'client_id=XXXX' \
@mrjamesriley
mrjamesriley / 0_reuse_code.js
Created May 12, 2016 10:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mrjamesriley
mrjamesriley / basic-pokemon.go
Created October 22, 2015 05:56
Golang Basics: Starting Pokemon
// Simple program to experiment with a few of the basic features of Golang
// Here we replicate the commencement of the Pokemon Red/Blue journey
// From giving yourself a name, to selecting your first Pokemon
// Usage: go run pokemon.go
package main
import "fmt"
import "strconv"
// structs are the closest Go gets to a Class, grouping data to form records
diff --git a/app/controllers/shop/carts_controller.rb b/app/controllers/shop/carts_controller.rb
index caeda07..15a7b78 100644
--- a/app/controllers/shop/carts_controller.rb
+++ b/app/controllers/shop/carts_controller.rb
@@ -13,7 +13,7 @@ class Shop::CartsController < Shop::BaseController
# POST /cart
def create
@cart.update_items(params[:cart])
- redirect_back_to_cart
+ redirect_back_to_cart(basket_updated: 1)
diff --git a/app/controllers/shop/carts_controller.rb b/app/controllers/shop/carts_controller.rb
index caeda07..15a7b78 100644
--- a/app/controllers/shop/carts_controller.rb
+++ b/app/controllers/shop/carts_controller.rb
@@ -13,7 +13,7 @@ class Shop::CartsController < Shop::BaseController
# POST /cart
def create
@cart.update_items(params[:cart])
- redirect_back_to_cart
+ redirect_back_to_cart(basket_updated: 1)
diff --git a/laurel/templates/theme.liquid b/laurel/templates/theme.liquid
index 39db121..5da1698 100644
--- a/laurel/templates/theme.liquid
+++ b/laurel/templates/theme.liquid
@@ -95,6 +95,7 @@
<body class="{{ template }}" data-logo-width="160px" data-banner-width="788px">
+
<div class="container">
@mrjamesriley
mrjamesriley / gist:dc1ca1a7740547fa39f9
Created September 22, 2014 07:02
Simple Protractor example
// the conf.js
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['spec.js'],
rootElement: '.splashpage'
}
// the spec.js
var fs = require('fs');
Hey Hannah and Maria! Here's some links that I'd more than recommend you check out (couldn't fit in a tweet):
https://www.codeschool.com - probably the single best video based web dev learning site
http://teamtreehouse.com - another great video based learning site, aimed more at beginners
http://jsfiddle.net - as mentioned on Wednesday, great online playground
https://developer.mozilla.org/en-US/ - large knowledge base of all things web dev
https://news.ycombinator.com/ - constantly updating links to the hottest startup and tech
https://www.khanacademy.org/ - you probably know of this, but it's an amazing general learning resource!
https://www.udemy.com/ - packed full of courses of varying quality, often discounts on course are available
http://stackoverflow.com - this is THE programming Q&A website/forum and you'll find many answers to problems here.
@mrjamesriley
mrjamesriley / gist:1053477
Created June 29, 2011 08:58
command t splits
The following mappings are active when either the prompt or the match listing
has focus:
<CR> open the selected file
<C-CR> open the selected file in a new split window
<C-s> open the selected file in a new split window
<C-v> open the selected file in a new vertical split window
<C-t> open the selected file in a new tab
<C-j> select next file in the match listing
<C-n> select next file in the match listing
<html>
<head>
<title>Hey I'm walking here!</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" type="text/javascript"></script>
<script src="spritely-0.5.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {