Skip to content

Instantly share code, notes, and snippets.

View interactivellama's full-sized avatar

Stephen James interactivellama

View GitHub Profile
@interactivellama
interactivellama / node-util.sublime-snippet
Created March 15, 2016 20:58
Snippet for NodeJS's util library that inspects all levels of a variable
<snippet>
<!-- Snippet for https://nodejs.org/api/util.html -->
<!-- Put this file in `Sublime Text 3/packages/User/ then restart. -->
<!-- Don't forget to import `const util = require('util');` -->
<content><![CDATA[console.log(util.inspect($1,false, null));$0]]></content>
<tabTrigger>util</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log(util.inspect())</description>
</snippet>
{
"folders":
[
{
"path": ".",
"folder_exclude_patterns": ["build", "dist"],
"file_exclude_patterns": ["*.bundle.*"]
}
]
}
function _getContainer(element) {
var containerElement, isWindow;
// manual override
if (element.attr('data-target') && element.attr('data-target') !== 'window') {
containerElement = element.attr('data-target');
isWindow = false;
} else {
// default to window otherwise
containerElement = window;
function _getContainer(element) {
var containerElement, isWindow;
if (element.attr('data-target')) {
containerElement = element.attr('data-target');
isWindow = false;
} else {
containerElement = window;
isWindow = true;
$.each(element.parents(), function (index, value) {
@interactivellama
interactivellama / react-tips.md
Last active August 29, 2015 14:27
React Javascript View Framework Tips

These are directly copied snippets of React-focused methodology from around the web:

React draws a lot of inspiration from functional programming. It promotes immutability through the clear separation of props and state and encourages writing functions (components) that are free from side-effects and always return the same values (DOM representation) given the same inputs (props).

The functional model of computation combined with immutable data and one-way dataflow makes it much easier to reason about your program, greatly facilitating extension and debugging.

==============================

Understand that you should have 2 kinds of components. Stateful components and view components.

@interactivellama
interactivellama / datepicker-restrict-except-previous-year.js
Last active August 29, 2015 14:23
Set Fuel UX datepicker to restrict all dates but today and the previous year
var today = new Date();
var tomorrow = new Date();
tomorrow = new Date(tomorrow.setDate(tomorrow.getDate() + 1));
var aYearAgo = new Date(today.getTime());
aYearAgo.setFullYear(aYearAgo.getFullYear() - 1);
document.write(today + '<br\>');
document.write(aYearAgo + '<br\>');
document.write(tomorrow + '<br\>');
@interactivellama
interactivellama / achromatic-grays.less
Last active August 29, 2015 14:17
Achromatic grays for LESS
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ACHROMATIC GRAYS - number suffix = luminance value
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// A few shades of gray will suffice for simple controls and themes,
// but don't torture yourself with 'light', 'lighter', and 'more mediumer'
@true-white: #fff;
@true-black: #000;
@interactivellama
interactivellama / heroku-commands.sh
Last active March 20, 2023 14:33
Heroku commands
#Create new app
heroku apps:create [app-name]
# Change to development mode (install devDependencies in nodee)
heroku config:set npm_config_production=false
# Push a local branch that is not master
git push heroku [local-branch]:master
# Add existing Heroku app
@interactivellama
interactivellama / fuelux-mctheme-contributors.bash
Last active August 29, 2015 14:09
Fuel UX: Marketing Cloud Theme Contributors' Remotes
# 2014 Major Contributors
git remote add interactivellama git@github.com:interactivellama/fuelux-mctheme.git &&
git remote add chriscorwin git@github.com:chriscorwin/fuelux-mctheme.git &&
git remote add BenjaminNeilDavis git@github.com:BenjaminNeilDavis/fuelux-mctheme.git &&
git remote add cormacmccarthy git@github.com:cormacmccarthy/fuelux-mctheme.git &&
git remote add swilliamset git@github.com:swilliamset/fuelux-mctheme.git &&
git remote add futuremint git@github.com:futuremint/fuelux-mctheme.git &&
git remote add dwaltz git@github.com:dwaltz/fuelux-mctheme.git &&
git remote add BenjaminNeilDavis git@github.com:BenjaminNeilDavis/fuelux-mctheme.git &&
@interactivellama
interactivellama / fuelux-contributor-remotes.bash
Last active August 29, 2015 14:08
Fuel UX Contributors' Remotes
# 2014 Major Contributors
git remote add vernak2539 git@github.com:vernak2539/fuelux.git &&
git remote add interactivellama git@github.com:interactivellama/fuelux.git &&
git remote add BenjaminNeilDavis git@github.com:BenjaminNeilDavis/fuelux.git &&
git remote add chriscorwin git@github.com:chriscorwin/fuelux.git &&
git remote add cormacmccarthy git@github.com:cormacmccarthy/fuelux.git &&
git remote add swilliamset git@github.com:swilliamset/fuelux.git &&
git remote add futuremint git@github.com:futuremint/fuelux.git &&
git remote add dwaltz git@github.com:dwaltz/fuelux.git &&