Skip to content

Instantly share code, notes, and snippets.

View jnowland's full-sized avatar

James Nowland jnowland

View GitHub Profile
@jnowland
jnowland / SassMeister-input.scss
Created February 26, 2017 09:20
Precise control over responsive typography for Sass
// ----
// libsass (v3.3.6)
// ----
// =========================================================================
//
// PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS
// ---------------------------------------------------
// Indrek Paas @indrekpaas
//
@jnowland
jnowland / calculators.scss
Last active March 30, 2016 23:43
Using EM's
@function strip-units($number) {
@return $number / ($number * 0 + 1);
}
@function em($target, $context: $base-font-size, $unitless: false) {
@if ($unitless == false) {
@return ($target / $context) * 1em;
}
@else {
@return strip-units(($target / $context));
@jnowland
jnowland / 0-model-override.js
Created March 23, 2016 04:18 — forked from spencermefford/0-model-override.js
An alternative to extending Loopback's built in models. In our application, we wanted to create a custom role called "ecm-administrator" that would have the ability to create and manage users.
module.exports = function (app) {
var _ = require('lodash');
var User = app.models.User;
var Role = app.models.Role;
var RoleMapping = app.models.RoleMapping;
var ACL = app.models.ACL;
/*
* Configure ACL's
*/
@jnowland
jnowland / Add files to .txt
Created March 8, 2016 01:29
Linux Commands for assests
ls > filenames.txt
{% comment -%}
#----------------------------------
# Meta Details - /Templates/_includes/html.metaDetails.tpl
#----------------------------------
To use this meta template insert the above variables above the include:
{% assign metaTitle = "" -%}
{% assign metaDescription = "" -%}
{% assign metaTags = "" -%}
{% assign metaCategory = "" -%}
{% assign metaTwitterHandle = "" -%}
@jnowland
jnowland / IE9.md
Last active November 4, 2015 04:03
Browser Upgrades + CSS Benefits

If your min browser support goes to IE9

  • Border Radius
  • SVG
  • Calc()
  • All CSS3 Attributes
  • Box Shadows
  • Basic Viewport units
  • No Javascript hacks
  • jQuery 2
@jnowland
jnowland / MetaDataTags.html
Last active August 29, 2015 14:27
Credit Card Gist
<title>{% if this.['Page Title'] != "" -%}{{ this.['Page Title'] }}{% else -%}{{ name }}{% endif -%}</title>
<meta name="description" content="{% if this.['Meta Description'] != "" -%}{{ this.['Meta Description'] }}{% else -%}{{ description | strip_html | replace: "\n", " " | truncate:155 | lstrip | rstrip }}{% endif -%}">
{% if this.['Image Alt Tag'] != "" -%}{% assign imgAlt = this.['Image Alt Tag'] -%}{% else -%}{% assign imgAlt = name -%}{% endif -%}
{{ imgAlt }}
@jnowland
jnowland / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# Ask for the administrator password upfront
sudo -v
# mkdir -p ~/Sites/Work/Clients
# mkdir -p ~/Sites/Work/Internal
# mkdir -p ~/Sites/Personal
# mkdir -p ~/Downloads/Torrents
mkdir -p /Volumes/Sites/Work/Clients
mkdir -p /Volumes/Sites/Work/Internal
@jnowland
jnowland / preferences.sublime-settings
Created October 19, 2014 23:35
Sublime Text 2 Preferences
{
"bold_folder_labels": true,
"detect_indentation": true,
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",