Skip to content

Instantly share code, notes, and snippets.

View hamstu's full-sized avatar
🤩

Hamish Macpherson hamstu

🤩
View GitHub Profile
@noisysocks
noisysocks / look-away.sh
Created January 30, 2018 04:21
Reminder to rest your eyes every 20 minutes
#!/bin/bash
# A little script to remind you to look away from your screen every so often.
#
# To install:
# 1. Save this script somewhere
# 2. Make the script executable: chmod +x /path/to/the/script.sh
# 3. crontab -e
# 4. Add this entry: */20 9-17 * * * /path/to/the/script.sh
@hharnisc
hharnisc / Add Hyper(term)
Last active October 31, 2016 16:29
Nixos Config
nix-channel --add http://nixos.org/channels/nixpkgs-unstable
nix-channel --update
nix-channel -i hyper
@rap2hpoutre
rap2hpoutre / laravel-forge-deploy.sh
Last active March 28, 2024 15:45
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
fi
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
fi
angular.module('lib.decorators', [])
.config(['$provide', function($provide){
$provide.decorator('$rootScope', ['$delegate', function($rootScope) {
var _proto
, _new
, nextUid = function() {
return ++$rootScope.$id;
}
, Scope = function() {
@dwayne
dwayne / 0-intro.md
Last active February 28, 2023 22:10
My notes from the book "Authority by Nathan Barry".

A Step-By-Step Guide To Self-Publishing

Become an expert, build a following, and gain financial independence.

by Nathan Barry

Table of Contents

@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active December 1, 2023 04:55
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@kevinSuttle
kevinSuttle / app.js
Last active February 26, 2024 07:02
Gulp, BrowserSync, Sass, Autoprefixer, Nodemon
var express = require('express');
var app = express();
var router = express.Router();
var hbs = require('hbs');
app.set('view engine', 'html');
app.engine('html', hbs.__express);
app.use(express.json());
app.use(express.urlencoded());
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@paulirish
paulirish / gist:5558557
Last active April 18, 2024 14:32
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else