Skip to content

Instantly share code, notes, and snippets.

hunting for code to clean up

M. Scott Ford mscottford

hunting for code to clean up
View GitHub Profile
View gist:3922340252f9b79c2973ecb85e68b167
afterburner-7:mob-timer mscottford$ node -v
afterburner-7:mob-timer mscottford$ node -v
afterburner-7:mob-timer mscottford$ npm -v
afterburner-7:mob-timer mscottford$ npm list
View wallpaper.js
// Run this from the console in Chrome when viewing an image on WallpapersCraft.
// It will download the 3840x2400 version of the image to your downloads folder.
// Example url: = function(url) {
e = document.createEvent('MouseEvents');
a = document.createElement('a'); = url;
a.href = url;
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
mscottford / Dockerfile
Last active Jan 31, 2018
Docker and docker-compose setup for a simple node environment which is setup to support using `yarn` and `yo`
View Dockerfile
FROM node:9.3
RUN apt-get update
RUN apt-get install sudo
RUN adduser --disabled-password --gecos '' docker
RUN adduser docker sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER docker
mscottford /
Last active Jan 8, 2018
Git Churn command

Instructions for running on Windows 10 (via Ubuntu Bash)

  1. Open Ubuntu bash environment shell
  2. Install dependencies
    sudo apt-get update
    sudo apt-get install git curl
  3. Create bin directory in your home folder
View ruby-example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
mscottford /
Last active Jul 2, 2018
Small snippet to recover local recordings Zencastr has stored in IndexedDB. I used this to recover an audio file that failed to upload.

Zencastr Recovery Script

This is a small snippet to recover local recordings Zencastr has stored in IndexedDB. I used this to recover an audio file that failed to upload.

To run it (instrutions for Google Chrome, you may have to adapt for other web browsers):

  1. open the web browser you were using when you made the recording,
  2. visit the Zencastr URL where you made the recording,
  3. right click on the page and select "Inspect",
  4. click on the "Console" tab,
  5. paste the script into the prompt and hit enter.

Keybase proof

I hereby claim:

  • I am mscottford on github.
  • I am mscottford ( on keybase.
  • I have a public key ASBb3YO8V7phbY2JEO-f0d4LQ2iHj49MOws4dfR_966DJgo

To claim this, I am signing this object:

View Does 10! (factorial) equal 6 weeks?
$ irb
irb(main):001:0> require 'active_support/all'
=> true
irb(main):002:0> class Integer
irb(main):003:1> def fact
irb(main):004:2> (1..self).reduce(:*) || 1
irb(main):005:2> end
irb(main):006:1> end
=> nil
irb(main):007:0> 10.fact == 6.weeks
View 0001-Exports-sftp_reply_-functions.patch
From 579377d5e510a4c138904181b640480524c30bce Mon Sep 17 00:00:00 2001
From: "M. Scott Ford" <>
Date: Fri, 2 Jan 2015 10:34:16 -0500
Subject: [PATCH] Exports sftp_reply_* functions
include/libssh/sftp.h | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/libssh/sftp.h b/include/libssh/sftp.h
mscottford / QuadrantView.m
Created Jan 13, 2014
Linear shading function Objective-C -> RubyMotion port
View QuadrantView.m
static void calculateLinearShadingValues(void *info, const float *in, float *out) {
const int components = 4;
ColorPair *colors = (ColorPair *) info;
int index;
for (index = 0; index < components; index++) {
out[index] = (1.0 - *in) * colors->start[index] + *in * colors->stop[index];
You can’t perform that action at this time.