Skip to content

Instantly share code, notes, and snippets.

View nikolaiwarner's full-sized avatar
🌱
punk 2 punk

Nick Warner nikolaiwarner

🌱
punk 2 punk
View GitHub Profile
@nikolaiwarner
nikolaiwarner / bassdrive-cli
Last active August 17, 2021 17:42
Play Bassdrive on the CLI
alias bassdrive="vlc --intf rc http://www.bassdrive.com/bassdrive3.m3u"
alias kexp="vlc --intf rc https://kexp-mp3-128.streamguys1.com/kexp128.mp3"
@nikolaiwarner
nikolaiwarner / fb_random_comment_picker.js
Last active August 10, 2016 20:27
bookmarklet to choose a random facebook comment
// <3 Copy the code below and save as a bookmark. Then click the bookmark while on FB after loading a page with some comments:
javascript:(function(){
var comments = document.getElementsByClassName("UFICommentContent");
var randomComment = comments[Math.floor(Math.random() * comments.length)];
var randomCommentName = randomComment.getElementsByClassName("UFICommentActorName")[0].textContent;
var randomCommentBody = randomComment.getElementsByClassName("UFICommentBody")[0].textContent;
alert(randomCommentName + ": " + randomCommentBody);
### Keybase proof
I hereby claim:
* I am nikolaiwarner on github.
* I am nickwarner (https://keybase.io/nickwarner) on keybase.
* I have a public key whose fingerprint is 4BE2 2BBF 5ACD 4D7F 5806 53C7 F15F 76F8 94D3 7BE5
To claim this, I am signing this object:
#!/bin/sh
### BEGIN INIT INFO
# Provides: shairplay
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Shairplay
# Description: Shairplay: Apple airplay and raop protocol server
### END INIT INFO
@nikolaiwarner
nikolaiwarner / move-to-dropbox-folder-action.scpt
Created May 10, 2012 14:22
OSX Folder Action Applescript to toss new files into Dropbox
on adding folder items to this_folder after receiving these_items
try
set dropbox_folder to (path to home folder as text) & "Dropbox:"
set move_this to false
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
display dialog "Stray file was found. Move to Dropbox?" buttons {"No", "Yes"} default button 2
if the button returned of the result is "Yes" then
@nikolaiwarner
nikolaiwarner / convert_all_erb_files_to_haml_et_al_via_thor.thor
Created February 3, 2011 02:20
Thor scripts for bulk converting files to haml and sass
# 2011 Nikolai Warner <n@nikolaiwarner.com>
# Originally inspired by divoxx at http://snippets.dzone.com/posts/show/5449
class ConvertAll < Thor
desc "to_haml [path]", "convert all erb files to haml in [path]"
def to_haml(path='.')
delete_when_done = yes?("Remove erb files after conversion? (y/n): ")
Dir["#{path}/**/*.erb"].each do |file|
`html2haml -rx #{file} #{file.gsub(/\.erb$/, '.haml')}`
@nikolaiwarner
nikolaiwarner / css rotation and masking example
Created June 7, 2010 21:39
css rotation and masking example
<html>
<head>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load("jquery", "1.4.2");
</script>
<style>
body {