View promisechain.js
Promise.resolve(1)
.then((x) => x + 1)
.then((x) => { throw new Error('My Error') })
.catch(() => 1)
.then((x) => x + 1)
.then((x) => console.log(x))
.catch(console.error)
View first.md

some header

some text some text some text some text some text

some other header

View trying blocks
# testing this
some text
## some other header
some more text some more text some more text some more text some more text some more text some more text some more text some more text some more text some more text some more text some more text
View git_fzf_key_bindings.fish
function __git_fzf_is_in_git_repo
command -s -q git
and git rev-parse HEAD >/dev/null 2>&1
end
function __git_fzf_git_status
__git_fzf_is_in_git_repo; or return
git -c color.status=always status --short | \
fzf -m --ansi --preview 'git diff --color=always HEAD -- {-1} | head -500' | \
cut -c4- | \
View mac-os-sierra-virtualbox.md
$ vagrant init jhcook/macos-sierra
$ vagrant up

(I got errors while starting the virtual machine, fixed it opening Virtualbox and editing the generated virtual machine's settings. I disabled nested pagination from the System -> Acceleration menu)

After that the vm booted without problems and I was able to successfully install xcode.

View isIPhone6PlusOrHigher.js
var modelString = device.model;
var modelRegex = /\d+/g;
var isIPhone6PlusOrHigher = false;
var match = modelString.match(modelRegex);
if (match != null) {
var major = match[0], minor = match[1];
if (major == 7) {
if (minor != 2) {
// iphone 6 plus
isIPhone6PlusOrHigher = true;
View inheritance.js
var Person = function (name) {
this.name = name;
}
Person.prototype = {
sayHi: function() {
console.log('Hi, my name is ' + this.name);
},
parentClassMethod: function() {
console.log('Method from Person class called on ' + this.name);
View controller.js
(function() {
'use strict';
angular.module('App').controller('Ctrl', Ctrl);
Ctrl.$inject = [];
function Ctrl() {
var vm = this;
}
})();