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:
<?php | |
/** | |
* Lightens/darkens a given colour (hex format), returning the altered colour in hex format.7 | |
* @param str $hex Colour as hexadecimal (with or without hash); | |
* @percent float $percent Decimal ( 0.2 = lighten by 20%(), -0.4 = darken by 40%() ) | |
* @return str Lightened/Darkend colour as hexadecimal (with hash); | |
*/ | |
function color_luminance( $hex, $percent ) { | |
// validate hex string |
$ cd ~ | |
$ sudo curl -sS https://getcomposer.org/installer | sudo php | |
$ sudo mv composer.phar /usr/local/bin/composer | |
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer | |
then you can run | |
$ sudo composer install |
#!/usr/bin/env bash | |
# | |
# This is sp, the command-line Spotify controller. It talks to a running | |
# instance of the Spotify Linux client over dbus, providing an interface not | |
# unlike mpc. | |
# | |
# Put differently, it allows you to control Spotify without leaving the comfort | |
# of your command line, and without a custom client or Premium subscription. | |
# |
alias roulette='[ $[ $RANDOM % 6 ] == 0 ] && rm -f $(shuf -n1 -e *) && echo "BOOM" || echo *Click*' |
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository | |
$ git ls-files | xargs wc -l |
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
}; | |
NodeList.prototype.__proto__ = Array.prototype; |
# AppData\Roaming\Sublime Text 3\Packages\User\default_syntax.py | |
import sublime, sublime_plugin | |
class DefaultSyntaxCommand(sublime_plugin.EventListener): | |
def on_new(self, view): | |
# Replace <Language> with desired default language | |
# Check in AppData\Local\Sublime Text 3\Cache | |
view.set_syntax_file('Packages/<Language>/<Language>.tmLanguage') |
# Version key/value should be on his own line | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g') | |
echo $PACKAGE_VERSION |
#!/bin/bash | |
# Log in into the box | |
vagrant ssh | |
# VirtualBox syncs host time with guest, so we need to shut off VBox Guest Additions first | |
sudo service vboxadd-service stop | |
# Now you can set any date and time | |
sudo date -s "2020-10-01 10:25:00" |