Skip to content

Instantly share code, notes, and snippets.

Evans will price match a collection of stores this is an easy way to open a tab for each of those stores so you can get the best deal.

To create a new bookmark and then edit the bookmark and replace the location with the JavaScript below (or use something like this with the raw JavaScript from below).

`javascript:(function()%7Bvar%20sites%20%3D%20%5B%22http%3A%2F%2Fwww.alansbmx.com%2Fadvancedsearch.aspx%3FTerm%3D%25s%22%2C%22http%3A%2F%2Fbikes.alpinebikes.com%2Fsearch%3Fw%3D%25s%22%2C%22http%3A%2F%2Fwww.allterraincycles.co.uk%2FSearch%3Fq%3D%25s%22%2C%22http%3A%2F%2Fwww.chainreactioncycles.com%2Fs%3Fq%3D%25s%22%2C%22http%3A%2F%2Fwww.currys.co.uk%2Fgbuk%2Fsearch-keywords%2Fxx_xx_xx_xx_xx%2F%25s%2Fxx-criteria.html%22%2C%22http%3A%2F%2Fsearch.cyclesurgery.com%2Fsearch%3Fw%3D%25s%22%2C%22http%3A%2F%2Fwww.cyclesuk.com%2FSearchResults.aspx%3FSearch%3D%25s%22%2C%22https%3A%2F%2Fwww.cyclestore.co.uk%2FproductSearch.asp%3Ffreetext%3D%2

@edds
edds / repos.json
Created June 30, 2015 12:06
core team fourth wall
[
{ "userName": "alphagov", "repo": "signonotron2" },
{ "userName": "alphagov", "repo": "frontend" },
{ "userName": "alphagov", "repo": "maslow" },
{ "userName": "alphagov", "repo": "short-url-manager" },
{ "userName": "alphagov", "repo": "support" },
{ "userName": "alphagov", "repo": "specialist-publisher" },
{ "userName": "alphagov", "repo": "publisher" },
{ "userName": "alphagov", "repo": "whitehall" },
{ "userName": "alphagov", "repo": "govuk_content_api" },
@edds
edds / mustache_template.rb
Last active August 29, 2015 14:11
Render mustache templates natively in Rails using a template handler
# ./config/initializers/mustache_template.rb
class MustacheTemplate
# `call` returns a string which is evaled in the context of the action view
# This follows the same pattern as other handlers:
# https://github.com/rails/rails/tree/4-2-stable/actionview/lib/action_view/template/handlers
def call(template)
partial_prefix = File.basename(File.dirname(template.identifier))
<<-cmd
mustache_template = Mustache.new
mustache_template.instance_variable_set("@view_paths", view_paths)
@edds
edds / application.scss
Created October 8, 2014 12:23
Demonstration of the new grid system
@import 'grid_layout';
@import "typography";
#wrapper {
@extend %full-width-wrapper;
}
.grid-row {
@extend %grid-row;
.third-column {
@edds
edds / token.rb
Created March 5, 2014 09:04
Generate a Google api refresh token to authenticate API requests
# Pre-requisites are that you have installed the oauth2 gem using:
# gem install oauth2
# Then call this file using `ruby token.rb` and follow the instructions.
require 'rubygems'
require 'oauth2'
redirect_uri = 'https://localhost/oauth2callback'
puts "Make sure #{redirect_uri} is set as a 'Redirect URI' in the Google Conosle for the project you want to create a token for.\n"
@edds
edds / toolkit_test.sh
Created October 8, 2013 07:42
Test the creation of buttons using the govuk_frontend_toolkit.
#!/bin/bash
# Make folder for our test and cd into it
mkdir toolkit_test
cd toolkit_test
# Clone down a new copy of the toolkit
git clone https://github.com/alphagov/govuk_frontend_toolkit.git
# Make sub folder for the test so the toolkit isn't in a child folder
@edds
edds / git-flow.md
Last active December 20, 2015 11:00
Basic git workflow

A basic workflow to create a new branch, do work on it:

$ git pull

$ git checkout -b <branchname>

... code edits ...

$ git [add|rm] <files>
@edds
edds / index.html
Created April 19, 2012 21:04
Ball that reacts to gravity on iOS devices
<!doctype html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
div {
width: 100px;
height: 100px;
background: #000;
color: #fff;
position: absolute;
@edds
edds / index.html
Created April 19, 2012 11:08
Dynamic SVG Mask - make a spotlight mask over an element
<!doctype html>
<title>Dynamic SVG Mask</title>
<style>
div {
width: 800px;
height: 800px;
background: #000;
}
</style>
@edds
edds / index.html
Created September 4, 2011 08:32
Javscript LED Scroller implementation.
<!doctype html>
<title>LED Scroller</title>
<style>
div#scroller {
width: 720px;
background:#000;
border:3px solid #000;
overflow:hidden;