Skip to content

Instantly share code, notes, and snippets.

@jrcryer
jrcryer / UIViewController+iAd.h
Created October 7, 2012 19:37
Obj-C Category for adding iAds to UIViewController
//
// UIViewController+iAd.h
//
// Created by James Cryer on 04/10/2012.
//
//
#import <UIKit/UIKit.h>
#import "iAd/iAd.h"
@jrcryer
jrcryer / gist:3898014
Created October 16, 2012 08:20
Simple js class library
(function(exports) {
var Class = function(parent) {
var klass = function() {
this.init.apply(this, arguments);
};
if(parent) {
var subclass = function(){};
subclass.prototype = parent.prototype;
@jrcryer
jrcryer / gist:3902614
Created October 16, 2012 23:01
Simple JavaScript Pub/Sub object
var PubSub = {
subscribe: function(ev, callback) {
var calls = this._callbacks || (this._callbacks = {});
(this._callbacks[ev] || (this._callbacks[ev] = [])).push(callback);
return this;
},
publish: function() {
var args = Array.prototype.slice.call(arguments, 0);
@jrcryer
jrcryer / gist:4980560
Last active December 13, 2015 21:58
Responsive Bootstrap
/* Mobile landscape */
@media screen and (min-width: 480px) {
}
/* Small tablet portrait */
@media screen and (min-width: 600px) {
}
@jrcryer
jrcryer / gist:4980614
Created February 18, 2013 20:52
Responsive images
object,
embed,
video,
img {
max-width: 100%;
height: auto;
}
@jrcryer
jrcryer / gist:4980628
Created February 18, 2013 20:53
Scaling viewport
<!-- insert in head -->
<meta name=”viewport” content=”initial-scale=1.0, width=device-width” />
<!-- end -->
@jrcryer
jrcryer / gist:4980650
Last active December 13, 2015 21:58
Icon fonts (using IcoMoon generated font)
@font-face {
font-family: 'icomoon';
src:url('fonts/icomoon.eot');
src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
url('fonts/icomoon.woff') format('woff'),
url('fonts/icomoon.ttf') format('truetype'),
url('fonts/icomoon.svg#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
@jrcryer
jrcryer / gist:4980770
Created February 18, 2013 21:09
WPUW - Base
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Wordpress Users Wales</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body class="home blog vigilance-light highlander-enabled highlander-light infinite-scroll neverending">
<div id="wrapper">
<div id="header" class="clear">
<h1 id="title"><a href="http://cardiffusers.wordpress.com"><span>Wordpress Users Wales</span></a></h1>
@jrcryer
jrcryer / gist:4980814
Created February 18, 2013 21:15
WPUW - Adding viewport scaling
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Wordpress Users Wales</title>
<link rel="stylesheet" href="css/base.css" />
<link rel="stylesheet" href="css/responsive.css" />
<!-- insert in head -->
<meta name=”viewport” content=”initial-scale=1.0, width=device-width” />
@jrcryer
jrcryer / gist:4980865
Created February 18, 2013 21:20
WPUW - Adaptive, not responsive!
/* Mobile landscape */
@media screen and (min-width: 480px) {
}
/* Small tablet portrait */
@media screen and (min-width: 600px) {
}