Platform specific build event

Sometimes you need to build .net solution/project on different platforms (for example while developing xamarin based application). In that case pre/post build events may contain platform specific instructions. To handle this situation you can use ‘Condition’ attribute and ‘OS’ variable, for example, like this: <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' "> <!-- windows specifics --> copy $(TargetPath) $(ProjectDir)../Assemblies /Y </PostBuildEvent> <PostBuildEvent Condition=" '$(OS)' == 'Unix' "> <!-- *nix, mac specifics --> cp -f $(TargetPath) $(ProjectDir).

Git log aliases

Here are some usefull git aliases which i use on a daily basis: Output samples are generated using clojure repository List of one line commits ls = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset' List of commits with changed files ll = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset' --decorate --numstat List of commits without colors lnc = log --pretty=format:"%h\\ %s\\ [%cn]" Commits with dates ldt = log --all --pretty=format:'%Cred%h%Creset %Cgreen%ad%Creset -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset' Commits with short dates

Stackoverflow reputation problem

Some time ago i wrote gist which described how to install ghc from source on ubuntu. Today i see question on stackoverflow.com connected with my gist. I have fixed gist immediately and think about leaving comment to person who had some difficulties with it. I log on using google account and try to leave comment and … i cant do it because my repuration is too low (this is just new account).

Mac os environment variables

Suppose you install some program into your home directory (i had installed mercurial from source). To use it you have to patch PATH variable. To achieve this, you needed to modify, for example, local .profile file (its undesirable to modify global config like etc/profile). So your .profile file contains something like this: export PATH=$ADDITIONAL_PATH:$PATH It wokrs great from terminal. But you cant use variable defined such way from programs launched throught spotlight, because all apps started from gui interface of Mac Os has its own list of environemnt variables (independent from terminal).