Skip to content

Instantly share code, notes, and snippets.

View jonathansampson's full-sized avatar
🦁
*roar*

Sampson jonathansampson

🦁
*roar*
View GitHub Profile
@jonathansampson
jonathansampson / Proto-Crawler.js
Last active August 29, 2015 13:57
Enumerates all properties of an object, including those found along the prototype chain.
var output = (function ( object ) {
"use strict";
function getProperties ( object ) {
return object ? Object.getOwnPropertyNames( object )
.concat( getProperties( Object.getPrototypeOf( object ) ) ) : [] ;
}
function getUnique ( array ) {
@jonathansampson
jonathansampson / Object-Crawler.js
Last active August 29, 2015 14:01
Creates an object that reveals browser features and functionality
/*global document, prompt */
(function( global ) {
"use strict";
var response = {
browser: {
name: prompt( "Browser Name? (Chrome, IExplorer, etc)" ),
version: prompt( "Browser Version? (34, 11, etc)" )
},
// based on https://snipt.net/gregwhitworth/w3c-keyword-colors-90c153dd/
// adds alphabetical index, hex, and rgb values
var colors = {
"a": [
[
"aliceblue",
"#F0F8FF",
"rgb(240, 248, 255)"
],
[
@jonathansampson
jonathansampson / ebola.sample.html
Created October 17, 2014 00:05
Alternative implementation for http://apps.washingtonpost.com/g/page/politics/the-scale-of-american-ebola-infections/1381/?template=iframe which will avoid Stack size limitations in some browsers
<style>
#people {
margin-top: 20px;
}
#people img {
width: 100%;
display: block;
}
</style>
@jonathansampson
jonathansampson / dabblet.css
Created May 31, 2012 04:11
CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson
/* CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson */
.die.one .dot {
box-shadow: 0 .2em 0 #FFF
}
.die.two .dot {
background: transparent;
box-shadow: -2.3em -2.3em 0 #345,
2.3em 2.3em 0 #345,
-2.3em -2.3em 0 #FFF,
2.3em 2.4em 0 #FFF
@jonathansampson
jonathansampson / dabblet.css
Created June 26, 2012 15:43
Delayed Animations
/**
* Delayed Animations
*/
@keyframes fadeToBlue {
50% {
background: blue
}
}
.foo {
ul {
padding-left: 0;
list-style: none;
line-height: 1.5em;
font-family: Tahoma;
}
ul::before {
font-weight: 700;
content: "\53\68\2a\74\20\4c\69\73\74\3a";
@jonathansampson
jonathansampson / dabblet.css
Created January 19, 2013 07:13
Make it a marquee
/* Make it a marquee */
.marquee {
width: 450px;
margin: 0 auto;
overflow: hidden;
white-space: nowrap;
box-sizing: border-box;
animation: marquee 50s linear infinite;
}
@jonathansampson
jonathansampson / dabblet.css
Created February 4, 2013 21:15
A Bandeira do Brasil
/**
* A Bandeira do Brasil
*/
body { margin: 0 }
html { background: #111111 }
.brasil {
/* Adjust for larger/smaller flag */
font-size: 20px;
@jonathansampson
jonathansampson / dabblet.css
Created February 13, 2013 06:45
Repeating Lateral Text Shadows - By @LeaVerou
/* Repeating Lateral Text Shadows - By @LeaVerou */
body { margin: 0 }
h1 {
color: #3D6AA2;
position: relative;
font: bold 2em/1em 'Segoe UI';
}