Skip to content

Instantly share code, notes, and snippets.

@ninjascribble
ninjascribble / dabblet.css
Created September 21, 2012 19:04
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body * {
box-sizing: border-box;
font: 16px Arial, sans-serif;
}
strong {
background: rgba(255, 0, 0, .4);
@ninjascribble
ninjascribble / dabblet.css
Created September 27, 2012 00:30
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.circle {
background: black;
width: 200px;
height: 200px;
border-radius: 50%;
@ninjascribble
ninjascribble / dabblet.css
Created September 27, 2012 18:47
Circledots!
/**
* Circledots!
*/
.circle {
background: #555;
width: 100px;
height: 100px;
border: 25px solid black;
border-radius: 50%;
list-style-type: none;
button.playpause {
background: none;
border: 3px solid #ccc;
border-radius: 50%;
content: "<span></span>";
display: inline-block;
height: 40px;
overflow: hidden;
position: relative;
text-indent: -2000px;
@ninjascribble
ninjascribble / dabblet.css
Created October 18, 2012 04:13
CSS Play/Pause button
/* CSS Play/Pause button */
button.playpause {
background: none;
border: 3px solid #ccc;
border-radius: 50%;
cursor: pointer;
display: inline-block;
height: 39px;
overflow: hidden;
position: relative;
@ninjascribble
ninjascribble / index.html
Created November 24, 2012 05:05
A CodePen by Scott Grogan. CSS Chronograph - Experimenting with ways to visualize time via CSS
<div class="timer-group">
<div class="timer hour">
<div class="hand"><span></span></div>
<div class="hand"><span></span></div>
</div>
<div class="timer minute">
<div class="hand"><span></span></div>
<div class="hand"><span></span></div>
</div>
<div class="timer second">
@ninjascribble
ninjascribble / gist:4602255
Last active December 11, 2015 12:38
jQuery $.Deferred chaining example. jsfiddle: http://jsfiddle.net/B5eZ9/1/
var a = getPromise(50)
, b = getPromise.bind(document, 1200)
, c = getPromise.bind(document, 400);
a.then(b).then(c).done(finish);
function getPromise(ttl) {
var deferred = $.Deferred();
@ninjascribble
ninjascribble / d3-linear-transform.js
Last active December 12, 2015 01:18
Smooth linear transforms with d3. With much thanks to Mike Bostock: http://bost.ocks.org/mike/path/
;(function() {
'use strict';
var _stage = d3.select('body').append('svg').attr('height', 200)
, _line = _stage.append('path')
, _interval = 400
, _filter = 'hourly'
, _cache = []
, _needsTranslation = false;
@ninjascribble
ninjascribble / flatten-array.js
Last active September 23, 2018 15:32
Quick 'n dirty JavaScript interview question #1
/**
* Given an array of n length, where each item in the array may be a letter,
* number or another array, write a function that will return a flattened
* array containing all the values in the original array and its children.
*
* Ex.
*
* var arr = [ 1, 'b', [ 'c', [ 4 ], 5], 'f'];
* flatten(arr) === [1, 'b', 'c', 4, 5, 'f'];
*/
@ninjascribble
ninjascribble / find-palindromes.js
Last active December 12, 2015 05:09
Quick 'n dirty interview question #2
/**
* Given a list of words, write a function that returns only those
* words which are palindromes (written the same forwards and
* backwards).
*
* Ex.
*
* var list = ['racecar', 'balloon', 'moon', 'history'];
* findPalindromes(list) == ['racecar', 'moon'];
*/