Skip to content

Instantly share code, notes, and snippets.

@RobertAudi
RobertAudi / ideavimrc
Created July 28, 2014 08:46
System clipboard support in IdeaVim
nnoremap yy "+yy
vnoremap y "+y
nnoremap p "+p
vnoremap p "+p
nnoremap P "+P
vnoremap P "+P
@RobertAudi
RobertAudi / moc-on-osx.md
Last active September 30, 2023 19:54
This is a walkthrough on how to install the MOC command-line music player on OS X. The procedure was tested in Mountain Lion.

MOC on OS X

I waited for years for a Homebrew formula for MOC. I finally found one today, but it didn't work for me. So I decided to try to compile it from source.

Requirements

Here is a list of requirements, taken directly from the MOC README:

@RobertAudi
RobertAudi / osascript_shebang.sh
Created June 30, 2010 03:56
AppleScript shebang
#!/usr/bin/osascript
@RobertAudi
RobertAudi / vm-start
Last active June 30, 2022 09:04
Parallels CLI helpers
#!/usr/bin/env zsh
if ! type prlctl &> /dev/null ; then
print -u 2 -- "command not found: prlctl"
print -u 2 -- "Parallels might not be installed"
return 1
fi
if ! type fzf &> /dev/null ; then
print -u 2 -- "command not found: fzf"
@RobertAudi
RobertAudi / array_validator.en.yml
Last active March 27, 2022 15:33
Rails array validator
en:
activerecord:
errors:
messages:
array:
default: "has invalid values: %{invalid_values}"
absence: "has non-blank values: %{invalid_values}"
presence: "has blank values: %{invalid_values}"
format: "has invalid values: %{invalid_values}"
exclusion: "has reserved values: %{invalid_values}"
@RobertAudi
RobertAudi / rpc-spec.md
Created September 14, 2014 12:11
Transmission RPC Spec. Converted to Markdown, 'cause it's unreadable otherwise...
  1. Introduction ===============

This document describes a protocol for interacting with Transmission sessions remotely.

1.1 Terminology

The JSON terminology in RFC 4627 is used.

@RobertAudi
RobertAudi / chart_colors.txt
Last active October 25, 2021 14:20 — forked from there4/chart_colors.txt
[CSS] Chart Color Collection
#3366CC
#DC3912
#FF9900
#109618
#990099
#3B3EAC
#0099C6
#DD4477
#66AA00
#B82E2E
@RobertAudi
RobertAudi / 01-safe-download.rb
Created May 4, 2021 08:06 — forked from janko/01-safe-download.rb
A safe way in Ruby to download a file to disk using open-uri (with/without comments)
require "open-uri"
require "net/http"
Error = Class.new(StandardError)
DOWNLOAD_ERRORS = [
SocketError,
OpenURI::HTTPError,
RuntimeError,
URI::InvalidURIError,
@RobertAudi
RobertAudi / Int+Extenstion.swift
Last active May 2, 2020 12:07 — forked from gbitaudeau/Int+Extenstion.swift
Convert large numbers to smaller format
import Foundation
extension Int {
func abbreviate() -> String {
typealias Abbrevation = (threshold: Double, divisor: Double, suffix: String)
let abbreviations: [Abbrevation] = [
(0, 1, ""),
(1000.0, 1000.0, "K"),
(100_000.0, 1_000_000.0, "M"),
@RobertAudi
RobertAudi / example.rb
Last active March 23, 2020 14:53 — forked from redconfetti/example.rb
Custom Rspec matcher for checking class for constant, with optional class type.
# frozen_string_literal: true
class ExampleClass
PI = 3.14159265359
end