Skip to content

Instantly share code, notes, and snippets.

View ralgh's full-sized avatar

Ralph Hansell ralgh

  • Acxiom
  • Portsmouth, NH
View GitHub Profile
@ralgh
ralgh / RPS.js
Last active December 22, 2015 00:59 — forked from joehinkle/RPS.js
var
choices = ['rock','paper','scissors'], // Classic version
// choices = ['cockroach','foot','nuke'], // Foot crushes cockroach, nuke blows up foot, cockroach survives nuke.
// choices = ['rock','paper','scissors','spock','lizard'], // Rock-Paper-Scissor-Spock-Lizard version
choicesCount = choices.length,
promptString = (function(choices){
var string = '',
c = choicesCount - 1;
for (var i = 0; i <= c; i++) {
string += (i === 0) ? capitalize(choices[i]) : choices[i];
@ralgh
ralgh / block.tpl.php
Created July 14, 2012 20:04 — forked from pixelwhip/block.tpl.php
Modular Stylesheets - Design 4 Drupal
<?php
/**
* @file
* Default theme implementation to display a block.
*
* Available variables:
* - $block->subject: Block title.
* - $content: Block content.
* - $block->module: Module that generated the block.
@ralgh
ralgh / breakpoints_via_css.html
Created April 29, 2012 20:35 — forked from emilbjorklund/breakpoints_via_css.html
Width detection via sneaky CSS rules
<!DOCTYPE html>
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<title>Breakpoint detection test</title>
<style type="text/css" media="screen">
@media screen and (min-width: 320px) {
#page:after {
content: 'smallest'; /* represent the current width-bracket */