Skip to content

Instantly share code, notes, and snippets.

@fauverism
fauverism / addRows.html
Created December 10, 2015 01:18
Add Rows with Angular
<!DOCTYPE html>
<html ng-app="angularjs-starter">
<head lang="en">
<meta charset="utf-8">
<title>Custom Plunker</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
<link rel="stylesheet" href="style.css">
<script>
document.write('<base href="' + document.location + '" />');
@fauverism
fauverism / Do it in a directive
Created November 23, 2015 20:12
Add DOM elements with Angular
http://jsfiddle.net/fauverism/bw0c9moa/
@fauverism
fauverism / gist:54a75abda94247a0b95d
Created October 6, 2015 18:33
executable-hooks sass error
You need to run the following command in the Terminal to refresh the executable-hooks to the latest version. That should take care of the issue.
sudo gem install --user-install executable-hooks
@fauverism
fauverism / conditional-inputs.html
Created September 23, 2015 14:34
Conditionally require inputs with AngularJS
<input type='email'
name='email'
ng-model='contact.email'
placeholder='[email protected]'
ng-required='!contact.phone' />
<input type='text'
ng-model='contact.phone'
placeholder='(xxx) xxx-xxxx'
ng-required='!contact.email' />
@fauverism
fauverism / css
Created August 25, 2015 16:40
quick responsive jawn
/* https://scotch.io/quick-tips/default-sizes-for-twitter-bootstraps-media-queries */
/* Large Devices, Wide Screens */
@media only screen and (max-width : 1200px) {}
@media only screen and (max-width : 1199px) {}
/* Medium Devices, Desktops */
@media only screen and (max-width : 992px) {}
@media only screen and (max-width : 991px) {}
@fauverism
fauverism / ui.gridMenu custom menu item to filter
Last active August 29, 2015 14:22
When applying a custom menu item to the dropdown and apply a sort.
menuItems: [
{
title: 'Show Work',
icon: 'fa fa-circle',
action: function() {
$scope.gridApi.grid.columns[1].filters[0] = {};
$scope.gridApi.grid.columns[1].filters[0].term = "Work";
filterListener();
},
context: $scope
@fauverism
fauverism / gist:6857afab98106a0eb678
Created June 2, 2015 13:51
To delete local branches which have already been merged into develop:
git branch --merged develop | grep -v "\* develop" | xargs -n 1 git branch -d
<input type="text" ng-bind-attrs="{placeholder: somePropertyOfTheScope, tabindex: anotherPropertyOfTheScope}" >
@fauverism
fauverism / ng Input value data-bind
Created January 27, 2015 17:50
ng data bind to the value attr of an input
angular.module('app')
.directive('input', function ($parse) {
return {
restrict: 'E',
require: '?ngModel',
link: function (scope, element, attrs) {
if (attrs.ngModel && attrs.value) {
$parse(attrs.ngModel).assign(scope, attrs.value);
}
}
@fauverism
fauverism / Bootstrap Navbar width
Created January 27, 2015 15:29
Change the width of the bootstrap navbar to always remain collapsed, unless the viewport is over 2048px
@media (max-width: 2048px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);