Skip to content

Instantly share code, notes, and snippets.

ruby-1.9.3-p0:
system:
uname: "Darwin silverdelicious.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
version: "rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]"
updated: "20 days 19 hours 19 minutes 51 seconds ago"
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
system:
system:
uname: "Darwin silverdelicious.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
## encoding: utf-8
## Alex D's solution (1st revision) to http://stackoverflow.com/questions/5390537/best-practices-and-implementation-for-macro-and-class-level-accessor-methods/9019388#9019388
module MacroMethods
private
def full_name(full_name)
# non-trivial, one-time-only set-up code exists here in actual usage
self.class_eval { const_set :FULL_NAME, full_name.to_s }
@capnslipp
capnslipp / group-permissify.sh
Created April 5, 2012 17:28
*nix Group Permissionify (if it works for me, it should work for my buddies too)
#!/usr/bin/env bash
shared_group="$1" # e.g.: 'admin'
group_exists=`grep "^$shared_group:" /etc/group`
if [ -z $group_exists ]; then
echo "Error: There seems to be no group by the name of \"$shared_group\" (totally checked out your '/etc/group' file)."
else
echo "Permissifying within ./ directory..."
<!DOCTYPE html>
<html>
<head>
<title>rendered markdown</title>
<meta charset="utf-8"/>
<style type="text/css" media="all">
a { text-decoration: underline; }
</style>
</head>
<body>
@capnslipp
capnslipp / gist:2639182
Created May 8, 2012 20:54
Markdown Rendering Tests

Fixed-Width Formatting

backticks:
this should have _emphahsees_
this should have **teh strongs**

<code> tag:
this should have emphahsees
this should have teh strongs

@capnslipp
capnslipp / git-lf
Last active June 28, 2023 19:37
Lost & Found for Git: tag all dangling commits, for those wonderful “oh shit” moments (and cleanup those tags after recovered the lost path)
#!/usr/bin/env bash
# Tags all dangling commits in a Git repo (for the wonderful “oh shit” moments).
# @from: https://gist.github.com/capnslipp/2656868
git fsck --lost-found #--no-reflogs --full --root --cache --tags --unreachable
find '.git/lost-found/commit' -type f | while read i; do
commit_sha=`cat "$i"`
git tag -f "git-lf/commit/$commit_sha" $commit_sha
done

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
HOMEBREW_VERSION: 0.9.2
HEAD: f46569ecdbeef804c5ec38caa0d7464afda6e464
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit nehalem
OS X: 10.6.8-i386
Xcode: 3.2.6
GCC-4.0: build 5494
GCC-4.2: build 5666
LLVM: build 2335
@capnslipp
capnslipp / where_am_i.rb
Created October 18, 2012 22:42
where_am_i: tiny Ruby debugging extension to sum up the current location in the object graph
## encoding: utf-8
## author: Slipp Douglas Thompson <http://slippyd.com/>
class Object
  # notice: it's a verbal statement
  def where_i_am
    object_index = self.object_id
    class_name = self.class.name
    
    class_lineage = begin