Skip to content

Instantly share code, notes, and snippets.

View wheresrhys's full-sized avatar

Rhys Evans wheresrhys

View GitHub Profile
@wheresrhys
wheresrhys / stream.js
Last active August 29, 2015 14:14 — forked from commuterjoy/stream.js
var StreamModel = function () {}
prototype {
initFromSAPI() // takes a search string
initFromIds() // takes list of ids
initFromModels()// takes list of article models
}
@wheresrhys
wheresrhys / gist:2bd4ae944003fe57af50
Last active August 29, 2015 14:08 — forked from andrewjtait/gist:9114245e92b84d69aa43
bash function for viewing current git branch on github
function gh {
branch="$(git rev-parse --abbrev-ref HEAD)"
url="$(git config --get remote.origin.url)"
url=${url/git@github.com:/http://github.com/}
url=${url/.git/}
if [[ $1 =~ "-c" ]]; then action="compare"
elif [[ $1 =~ "-p" ]]; then action="pull"
else action="tree"; fi
@wheresrhys
wheresrhys / page.html
Last active August 29, 2015 13:56 — forked from triblondon/page.html
<script>
(function() {
if (Modernizr.classlist && Modernizr.queryselector && Modernizr.localstorage && Modernizr.eventlistener) {
var j = document.createElement('script');
j.type = 'text/javascript';
j.async = true;
j.src = '/resources/javascript/bundle.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(j, s);
document.documentElement.className += ' o--js';
/* modernizr-test_position_fixed_ios.js
* Original by Daniel Ott (https://gist.github.com/1333800)
* 3 March 2011
* Updated by Philipp Söhnlein 3 November 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
@wheresrhys
wheresrhys / gist:1405171
Created November 29, 2011 15:28 — forked from philhawksworth/gist:1393999
centered dynamic menu
<html>
<head>
<title></title>
<style type="text/css">
.primary-nav {
width:1000px;
border:solid 1px red;
text-align:center;
}