Skip to content

Instantly share code, notes, and snippets.

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

Sebastian Thomas seb-thomas

💭
😷
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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>
#!/bin/sh
echo Install Homebrew, and cask things
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install fish
brew install node
brew install git
brew install caskroom/cask/brew-cask
#brew cask search
#brew cask uninstall app
@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 -%}
}];
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 / 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.
@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
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
// Add to global namespace
$(document).ready(function(){
window.coolfunc = function(arg){
alert(arg);
}
coolfunc('Hi!');