Skip to content

Instantly share code, notes, and snippets.

View brandonb927's full-sized avatar

Brandon Brown brandonb927

View GitHub Profile

Keybase proof

I hereby claim:

  • I am brandonb927 on github.
  • I am brandonb927 (https://keybase.io/brandonb927) on keybase.
  • I have a public key whose fingerprint is 8826 74F2 B591 348F B704 0CE6 5356 85E8 95E5 E538

To claim this, I am signing this object:

@brandonb927
brandonb927 / md.css
Last active August 29, 2015 14:19 — forked from pluma/md.css
body {max-width: 106ex; margin: 0 auto; padding: 1em 1ex; font-family: monospace; color: rgb(64,64,64)}
h1:before, h2:before, h3:before, h4:before, h5:before, h6:before {color: rgb(192,0,0)}
h1, h2, h3, h4, h5, h6 {font-weight: bold; color: black; font-size: 1.2em; margin: 2em 0 1em 0}
h1 {text-indent: -2ex; font-size: 2em}
h2 {text-indent: -3ex; font-size: 1.5em}
h3 {text-indent: -4ex; font-size: 1.2em}
h4 {text-indent: -5ex; font-size: 1em}
h5 {text-indent: -6ex; font-size: 1em}
h6 {text-indent: -7ex; font-size: 1em}
h1:before {content: '# '}
@brandonb927
brandonb927 / gist:2794652
Created May 26, 2012 17:04
JS: Get favicons beside links
/* JS */
function getDomain(url) {
return url.match(/:\/\/(.[^/]+)/)[1];
}
$("a[href^='http']").each(function() {
$(this).css({
background: "url(http://www.google.com/s2/u/0/favicons?domain=" + getDomain(this.href) +
") left center no-repeat",
"padding-left": "20px"
@brandonb927
brandonb927 / gist:2878407
Last active October 5, 2015 21:18
LESS/CSS: Fork Me On Github
/* CSS */
@font-face {
font-family: 'Collegia';
font-style: normal;
font-weight: normal;
src: local("Bangers"), url("http://roparz.me/fonts/COLLEGIA.otf") format("woff");
}
.forkme {
display: block;
position: absolute;
@brandonb927
brandonb927 / gist:4580977
Last active December 11, 2015 09:38
JS lazyloading that is non-blocking
// shamefully stolen from http://friendlybit.com/js/lazy-loading-asyncronous-javascript/
(function() {
function async_load(){
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'http://yourdomain.com/script.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
@brandonb927
brandonb927 / gist:5408650
Last active December 16, 2015 08:49
Postach.io Theme - Minimal-Flat :: This theme is HTML5, has all the declarations for Favicons and bookmark icons,contains Open Graph support for social media sharing, all packaged in a completely "responsive" layout that scales from desktop to mobile display sizes including font-sizing thanks to REM units with PX fallbacks where applicable.
<!DOCTYPE html>
<html lang="en-US" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8" />
<title>{% if is_home %} {{ site.author }} {% elif is_post %} {{ post.title }} {% elif is_page %} {{ page.title }} {% endif %} | {{ site.name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
@brandonb927
brandonb927 / timeline.html
Created May 11, 2013 21:43
Postach.io Theme - Timeline
<!DOCTYPE hl>
<html lang="en-US" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8" />
<title>{% if is_home %} {{ site.author }} {% elif is_post %} {{ post.title }} {% elif is_link %} {{ link.title }} {% elif is_tag %} {{ tag }} {% elif is_page %} {{ page.title }} {% endif %} | {{ site.name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
@brandonb927
brandonb927 / rem.less
Created May 28, 2013 19:40
REM units mixin with PX fallback
/**
* REM units mixin with PX fallback for legacy browsers with no REM unit support
* https://github.com/christopher-ramirez/remixings
*/
// ===== REM UNIT MIXINS ====
@base-font-size-px: 16; // root's font size. @base-font-size-px MUST ME AN INTEGER.
@pxtorem-js-function: ~`pxtorem = function(px){ if (typeof rmxsBaseFontSize == 'undefined') rmxsBaseFontSize = @{base-font-size-px}; return (parseInt(px.replace(/(^\d+)(.+$)/i,'$1')) / rmxsBaseFontSize + 'rem') }`;
// ===== FONT MIXINS =====
.font-size(@value) {
@brandonb927
brandonb927 / gist:5732192
Created June 7, 2013 20:30
Postach.io theme head tags. These tags are used in every theme and will constantly be updated to accommodate newer tags and tag updates over time.
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="description" content="{{ site.bio }} - {{ site.author }}" />
<meta name="copyright" content="Copyright (c) 2013 {{ site.author }}" />
<meta name="classification" content="blog" />
{% if is_post %}
<meta property="article:published_time" content="{{ post.created_at }}" />
@brandonb927
brandonb927 / gist:5733117
Last active December 18, 2015 05:29
Pretty Git Log config courtesy of https://coderwall.com/p/euwpig
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"