Skip to content

Instantly share code, notes, and snippets.

View rileyjshaw's full-sized avatar
💭
Riley is typing…

Riley Shaw rileyjshaw

💭
Riley is typing…
View GitHub Profile
@rileyjshaw
rileyjshaw / Watercolors.markdown
Created August 31, 2014 19:35
A Pen by Riley Shaw.
@rileyjshaw
rileyjshaw / _compass_retina_sprites.sass
Last active August 29, 2015 14:06
Retina sprites compass mixin
=retina-sprites($spritesheet)
@each $sprite in sprite_names($spritesheet)
&.#{$sprite}
$positions: ''
@each $j in sprite-position($spritesheet, $sprite)
$positions: append($positions, $j / 2, space)
height: image-height(sprite-file($spritesheet, $sprite)) / 2
width: image-width(sprite-file($spritesheet, $sprite)) / 2
background-position: $positions
@rileyjshaw
rileyjshaw / _compass_speech_bubbles.sass
Created September 14, 2014 21:07
Speech bubble compass mixin
=speech-bubble($arrow-direction: bottom, $arrow-pos: 50%, $height: 60px, $width: 60px, $padding: 0, $arrow-width: 12px, $arrow-length: 12px, $color: #aaa, $bgcolor: #333, $border-radius: 4px, $content: '', $bg-img: '', $bg-size: auto, $stab: 8px, $positioned: false, $size: 'medium')
$arrow-v: ''
$arrow-h: ''
$offset-direction: ''
$offset-body: ''
@if $arrow-direction == left or $arrow-direction == right
$arrow-v: transparent
$arrow-h: $bgcolor
$offset-direction: top
@rileyjshaw
rileyjshaw / index.slim
Created September 28, 2014 00:38
A Pen by Riley Shaw.
a href="http://rileyjshaw.com/sweep/"
#box
p sweep.js
@rileyjshaw
rileyjshaw / Water.markdown
Created September 30, 2014 04:25
A Pen by Riley Shaw.
@rileyjshaw
rileyjshaw / Slinky-V2.markdown
Created October 7, 2014 02:02
A Pen by Riley Shaw.

Slinky V2

No jQuery dependency, section progress shown in headers, click to scroll, resizable with scrollbar on window. Inspired by Slinky.js and DesignWall.

Currently doesn't work on iOS < 8 since they mess with scroll events. If you use this in production, look into iScroll.

A Pen by Riley Shaw on CodePen.

License.

Film grain effect in 138B of JavaScript

Golfed on this one until it fit in a tweet :)

...then golfed some more.

A Pen by Riley Shaw on CodePen.

License.

Stepping through a recursive function

Toy example that shows how a user can step through a recursive function. Pretty simple; just implement your own stack instead of relying on the call-stack. I used this technique to traverse the link tree in my visited vector reaction game.

License: MIT

@rileyjshaw
rileyjshaw / alpha_compositing_timer.html
Last active August 29, 2015 14:09
An experiment: does it take longer to alpha composite different colors? Used to automate http://rileyjshaw.com/visited-vectors
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Alpha compositing timer</title>
<style>
#container {
position: relative;
width: 360px;
height: 360px;
@rileyjshaw
rileyjshaw / Text-fade-in-effect.markdown
Created November 12, 2014 18:17
A Pen by Riley Shaw.