Skip to content

Instantly share code, notes, and snippets.

View seb-thomas's full-sized avatar
💭
😷

Sebastian Thomas seb-thomas

💭
😷
View GitHub Profile
I've just been catching up on the news of @Lottiedexter 's appearance on News Night.
Source: http://politicalscrapbook.net/2014/02/tory-boss-of-government-coding-education-initiative-cant-code-lottie-dexter/
Say what you will about her lack of ability to code, my greatest concern with her appearance is her definition of why it's important for children to learn to code.
Dexter answers that in the future the children of today will be able to code their own e-cards (I think) and websites to create their own online businesses. Fine. But that is by far not all.
Even as recently as ten years ago it wasn't a prerequisite for most business employess to know how to use a word processor, now it's vital. You don't have to know how to code a word processor, but clearly things have moved very quickly and an intimate knowledge of these tools will only become more important.
These tools help us deal with large amounts of information, more efficiently (we hope). Code isn't just limited to building websites, though they
@seb-thomas
seb-thomas / index.haml
Created March 19, 2014 16:47
A Pen by Sebastian Thomas.
<!-- Flick the box within the page and it returns, give it a hard flick off the top of the page and it will stay there. Gives the user more tactile feeling. 'Top of page' depends on size of page! :) -->
.pep
@seb-thomas
seb-thomas / D3.js Arc tween to inner and outer radius.
Last active August 29, 2015 14:13
I couldn't find any examples of how to do a simple interpolation for inner and outer arc radii. Most used the pie.layout which I didn't want to get into, or selected paths, or other things which seemed odd. This is heavily ripped off Mike Bostock's example: http://bl.ocks.org/mbostock/5100636
var width = 960,
height = 500,
τ = 2 * Math.PI; // http://tauday.com/tau-manifesto
// An arc function with no values bound except the startAngle.
var arc = d3.svg.arc()
.startAngle(0);
// Create the SVG container, and apply a transform such that the origin is the
// center of the canvas. This way, we don't need to position arcs individually.
gulp.task('strings', function() {
gulp.src('media/jade/*.jade')
.pipe(tap(function (file,t) {
var filename = path.basename(file.path);
return gulp.src(file.path)
.pipe(jade({
client: true,
name: filename
}))
@seb-thomas
seb-thomas / twig loop whitepace
Created June 10, 2015 08:46
Twig loop whitespace control
{% set value = 'no spaces' -%}
var qqq = [{
{%- for block in officeLocations.officeLocations -%}
"lat": {{- block.lat -}},"lng": {{- block.lng -}}
{%- if not loop.last -%} },{ {%- endif -%}
{%- endfor -%}
}];
@seb-thomas
seb-thomas / _entry.html
Created July 29, 2015 15:02
Craft SuperTable in a Matrix, implementing variable column width
<div class="module casestudy-awards">
<div class="container">
{% for block in entry.awards %}
<div class="row">
<div class="col-sm-12">
<h3 class="module-title">
{%- if block.moduleTitle | length -%}
{{- block.moduleTitle -}}
{%- else %}Awards won{% endif -%}
</h3>
@seb-thomas
seb-thomas / gist:2036534
Created March 14, 2012 13:38
WP single post category switch
<?php
$post = $wp_query->post;
if ( in_category('features') ) {
include(TEMPLATEPATH . '/single-features.php');
} else {
include(TEMPLATEPATH . '/single-single.php');
}
?>
@seb-thomas
seb-thomas / styles.less
Created March 16, 2012 10:27
Heavily edited version of less style sheet used in a project.
/*style sheet for global styles and layout blocks*/
//Vars
//Colours
@text-gray: #808080;
@border-red: #ec1b34;
@border-gray: #dedede;
//Mixins
@seb-thomas
seb-thomas / master.html
Created March 16, 2012 10:28
Edited version of our master template, with textbox for shadow
{% load cms_tags sekizai_tags menu_tags %}
<!doctype html>
<!-- stripped and modified basis fo the paul irish html5 boilerplate (in particular:
https://raw.github.com/paulirish/html5-boilerplate/master/index.html) -->
<head>
<meta charset="utf-8">
<title>{{ request.current_page.get_title }}</title>
<meta name="description" content="">
<meta name="author" content="">
@seb-thomas
seb-thomas / Path Gen
Created June 6, 2012 17:04
Code to generate a path object for https://github.com/JoelBesada/scrollpath from an array, using coords in px relational to current xy
//Code to generate a path object from an array, using coords in px relational to current xy
function do_with_args(func, args1, args2){
args = jQuery.merge(args1, args2);
console.log(func, args)
return func.apply(null, args);
}
var OPERATIONS = {