Skip to content

Instantly share code, notes, and snippets.

View jimmynotjim's full-sized avatar
☀️
Enjoying SoCal "Fall"

Jimmy Wilson jimmynotjim

☀️
Enjoying SoCal "Fall"
View GitHub Profile
@jimmynotjim
jimmynotjim / Austin2013.md
Last active December 14, 2015 02:39
Places (mostly BBQ) to visit in Austin

Austin2013

Places to visit

@ForTheJim recommended

  • Stubbs
  • Alamo Drafthouse

@danbenjamin recommended

// Nav toggle for mobile
(function (w) {
w.navigation = function () {
var nav_open = false,
doc = w.document,
nav = doc.getElementById('nav'),
nav_toggle = doc.getElementById('nav-toggle'),
nav_function = function () {
if (nav_open === false) {
@jimmynotjim
jimmynotjim / gist:5136312
Created March 11, 2013 18:12
Facebook Comments w/ Wordpress
<?php
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() )
return;
?>
@jimmynotjim
jimmynotjim / _question.txt
Last active December 15, 2015 03:18
json question
In json, is there a way to check a value against an array and find the object it belongs to?
So if I have a known value of 'apex', check it against the 'value' keys and get back Array[1]
@jimmynotjim
jimmynotjim / _global.json
Last active December 15, 2015 03:59
Snipit to capture the url slug of a post and use that to get back the post data from _global.json (as well as related/same category posts for the sidebar population).
{
"posts": [
{
"title": "Some Title",
"postDate": "14.03.2013",
"excerpt": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient.",
"postSlug": "some-title",
"previewLg": "http://placehold.it/625x350.png",
"previewSm": "http://placehold.it/280x160.png",
"category": "some category",
@jimmynotjim
jimmynotjim / _pxtoper.scss
Last active December 15, 2015 11:39
PX to % converter mixin. Example shows how you could build a grid with it. Can take any property so you don't need separate mixins for widths, margins or positioning properties (left, right, etc)
$page: 960; //This is our ideal width
$third-col: ( $page - ($gutter * 2) ) / 3;
$gutter: 20; //This is our gutter
@mixin pxtoper($property, $target, $context) {
#{$property}: ($target / $context) * 100%;
}
@jimmynotjim
jimmynotjim / _global.json
Last active October 13, 2016 07:19
Snipit to build multi-level navigation from the navigation data in _global.json with highlighting classes applied to current or current parent top level items
{
"navigation": [
{
"slug": "index",
"title": "Home"
},
{
"slug": "item-one",
"title": "Item One"
},
@jimmynotjim
jimmynotjim / _pxtoem.scss
Created July 12, 2013 16:11
PX to EM converter mixin. Example shows how you could set all your base heading sizes in ems. Can take any property so you don't need separate mixins for widths, margins or positioning properties (left, right, etc). *If you change the font-size, you need to update the $context variable on your other declarations to match.*
$base-size: 16px;
$base-line-height: 25px;
$size-body: $base-size;
$size-alpha: 32px;
$size-beta: 28px;
@mixin pxtoem($property, $target, $context) {
#{$property}: ($target / $context) + 0em
}
@jimmynotjim
jimmynotjim / gist:6214413
Created August 12, 2013 19:44
Free Outdoor Wifi Locations
City Hall, BPL Courtyard, Harvard Sq, Faneuil Hall, Greenway, The Common, Christopher Columbus Park, Leventhal Park (Financial)
@mixin retina($ratio: 1.5) {
$dpi: $ratio * 96;
$opera-ratio: $ratio * 100;
@media only screen and (-webkit-min-device-pixel-ratio: #{$ratio}),
only screen and ( -o-min-device-pixel-ratio: '#{$opera-ratio}/100'),
only screen and ( min-resolution: #{$dpi}dpi),
only screen and ( min-resolution: #{$ratio}dppx) {
@content;
}