Skip to content

Instantly share code, notes, and snippets.

View davidchase's full-sized avatar
📺
Working from home

David Chase davidchase

📺
Working from home
View GitHub Profile
@davidchase
davidchase / README.md
Last active December 16, 2015 17:19
Hide the logins of users on the mac, separate the users by spaces. the data array is stored in a plist file called /Library/Preferences/com.apple.loginwindow.plist

Hide Users

This one liner hides users on a Mac OS X v10.4 and later.

Just seperate each user you would like to hide from the login menu with a space and it will store it to an array inside of loginwindow.plist file.

The key is HiddenUserList along with the array values that you inputed of the users.

@davidchase
davidchase / README.md
Last active December 16, 2015 21:49
"This gives you the box model you want. Applies it to all elements. Turns out many browsers already use border-box for a lot of form elements (which is why inputs and textareas look diff at width:100%;) But applying this to all elements is safe and wise." -- Paul Irish

Keep My Width

A nice article by Paul Irish read here.

It talks about keeping width the same on all elements without affecting performance regardless of adding padding.

One simple line of CSS and your back on track as long as you are dealing with IE8 + or other browsers.

/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@davidchase
davidchase / README.md
Last active December 18, 2015 19:29
Angularjs Directive Blurb

Usage:

<div data-blurb ng-class="'blurb'" title="Blurb Title" show="106" more="Read More" less="Read Less" ellipsis="...">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
 proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@davidchase
davidchase / isObjEmpty.js
Last active May 30, 2018 11:47
Plain javascript gut check if object is empty or not
var yourObjectHere = {};
Object.getOwnPropertyNames(yourObjectHere).length === 0; // empty object true
var yourObjectHere = {'empty':'i am not empty!!'};
Object.getOwnPropertyNames(yourObjectHere).length === 0; // empty object false
// function isEmpty(obj) with object param
var isEmpty = function(yourObjectHere) {
for (var key in yourObjectHere) return false; return true;
// IIFE - Immediately Invoked Function Expression
(function(yourcode) {
// The global jQuery object is passed as a parameter
yourcode(window.jQuery, window, document);
}(function($, window, document) {
// The $ is now locally scoped
@davidchase
davidchase / ie8Support.css
Created July 19, 2013 18:58
IE8 Support with Foundation 4
/* The Grid ---------------------- */
/* line 1453, ../sass/app.scss */
.lt-ie9 .small-1, .lt-ie9 .row .small-1 {
width: 8.33333%;
}
/* line 1454, ../sass/app.scss */
.lt-ie9 .small-2, .lt-ie9 .row .small-2 {
width: 16.66667%;
}
uptime | awk '{print "Uptime: " $3 " " $4 " " $5 " "$8 " "}';
echo "-----";
ps -amcwwwxo "command %mem %cpu" | grep -v grep | head -19
echo "-----";
@davidchase
davidchase / SassMeister-input.scss
Created March 21, 2014 04:20
Generated by SassMeister.com.
// ----
// Sass (v3.3.3)
// Compass (v1.0.0.alpha.18)
// ----
%transition {
-webkit-transition :0.5s ease all;
transition :0.5s ease all;
position :absolute;
left :0;
<?php
function lpr($expression) {
$bt = debug_backtrace();
$caller = array_shift($bt);
printf("\n>>> %s:%s > %s\n", $caller['file'], $caller['line'], print_r($expression, true));
}