Skip to content

Instantly share code, notes, and snippets.

View sgonyea's full-sized avatar

Scott Gonyea sgonyea

  • Google
  • Mountain View, CA
View GitHub Profile
#!/bin/sh
# Convert RTF contents of clipboard to HTML
osascript -e 'the clipboard as «class RTF »' | \
perl -ne 'print chr foreach unpack("C*",pack("H*",substr($_,11,-3)))' | \
textutil -format rtf -convert html -stdin -stdout | \
pandoc -f html -t markdown | \
pbcopy
#!/bin/sh
# Convert RTF contents of clipboard to HTML
osascript -e 'the clipboard as «class RTF »' | \
perl -ne 'print chr foreach unpack("C*",pack("H*",substr($_,11,-3)))' | \
textutil -format rtf -convert html -stdin -stdout | \
ruby -ne '@found=true if $_ =~ /<body>/; next unless @found; exit if $_ =~ /<\/body>/; puts $_;' | \
grep -v "</body>" | \
pbcopy
#!/bin/sh
# This script converts RTF text on the OS X clipboard to HTML.
osascript -e 'the clipboard as «class RTF »' | \
perl -ne 'print chr foreach unpack("C*",pack("H*",substr($_,11,-3)))' | \
textutil -format rtf -convert html -stdin -stdout | \
ruby -ne '@found=true if $_ =~ /<body>/; next unless @found; puts $_; exit if $_ =~ /<\/body>/' | \
grep -v "<body>" | \
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@sgonyea
sgonyea / gist:3896429
Created October 15, 2012 23:52 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -n "$PS1" ]] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
Here are the trace commands
If you enter this on the erlang console
dbg:tracer().
dbg:p(all,[c,sos,sol]).
dbg:tpl(riak_kv_pb_socket, init, [{'_',[],[{message,{return_trace}}]}]).
dbg:tpl(riak_kv_pb_socket, process_message, [{'_',[],[{message,{return_trace}}]}]).
dbg:tpl(riak_kv_pb_socket, send_msg, [{'_',[],[{message,{return_trace}}]}]).
#import <Foundation/Foundation.h>
@interface Communicator : NSObject <NSStreamDelegate> {
@public
NSString *host;
int port;
}
- (void)setup;