Skip to content

Instantly share code, notes, and snippets.

@mchinen
mchinen / gist:7e2db41f5db7fa1ff146
Created May 29, 2014 22:22
backup git clean files before cleaning
# get the list of clean files
git status>cleanlist
# go in with an editor and delete everything before "Untracked files:\n (use "git add...") "
openuptexteditoranddeletethenon-untrackedfilelinesuntilwehavearealcommandtodothisautomatically
mkdir cleanbackupdir
sed -e "s/^\(.*\)$/mv \\1 cleanbackupdir/g"<cleanlist > cleanlistcmd
chmod +x cleanlistcmd
@mchinen
mchinen / gist:10437124
Last active August 29, 2015 13:58
WIP shell script to fix slightly off indentation of control statements (for mac)
#!/usr/bin/env bash
# Cleans up almost k&r formated control statements to nicer ones, e.g.
# if (something){ -> if (something)
# while(something){ -> while (something) {
#
# Probably doesn't work on lots of things and has holes and will destroy your computer, use at your own risk.
# It worked for me on two files
#
# Usage:
@mchinen
mchinen / gist:5719480
Created June 6, 2013 05:21
cococs2d-x macro to help with load save common cases for CCUserDefaults
//
// RSCCMacros.h
// doghouse
//
// Created by Michael Chinen on 13/05/17.
//
//
#ifndef doghouse_RSCCMacros_h
#define doghouse_RSCCMacros_h
@mchinen
mchinen / RSCCBMacros.h
Created June 6, 2013 05:17
cocos2d-x macros to help load/save/store from cocosbuilder ccbi files.
//
// RSCCBMacros.h
// doghouse
//
// Created by Michael Chinen on 13/04/10.
//
//
#ifndef doghouse_RSCCBMacros_h
#define doghouse_RSCCBMacros_h