Skip to content

Instantly share code, notes, and snippets.

@RobertAudi
RobertAudi / removexattr.c
Created November 27, 2010 15:28
Little script to make all the files under a certain directory safe on OS X.
/***********************************************************************
* Little script to make all the files under a certain directory safe. *
* Works only on Mac OS X. Tested on 10.5 and 10.6 *
* *
* Written by bojo (Bo Johansson) in a comment on Mac OS X Hint: *
* http://hints.macworld.com/article.php?story=20071029151619619 *
***********************************************************************/
/* Compile by
* gcc -O2 -Wall removexattr.c -o removexattr
@RobertAudi
RobertAudi / please.rb
Created December 2, 2010 12:50
`pmset schedule` wrapper to easily schedule OS X to sleep, shutdown, etc
#!/usr/bin/env ruby
# NOTES:
# - This script only works on OS X.
# - This script was only tested with ruby 1.9.2 using
# the aaronh-chronic gem. If the chronic gem is used
# instead, this script will not work (unless the chronic
# gem was updated to work with ruby 1.9.2).
require 'rubygems'
@RobertAudi
RobertAudi / .rvmrc
Created February 15, 2011 22:42 — forked from wayneeseguin/0_notes.txt
RVM Project Environment done the right way
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
environment_id="ruby-1.9.2-p136"
#
# First we attempt to load the desired environment directly from the environment
@RobertAudi
RobertAudi / gist:840197
Created February 23, 2011 09:03
Vim OS Check
" -OS-Check---------------------------------------------------------------------
function! MySys()
if has("win32")
return "win32"
elseif has("mac") || has("macunix")
return "mac"
elseif has("unix")
return "unix"
else
return "unix"
@RobertAudi
RobertAudi / C.rb
Created March 11, 2011 18:36 — forked from ox/C.rb
#!/usr/bin/env ruby
# Version (0.79)
# Created by Artem Titoulenko (artem.titoulenko@gmail.com)
# clock in application. I'm tired of counting.
# C.rb -- Time keeping script.
# Call with no params to clock in/out
# Params:
# ? : are you clocked in? check
# log : peek at the work log
class String
def humanize
self.split(/[-_]/).map {|w| w.capitalize }.join(' ')
end
end
@RobertAudi
RobertAudi / tasks.rb
Created November 17, 2011 04:38
Something I hacked in an hour tonight. Disgusting code but useful output.
#!/usr/bin/env ruby
# encoding: utf-8
COLORS_ENABLED = TRUE
VALID_TASKS = {
"TODO" => /TODO[\s,:]+(\S.*)$/,
"FIXME" => /FIX ?ME[\s,:]+(\S.*)$/,
"CHANGED" => /CHANGED[\s,:]+(\S.*)$/,
"NOTE" => /NOTE[\s,:]+(\S.*)$/
@RobertAudi
RobertAudi / NSString+RAInflections.h
Last active December 29, 2015 12:22
NSString category containing an Objective-C port of @henrik's slugalize helper method: https://github.com/henrik/slugalizer?source=c
//
// Created by Robert Audi on 07/04/13.
// Updated on 08/21/14
//
#import <Foundation/Foundation.h>
@interface NSString (RAInflections)
- (NSString *)slugalize;
KEYWORDS="FIXME:|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
@RobertAudi
RobertAudi / Install imagemagick
Created July 15, 2013 17:42
Automatically Create Icons for iOS Apps. Full credits to Yuya Kitajima (aka @yuyak on Github) for this rake task, shared as a Coderwall tip. https://coderwall.com/p/otmx2g
brew install imagemagick