Skip to content

Instantly share code, notes, and snippets.

View bsaf's full-sized avatar

Basil Safwat bsaf

View GitHub Profile
@bsaf
bsaf / speedvid.sh
Last active October 18, 2022 14:49
Speed up an input video by a given factor (or 2x by default)
#!/bin/sh
# REQUIREMENTS
# ffmpeg (brew install ffmpeg)
#
# INSTALLATION
# 1. Put the file somewhere (e.g. ~/bin)
# 2. Add that folder to your $PATH in .zshrc or equivalent (e.g. export PATH="$HOME/bin:$PATH")
# 3. Run it (speedvid input.mp4)
@bsaf
bsaf / digits.py
Created May 17, 2017 21:21
scikit learn digits example
# load the digits dataset
from sklearn import datasets
digits = datasets.load_digits()
# show the data
digits.data
# show the answers
digits.target
@bsaf
bsaf / server-setup.markdown
Created September 22, 2014 11:38
Server setup

Server setup

These are the steps I go through to configure a new server for use with a Rails app.

Provisioning the server

Create the Linode

  • Either create a new one or rebuild an existing one.
  • Select Ubuntu 14 LTS
@bsaf
bsaf / ember_rails_bootstrap.markdown
Last active August 29, 2015 14:05
Ember app with Rails backend

Ember app with Rails backend

Rails app setup

This will create the Rails app and set up an API that the Ember app can consume.

Create the Rails app

$ rails new myapp --skip-bundle
@bsaf
bsaf / Photo organisation strategy.md
Last active December 22, 2015 04:28
Photo organisation strategy

Requirements

  1. Dropbox – for import
  2. Lightroom (optional) – for editing and offline access
  3. Arq – for backup
  4. External hard drive

Folder structure

@bsaf
bsaf / guybrush.txt
Created May 11, 2012 13:15
Guybrush's lines from The Secret of Monkey Island
# extracted from http://www.gamefaqs.com/pc/562681-the-secret-of-monkey-island/faqs/23891
Hi! My name's Guybrush Threepwood, and I want to be a pirate!
Er... I'm over this way.
THREEPWOOD. Guybrush THREEPWOOD.
Gosh, thanks! I'll do that! Bye, now. I'm off to seek my fortune.
(walks away, but suddenly stops)
Right. Thanks.
My name's Guybrush Threepwood. I'm new in town.
I don't know... I kind of like 'Guybrush.'