Skip to content

Instantly share code, notes, and snippets.

<!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 / 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..."
## 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 }
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:
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 <[email protected]>, Michal Papis <[email protected]> [https://rvm.beginrescueend.com/]"
updated: "20 days 19 hours 19 minutes 51 seconds ago"
$ rvm list
rvm rubies
ruby-1.8.6-p420 [ i686 ]
ruby-1.8.7-p357 [ i686 ]
ruby-1.9.1-p431 [ i386 ]
ruby-1.9.2-p290 [ x86_64 ]
=* ruby-1.9.3-p0 [ x86_64 ]
/Applications/TextMate.app/Contents/SharedSupport/Support/bin/CocoaDialog.app/Contents/MacOS:/Users/slippyd/bin:$PATH:/Applications/TextMate.app/Contents/SharedSupport/Support/bin
/Users/slippyd/.rvm/gems/ruby-1.9.3-p0/bin:/Users/slippyd/.rvm/gems/ruby-1.9.3-p0@global/bin:/Users/slippyd/.rvm/rubies/ruby-1.9.3-p0/bin:/Users/slippyd/.rvm/bin:/Users/slippyd/bin:/usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin
# running:
require 'redcarpet'; puts Redcarpet::Markdown.new(Redcarpet::Render::HTML).render('# hi #')
# gives me:
/Users/slippyd/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- redcarpet (LoadError)
from /Users/slippyd/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from -:1:in `<main>'
@capnslipp
capnslipp / ghfmd.rb
Created February 19, 2012 03:03
Markdown Renderer, avec GitHub-Flavor™
#!/usr/bin/env ruby
# ^ 1.8.x or 1.9, folks!
require 'rubygems'
require File.expand_path('./md_izer', File.dirname(__FILE__))
render_options = {
:fenced_code_blocks => true,
:autolink => true,
:space_after_headers => true