Skip to content

Instantly share code, notes, and snippets.

ECHO OFF
REM This is to tell IronRuby where to find gems.
SET GEM_PATH=c:\ruby\lib\ruby\gems\1.8
@" C:\Program Files\IronRuby 0.9.2\bin\ir.exe" "c:\ruby\bin\cucumber" %* --no-color
@gregmalcolm
gregmalcolm / unixfu (ruby)
Created August 19, 2011 06:50
Unix Fu Presentation commands (ruby)
Presentation slides and list of commds are available at:
https://github.com/gregmalcolm/unix_for_programmers_demo
NOTE: I used a Mac with OSX for this demo. Other unixes will differ slightly in behavior!
===========
Preparation
===========
If you're running the scripts in my demo, make sure they're set to executable
@gregmalcolm
gregmalcolm / Unix Fu
Created September 26, 2011 05:03
Unix Fu
Ruby:
https://gist.github.com/1156222
Python:
https://gist.github.com/1241642
@gregmalcolm
gregmalcolm / mvim
Created October 28, 2012 16:57
Script for opening MacVim with gvim style file argument handling
#!/bin/bash
args="$*"
first="$1"
if [[ "$first" == "" ]]; then
# Open mvim at the current directory
args="."
else
if [[ ! -a "$first" ]]; then
# If the file doesn't exist yet, create it
@gregmalcolm
gregmalcolm / jump to project dir
Last active December 27, 2015 06:59
Unix Shell aliases for "bookmarking" a project dir and returning to it on demand
#!/bin/bash
# 'Save' the folder name
alias hhh='echo $PWD > ~/.projectdir'
# Return to the project folder
alias hh='projectdir=$(cat ~/.projectdir) && cd $projectdir'
@gregmalcolm
gregmalcolm / unixfu (python)
Created September 26, 2011 05:01
Unix Fu Presentation commands (python)
Presentation slides and list of commds are available at:
https://github.com/gregmalcolm/unix_for_programmers_demo
NOTE: I used a Mac with OSX for this demo. Other unixes will differ slightly in behavior!
Examples are all written in Python 2.7
===========
Preparation
===========
@gregmalcolm
gregmalcolm / debugging_c_with_llvm.md
Last active September 8, 2021 10:47
Debugging C with llvm's clang and lldb

Assuming you llvm installed (comes as standard on Mac OS Mavrick xtools)

Create a helloworld.c file:

  #include<stdio.h>
  
  int main()
  {
 int x=3;
@gregmalcolm
gregmalcolm / urinal_kata_rules
Created February 15, 2012 22:46
Urinal Kata Rules
Rule 1: Get as far away from the door as possible
Rule 2: Never stand next to another dude
Rule 2, Exception 1: There is a line at the door
Rule 2, Exception 2: Someone else has already broken Rule 2
Rule 3: Never stand next to two other dudes