This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| #!/bin/bash | |
| if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
| appify v3.0.1 for Mac OS X - http://mths.be/appify | |
| Creates the simplest possible Mac app from a shell script. | |
| Appify takes a shell script as its first argument: | |
| `basename "$0"` my-script.sh |
| # Install Bash 4 using homebrew | |
| brew install bash | |
| # Or build it from source... | |
| curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz | |
| tar xzf bash-4.2.tar.gz | |
| cd bash-4.2 | |
| ./configure --prefix=/usr/local/bin && make && sudo make install | |
| # Add the new shell to the list of legit shells |
| // Answering the "how many squares" problem (my answer = 40): | |
| // | |
| // http://media-geeks.com/special-features/how-many-squares-indeed/ | |
| // | |
| // HasCanvas: | |
| // | |
| // http://hascanvas.com/Counting-Squares | |
| // | |
| // GIF outptu: | |
| // |
| { config, pkgs, ... }: | |
| { | |
| require = [ | |
| <nixos/modules/programs/virtualbox.nix> | |
| ./hardware.nix | |
| ./monitors.nix | |
| # ./mailpile.nix | |
| ]; |
| #include <stdio.h> | |
| void DumpHex(const void* data, size_t size) { | |
| char ascii[17]; | |
| size_t i, j; | |
| ascii[16] = '\0'; | |
| for (i = 0; i < size; ++i) { | |
| printf("%02X ", ((unsigned char*)data)[i]); | |
| if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') { | |
| ascii[i % 16] = ((unsigned char*)data)[i]; |
| #!/bin/bash | |
| function test { | |
| MESSAGE=$1 | |
| RECEIVED=$2 | |
| EXPECTED=$3 | |
| if [ "$RECEIVED" = "$EXPECTED" ]; then | |
| echo -e "\033[32m✔︎ Tested $MESSAGE" | |
| else |
| extern crate rand; | |
| use rand::Rng; | |
| struct Bag { | |
| contents: Vec<char>, | |
| rng: rand::ThreadRng, | |
| } | |
| impl Bag { |
| #!/usr/bin/env bash | |
| # | |
| # gh-dl-release! It works! | |
| # | |
| # This script downloads an asset from latest or specific Github release of a | |
| # private repo. Feel free to extract more of the variables into command line | |
| # parameters. | |
| # | |
| # PREREQUISITES | |
| # |
Setup your user environment just the way you want with Nix.
Add packageOverrides to the attrset returned by your ${HOME}/.nixpkgs/config.nix (see my example above).
Then with one command you can setup your whole environment: nix-env -i desktop-mbbx6spp.
Then all you need is a simple ~/.bash_profile script like so: