Skip to content

Instantly share code, notes, and snippets.

Shane Grey shanemgrey

Block or report user

Report or block shanemgrey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shanemgrey
shanemgrey / 0_reuse_code.js
Created Dec 27, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@shanemgrey
shanemgrey / autoFocus.directive.js
Created Mar 27, 2015
Directive to focus element on page load
View autoFocus.directive.js
/**
* app.autoFocus Module
*
* Simple directive to focus the element whem DOM ready
*/
'use strict';
angular
.module('app.autoFocus', [])
.directive('autoFocus', function($timeout) {
@shanemgrey
shanemgrey / ngSearchBox.html
Created Mar 27, 2015
Search Box for AngularJS Using Bootstrap with List and Grid View Buttons
View ngSearchBox.html
<!-- Full width search box with icons and actions associated to List and Grid Views -->
<!-- Requires Angular (1.3 used here), Bootstrap (3), and Font Awesome -->
<div class="row">
<div class="input-group m-b">
<span class="input-group-addon"><i class="fa fa-search"> </i></span>
<!-- auto-focus is a directive also found as a gist here. It sets the focus to an element on load. -->
<input class="form-control" auto-focus ng-init="$scope.searchQuery = $stateParams.query" type="text" minlength="3" maxlength="100" ng-model="searchQuery" placeholder="Search...">
<!-- List and Grid view buttons. Other elements watch listView and change as it does. -->
<!-- If using more than two states, this will need to be reworked. But it's easier as a boolean -->
<div class="input-group-addon">
You can’t perform that action at this time.