Skip to content

Instantly share code, notes, and snippets.

View anthonyringoet's full-sized avatar

Anthony R anthonyringoet

View GitHub Profile
@anthonyringoet
anthonyringoet / dabblet.css
Created October 9, 2012 07:12
Center with calc(), tip from Lea Verou presentation
/**
* Center with calc(), tip from Lea Verou presentation
*/
body{
/* housekeeping */
background: #ffa;
min-height: 100%;
font-family:sans-serif;
}
@anthonyringoet
anthonyringoet / hosts
Created November 27, 2012 11:02
windows host file virtualbox to use local dev domains from mamp
# file lives in:
# C:\Windows\System32\drivers\etc
10.0.2.2 local.domain.on.mac
@anthonyringoet
anthonyringoet / request.js
Created December 27, 2012 13:15
scraping data from the dom with node
var request = require('superagent');
var _ = require('lodash');
var cheerio = require('cheerio');
request.get('http://news.ycombinator.com/', function (res){
var html = res.text,
$ = cheerio.load(html),
index = 1;
var items = $('.title a');
@anthonyringoet
anthonyringoet / svg-fallback-swap.js
Created January 18, 2013 12:53
swap out svg for a bitmap image src if svg is unsupported
// if svg is unsupported (modernizr test)
// look for data-svg-fallback attr
// and switch out src on those images
(function (Modernizr, $, undefined) {
if(!Modernizr.svg){
var $elems = $('img[data-svg-fallback]');
$elems.each(function(index){
var img = $(this);
img.attr('src', img.attr('data-svg-fallback'));
@anthonyringoet
anthonyringoet / dabblet.css
Created February 22, 2013 08:13
display:table equal height columns ftw
/**
* display:table equal height columns ftw
*/
body{
font:1.3em/1.4 sans-serif;
}
.table{
display:table;
}
@anthonyringoet
anthonyringoet / template.php
Created March 29, 2013 09:18
drupal - Remove toolbar from colorbox loaded page
<?php
function template_preprocess_html(&$vars) {
$params = drupal_get_query_parameters();
$page = &$vars['page'];
if($params['iframe'] == true){
if(isset($page['page_top'])){
unset($page['page_top']);
}
@anthonyringoet
anthonyringoet / dabblet.css
Created May 2, 2013 12:40
animation one frame
/**
* animation one frame
* from http://lea.verou.me/2012/12/animations-with-one-keyframe/
*/
body{
background: #f06;
text-align:center;
}
@keyframes dang{
50%{ font-size:9em; }
'use strict';
var path = require('path');
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var folderMount = function folderMount(connect, point) {
return connect.static(path.resolve(point));
};
module.exports = function(grunt) {
@anthonyringoet
anthonyringoet / gist:5776954
Created June 13, 2013 20:14
bbc good browsers vs bad browsers
// 'bad' browsers - core experience
if( 'querySelector' in document &&
'localStorage' in window &&
'addEventListener' in window ){
// good - enhanced experience
// add fun stuff!
}
@anthonyringoet
anthonyringoet / gist:5803425
Created June 18, 2013 07:50
html file start
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Untitled</title>
<link href="css/app.css" rel="stylesheet" />
</head>
<body>