A simple example to create a websocket server and stream tweets about a pre-defined subject to the page.
$ npm install socket.io, twitter
$ node ./app.js
<!doctype html> | |
<title>LED Scroller</title> | |
<style> | |
div#scroller { | |
width: 720px; | |
background:#000; | |
border:3px solid #000; | |
overflow:hidden; |
<!doctype html> | |
<title>Dynamic SVG Mask</title> | |
<style> | |
div { | |
width: 800px; | |
height: 800px; | |
background: #000; | |
} | |
</style> |
<!doctype html> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
div { | |
width: 100px; | |
height: 100px; | |
background: #000; | |
color: #fff; | |
position: absolute; |
A basic workflow to create a new branch, do work on it:
$ git pull
$ git checkout -b <branchname>
... code edits ...
$ git [add|rm] <files>
#!/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 |
# 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" |
@import 'grid_layout'; | |
@import "typography"; | |
#wrapper { | |
@extend %full-width-wrapper; | |
} | |
.grid-row { | |
@extend %grid-row; | |
.third-column { |
# ./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) |
[ | |
{ "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" }, |