Skip to content

Instantly share code, notes, and snippets.

@fent
fent / keybase.md
Created May 18, 2018 20:08
keybase.md

Keybase proof

I hereby claim:

  • I am fent on github.
  • I am fent (https://keybase.io/fent) on keybase.
  • I have a public key ASApFIKpv-SF5rAxV6-JbE4elpe4Xo_i8cipgJx8cQbfjQo

To claim this, I am signing this object:

@fent
fent / README.md
Last active November 26, 2022 08:49
A bunch of greasemonkey scripts to fullscreen video sites
@fent
fent / ec2-server
Last active January 8, 2018 04:06
Returns a list of servers matching a pattern.
#!/bin/bash
h=$1
if [ -z $1 ]
then
echo "Usage: `basename $0` <host pattern>"
exit 1
fi
ec2-host | grep $h | awk '{split($0, a, "\t"); print a[2]}' | awk '{x = (!x) ? $0 : x "\n" $0;} END {print x;}'
@fent
fent / youtube_next.applescript
Last active May 13, 2022 00:49
Scripts for controlling youtube videos. Now maintained at https://github.com/fent/dotfiles/tree/master/scripts
# If in a playlist, play the next video.
tell application "Google Chrome"
repeat with t in tabs of windows
tell t
if URL starts with "http://www.youtube.com/watch" or URL starts with "https://www.youtube.com/watch" then
execute javascript "
var player =
document.getElementById('movie_player') ||
document.getElementsByTagName('embed')[0];
var next = document.getElementsByClassName('yt-uix-button-icon-playlist-bar-next')[0];
@fent
fent / gist:1439081
Last active January 8, 2018 04:02
randexp examples
var RandExp = require('randexp'); // must require on node
// supports grouping and piping
new RandExp(/hello+ (world|to you)/).gen();
// => hellooooooooooooooooooo world
// custom character sets and ranges and references
new RandExp(/<([a-z]\w{0,20})>foo<\1>/).gen();
// => <m5xhdg>foo<m5xhdg>