Skip to content

Instantly share code, notes, and snippets.

~/Desktop/ffmpeg -i $1 -acodec copy -vcodec copy -f mov $1.mov
@benmills
benmills / _whats_next.rb
Last active March 4, 2016 20:11
Simple command line tool to either show your next event and location or open the hangout for your next meeting.
require 'time'
require 'uri'
require 'net/http'
require 'net/https'
require "json"
CLIENT_ID = "google client id"
CLIENT_SECRET = "google client secret"
# Use the bash script to generate a refreh token
if exists("g:loaded_vimux") || &cp
finish
endif
let g:loaded_vimux = 1
command -nargs=* VimuxRunCommand :call VimuxRunCommand(<args>)
command VimuxRunLastCommand :call VimuxRunLastCommand()
command VimuxCloseRunner :call VimuxCloseRunner()
command VimuxZoomRunner :call VimuxZoomRunner()
command VimuxInspectRunner :call VimuxInspectRunner()

Keybase proof

I hereby claim:

  • I am benmills on github.
  • I am benmills (https://keybase.io/benmills) on keybase.
  • I have a public key whose fingerprint is C5D4 5E64 9497 2132 49F5 0A59 C8EE D6C9 8AEC 7398

To claim this, I am signing this object:

window.onload = function () {
var loadScript = function (scriptUrl, callback) {
var script = document.createElement("script");
script.src = scriptUrl;
script.onload = callback;
document.body.appendChild(script);
};
loadScript("http://localhost:3002/a.js", function () {
loadScript("http://localhost:3002/b.js", function () {
@benmills
benmills / bspwm_dzen.sh
Created April 18, 2013 04:50
Simple dzen panel for bspwm
#!/bin/bash
while true; do
if read line < $PANEL_FIFO; then
wm_status=""
IFS=':' read -a array <<< "$line"
for element in "${array[@]}"; do
if [[ $element =~ ^D ]]; then
wm_status="$wm_status ^fg(white)${element:1}"
elif [[ $element =~ ^d ]]; then
@benmills
benmills / gist:4542541
Created January 15, 2013 22:02
Rename someone in a chat room with applescript
set CR to ASCII character of 13
tell application "System Events"
tell application "Adium" to activate
keystroke "/nick <your nick here>"
keystroke CR
end tell
@benmills
benmills / checkmail
Created January 15, 2013 15:50
Check for new mail and unread mail count with fetchmail
#!/bin/bash
if [ -z $2 ]; then
count_file=/tmp/unread_count
else
count_file=$2
fi
/usr/bin/fetchmail --check -u $1 2>/dev/null | while read line; do
total=$(echo $line | cut -d" " -f1)
@benmills
benmills / finch_notification.pl
Last active February 24, 2023 18:20
This is a finch plugin that sends notifications when new messages are received
use Purple;
use Data::Dumper;
%PLUGIN_INFO = (
perl_api_version => 2,
name => "Growl",
version => "0.1",
summary => "Use growl notification for messages.",
description => "Use growl notification for messages.",
author => "daniel\@netwalk.org",
url => "http://pidgin.im",
@benmills
benmills / .gitconfig
Created January 2, 2013 21:21
git sed. usage: git sed <pattern to replace> <pattern to replace with>
sed = !git grep -l $1 | xargs sed -i "" -e "s/$1/$2/g" && echo > /dev/null