Skip to content

Instantly share code, notes, and snippets.

View fauverism's full-sized avatar
🧉

Robert Fauver fauverism

🧉
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fauverism on github.
  • I am fauverism (https://keybase.io/fauverism) on keybase.
  • I have a public key ASBIZtf_awSytO3Z8Nwu-K4b6dSHvk09NTLyBcLtsK-9XQo

To claim this, I am signing this object:

git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
@fauverism
fauverism / output properties in an object
Last active February 7, 2017 22:08
see available properties
str = JSON.stringify(obj);
str = JSON.stringify(info, null, 4);
console.log(str);
Type ("_" is the cursor position):
html:5_
Then type <c-y>, (Ctrly,), and you should see:
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
@fauverism
fauverism / Compast
Created January 11, 2016 14:20
Creates an array with all falsey values removed.
_.compact(array)
# Ⓢ Ⓝ
Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.
Arguments
array (Array): The array to compact.
Returns
(Array): Returns the new array of filtered values.
@fauverism
fauverism / gist:aab13e496683d5316e87
Created January 8, 2016 21:16
format a string back to a date value to show in an input with type=date
val = moment(val, "YYYY-MM-DD").format('L');
val = new Date(val);
@fauverism
fauverism / selected option of a dropdown list control using angular JS
Created January 7, 2016 17:13
Repeat in a select element the angular way
JS
$scope.options = [{ name: "a", id: 1 }, { name: "b", id: 2 }];
$scope.selectedOption = $scope.options[1];
HTML
<select data-ng-options="o.name for o in options" data-ng-model="selectedOption"></select>
@fauverism
fauverism / gist:4e9fae8645d43e8820f0
Created January 6, 2016 13:54
Reference a property name in ng-repeat
<ul>
<li ng-repeat="(key,val) in data">{{key}}: {{val}}</li>
</ul>
@fauverism
fauverism / Caution provisional headers are shown
Created December 27, 2015 04:11
Caution provisional headers are shown
chrome://net-internals tool in Chrome.
Just type that in the address bar and hit enter.
Then open the page that is showing problems. Then go back to net-internals,
click on events (###) and use the textfield to find the event related to your resource (use parts of the URL).
Finally, click on it and see if the info shown tells you something.
@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 + '" />');