Skip to content

Instantly share code, notes, and snippets.

@steveAbratt
steveAbratt / Lighting Director Custom.groovy
Last active January 16, 2018 03:27
Lighting Director Custom
/**
* Lighting Director
*
* Source: https://github.com/tslagle13/SmartThings/blob/master/Director-Series-Apps/Lighting-Director/Lighting%20Director.groovy
*
* Current Version: 2.9.4
*
*
* Changelog:
* Version - 1.3
/**
* We have 3 states for which our page can be in:
* 1. First page of form
* 2. In-Between first and last pages of form
* 3. Last page of form
* Based on these page states, the form previous and next
* buttons become enabled or disabled
*/
applicationState: {
first: {
@rick-nu
rick-nu / A-grunt-setup-for-sass-and-js.md
Last active February 7, 2017 17:00
Grunt, the ultimate javascript and sass setup

Grunt

The ultimate SASS and Javascript setup

Most of us know that Grunt is a really nice javascript task runner. Here you'll find a Grunt setup for a project with sass and javascript.

Features

  • A grunt setup for javascript and sass files
  • Quick javascript watcher
@webinfinita
webinfinita / bootstrap-breakpoints.sass
Last active March 2, 2025 20:24
Variables for responsive design in bootstrap with sass
@mixin breakpoint($point)
@if $point == lg
@media (min-width: 1200px)
@content
@else if $point == md
@media (min-width: 992px) and (max-width: 1199px)
@content
@else if $point == sm
@blakewest
blakewest / angular_code_review.md
Last active February 26, 2024 13:33
Angular Code Review Checklist

General

  • Are all vars used somewhere?
  • Do the vars have properly cased, and meaningful names?
  • Style looks appropriate
  • No unnecessarily duplicated logic
  • Code intent is clear upon initial reading
  • Any code that isn't clear, but is needed, has an effective comment
  • Are method calls or attribute lookups every called on entities that could be undefined/null?
  • The functions can appropriately handle unexpected inputs.
  • Commented code has been removed (comments themselves are fine).
@nathansmith
nathansmith / scroll-offset.js
Last active November 27, 2023 04:51
Check if the user is scrolled to the bottom of the page.
window.onscroll = function() {
var d = document.documentElement;
var offset = d.scrollTop + window.innerHeight;
var height = d.offsetHeight;
console.log('offset = ' + offset);
console.log('height = ' + height);
if (offset >= height) {
console.log('At the bottom');
@nathansmith
nathansmith / kill-magento-iframe.sass
Last active December 28, 2015 22:39
Hide unnecessary <iframe> in Magento.
// This matches any <iframe> that is used to overlay content.
//
// Example:
//
// <iframe style="... z-index ..."></iframe>
@media screen and (max-width: $media-mobile-max)
iframe[style*="z-index"]
display: none
@peschee
peschee / sass-responsive-mixin.scss
Last active February 3, 2022 16:14
SASS responsive mixin (bootstrap breakpoints)
/**
* Responsive mixin. The media breakpoints are as defined
* in the twitter bootstrap framework:
*
* - phone
* - tablet-portrait
* - tablet-landscape-desktop
* - large-desktop
*
* Additional parameters for tagetting retina and non-retina
@justinhillsjohnson
justinhillsjohnson / gist:5503121
Created May 2, 2013 15:43
code-review-checklist
General
1. Site uses a cache buster for expiring .js, .css, and images
2. JavaScript and CSS is minified and concatenated into logical groupings
3. Images have been optimized by ImageOptim (http://imageoptim.com/)
Markup
1. Code does not contain inline JavaScript event listeners
@iwek
iwek / find-in-json.js
Created October 20, 2012 21:43
Searching through JSON
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
if (i == key && obj[i] == val || i == key && val == '') { //