This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #time | |
| (* | |
| Without optimization | |
| Real: 00:00:00.765, CPU: 00:00:00.765, GC gen0: 763, gen1: 1, gen2: 0 | |
| Real: 00:00:00.781, CPU: 00:00:00.765, GC gen0: 763, gen1: 0, gen2: 0 | |
| Real: 00:00:00.767, CPU: 00:00:00.765, GC gen0: 762, gen1: 0, gen2: 0 | |
| With optimization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Microsoft.FSharp.Quotations | |
| open Microsoft.FSharp.Quotations.Patterns | |
| open Microsoft.FSharp.Quotations.DerivedPatterns | |
| let prop (expr:Quotations.Expr) = | |
| match expr with | |
| | Lambda(_, PropertyGet(_, prop, _)) -> | |
| match prop.GetCustomAttributes(typeof<BsonElementAttribute>, true) with | |
| | [| attr |] -> (attr :?> BsonElementAttribute).ElementName | |
| | _ -> prop.Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| formatDateTime: function(dateTime) { | |
| var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); | |
| var hour = dateTime.getHours(); | |
| var postfix; | |
| if (hour < 12) { | |
| postfix = "AM"; | |
| } else { | |
| postfix = "PM"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Shell options | |
| setopt autocd # automatically cd to a directory if not cmd | |
| setopt autopushd # automatically pushd directories on dirstack | |
| setopt nopushdsilent # print dirstack after each cd/pushd | |
| setopt pushdignoredups # don't push dups on stack | |
| setopt correct # try to correct spelling... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
| PROMPT='%{$fg[green]%}%2~ \ | |
| $(git_prompt_info)\ | |
| %{$fg[red]%}%(!.#.$)%{$reset_color%} ' | |
| PROMPT2='%{$fg[red]%}\ %{$reset_color%}' | |
| RPS1="" | |
| #'%{$fg[blue]%}%~%{$reset_color%} ${return_code} ' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[yellow]%}(" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo aptitude install build-essential | |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install |