Skip to content

Instantly share code, notes, and snippets.

View thm-design's full-sized avatar
Just build it.

Tony H Meyer thm-design

Just build it.
View GitHub Profile
.ipad-only, .iphone-only, .retina-only, .non-retina-only, .retina-iphone-only, .non-retina-iphone-only { display: none; }
/* ---------- iPad Only ---------- */
@media only screen and (device-width: 768px) {
.ipad-only { display: block; }
}
/* ---------- iPhone/iPod Only ---------- */
@media only screen and (device-width: 320px) {
.iphone-only { display: block; }
/* Media queries used on blog.staydecent.ca by Adrian Unger
check my full source at:
http://blog.staydecent.ca/static/css/style-0.1.6.css */
@media only screen and (min-width:768px) and (max-width:1269px) {
/* In my particular design, I used a fluid grid limited to a
max-width of 1140px, while (if there is enough room)
pushing the menu outside of layout, requiring a total
limit of at least 1270px.
So, this first query applies to any screen-width less
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@thm-design
thm-design / gist:8280929
Last active January 2, 2016 09:09
Angular snippet : active navigation
app.directive("activeNav",function($location) {
return {
link: function postLink(scope, element, attrs) {
scope.$on("$routeChangeSuccess", function (event, current, previous) {
// this var grabs the tab-level off the attribute, or defaults to 1
var pathLevel = attrs.activeNav || 1,
// this var finds what the path is at the level specified
pathToCheck = $location.path().split('/')[pathLevel],
// this var finds grabs the same level of the href attribute
tabLink = attrs.href.split('#')[pathLevel];

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@thm-design
thm-design / index.html
Created July 16, 2013 07:42
A CodePen by Nick Williams. JS module pattern demo - My current approach to the module pattern. A fully working widget that can be used multiple times on a page through a variety of means (raw object, jquery plugin, declaratively)
<!-- note this first widget doesn't get setup in JS -->
<!-- everything is done declaratively via our data-widget attribute -->
<div class="widget standard fl bordered" data-widget="dateTime">
<p class="widget-title">Declarative Widget</p>
<div class="widget-body">
<time data-time="date"></time>
<time data-time="time"></time>
</div>
</div>
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@thm-design
thm-design / index.html
Created March 27, 2013 10:04
A CodePen by Josh Rives. Simple Responsive Table - Resize your browser below 700px to view. This is a simple responsive table. The shadows on the sides are just to indicate that the user should slide to see the rest on mobile. You could easily make the shadow appear and disappear depending on if you at either end with jquery scrollLeft.
<section>
<div>
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Number</th>
<th>City</th>
<th>Team</th>
/*
AMD Module for jQuery.Spinner plugin for Spin
Adapted from: https://gist.github.com/1290439
Spin.js: http://fgnass.github.com/spin.js/
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.