Skip to content

Instantly share code, notes, and snippets.

View Freyert's full-sized avatar

Fulton Byrne Freyert

  • Durham, NC
View GitHub Profile
@Freyert
Freyert / gist:4745708
Created February 9, 2013 15:27
Hide side bar when inactive, shows when mouse enters right screen. Reddit.
var sideBarLength, rightSide, winLength, pointerX, sideShowing, transition;
winLength = window.innerWidth || window.innerLength;
sideBar = document.getElementsByClassName('side')[0];
rightSide = winLength - sideBar.clientWidth;
sideShowing = true;
transition = (function () {
var vendors = ["Webkit", "Moz", "ms", "O"], result;
for (var i = 0; i < vendors.length;) {
if (vendors[i] + "Transition" in sideBar.style){
describe('CTRL: Dashboard', function() {
var ctr, scope, module;
beforeEach(function() {
module = angular.module('dashboard');
scope = {};
});
/*beforeEach(inject(function($controller) {
scope = {};
ctrl = $controller("DasboardCtrl", {$scope: scope});
}));*/
@Freyert
Freyert / yeoman-prompt-reactive.js
Created May 25, 2015 19:19
ReactiveJS Prompt Interface for Inquirer inside of a Yeoman Generator.
prompting: function () {
var done = this.async();
var log = function(answers) { this.log(answers); }.bind(this);
var complete = function() {
this.log('complete');
done();
}.bind(this);
var fs = require('fs');
fs.readFile('./fileA.json', function(err, a) {
fs.readFile('./fileB.json', function(err, b) {
fs.readFile('./fileC.json', function(err, c) {
fs.readFile('./fileD.json', function(err, d) {
fs.readFile('./fileE.json', function(err, e) {
console.log(a, b, c, d, e);
});
});
var fs = require('fs');
fs.readFile('./fileA.json', function(err, a) {
if(err) { throw err; }
else {
fs.readFile('./fileB.json', function(err, b) {
if(err) { throw err; }
else {
fs.readFile('./fileC.json', function(err, c) {
if(err) { throw err;}
var fs = require('fs');
function readFile(path, options) {
return new Promise(function(resolve, reject) {
fs.readFile(path, options, function(err, data) {
if(err) { reject(err); }
else {
resolve(data);
}
});
if (true) {
doThis();
} else {
doThat();
}
var json = requestAsync('https://www.ibm.com')
.catch(recoverFromErrors)
.then(function(res) {
return JSON.parse(res.body);
});
console.log(json);
This one is useful af. Thanks @MHBauer and @bmangold
https://github.com/docker/docker/issues/18078
docker commit $STOPPED_CONTAINER user/test_image
docker run -ti --entrypoint=sh user/test_imag
@Freyert
Freyert / npm-debug.log
Created November 17, 2016 20:02
npm install error
info it worked if it ends with ok
1 verbose cli [ '/Users/fulton/.nvm/versions/node/v4.6.2/bin/node',
1 verbose cli '/Users/fulton/.nvm/versions/node/v4.6.2/bin/npm',
1 verbose cli 'install',
1 verbose cli 'slc',
1 verbose cli '-g' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree