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
mscottford / Zencastr Recovery
Last active Apr 22, 2021
Small snippet to recover local recordings Zencastr has stored in IndexedDB. I used this to recover an audio file that failed to upload.
View Zencastr Recovery

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.
mscottford /
Last active Mar 26, 2021
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 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 / heroku.rake
Created Mar 13, 2012
Rake task for restarting Heroku workers
View heroku.rake
# Add `gem 'heroku-api', :git => ''` to your Gemfile
# Set the APP_NAME environment variable to the name of the Heroku app you wish to control.
# Set the HEROKU_API_KEY environment variable to the API key found on the Heroku 'My Account' page.
# You can now create a scheduler instance that runs `bundle exec rake heroku:workers:restart` to automate
# restarting workers at a regular interval.
namespace :heroku do
namespace :workers do
task :restart do
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.

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
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];