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
| require 'benchmark/ips' | |
| module ExtraMath | |
| def self.build_math(attr_name) | |
| attr_name = attr_name.to_s | |
| class_eval %Q{ | |
| def #{attr_name}(x) | |
| x + x | |
| end | |
| } |
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 Browser to URL | |
| # ------------------------------------ | |
| unset gd | |
| gdCall(){ | |
| unalias gd | |
| open "http://bringvictory.com/" | |
| if [[ "$#" -ge 1 ]]; then | |
| echo "wat" |
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
| # ---------------------------------------------------------------------- | |
| # PROMPT | |
| # ---------------------------------------------------------------------- | |
| function parse_git_dirty { | |
| [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*" | |
| } | |
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/" | |
| } |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| limit = ARGV[0].to_i | |
| limit.times {|i| system "say #{limit-i} bottles of beer on the wall, #{limit-i} bottles of beer. Take one down, pass it around, #{limit-(i+1)} bottles of beer on the wall."} |
NewerOlder