Skip to content

Instantly share code, notes, and snippets.

Greg Malcolm gregmalcolm

Block or report user

Report or block gregmalcolm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gregmalcolm
gregmalcolm / debugging_c_with_llvm.md
Last active Aug 14, 2019
Debugging C with llvm's clang and lldb
View debugging_c_with_llvm.md

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 / jump to project dir
Last active Dec 27, 2015
Unix Shell aliases for "bookmarking" a project dir and returning to it on demand
View jump to project dir
#!/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 / mvim
Created Oct 28, 2012
Script for opening MacVim with gvim style file argument handling
View mvim
#!/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
View 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
View Unix Fu
Ruby:
https://gist.github.com/1156222
Python:
https://gist.github.com/1241642
@gregmalcolm
gregmalcolm / unixfu (python)
Created Sep 26, 2011
Unix Fu Presentation commands (python)
View unixfu (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 / unixfu (ruby)
Created Aug 19, 2011
Unix Fu Presentation commands (ruby)
View unixfu (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
View icucumber
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
You can’t perform that action at this time.