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
| For each Ruby module/class, we have Ruby methods on the left and the equivalent | |
| Clojure functions and/or relevant notes are on the right. | |
| For clojure functions, symbols indicate existing method definitions, in the | |
| clojure namespace if none is explicitly given. clojure.contrib.*/* functions can | |
| be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master, | |
| ruby-to-clojure.*/* functions can be obtained from the source files in this | |
| gist. | |
| If no method symbol is given, we use the following notation: |
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
| #!/usr/bin/env -i bash | |
| /usr/bin/ruby -W0 ~/rubyscriptpath.rb |
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
| /===-_---~~~~~~~~~------____ | |
| |===-~___ _,-' | |
| -==\\ `//~\\ ~~~~`---.___.-~~ | |
| ______-==| | | \\ _-~` | |
| __--~~~ ,-/-==\\ | | `\ ,' | |
| _-~ /' | \\ / / \ / | |
| .' / | \\ /' / \ /' | |
| / ____ / | \`\.__/-~~ ~ \ _ _/' / \/' | |
| /-'~ ~~~~~---__ | ~-/~ ( ) /' _--~` | |
| \_| / _) ; ), __--~~ |
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 'json' | |
| require 'set' | |
| class ProfileConverter | |
| def initialize(profile, io=$stdout, time_threshold=0.01) | |
| @profile = profile | |
| @io = io | |
| @time_threshold = time_threshold | |
| 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
| function pomodoro { | |
| case $1 in | |
| start ) | |
| echo 'terminal-notifier -title "🍅 Pomodoro Done" -message "Starting short break…"' | at + 25 minutes &> /dev/null | |
| ;; | |
| break ) | |
| echo 'terminal-notifier -title "⌛ Short Break Done" -message "Start your next Pomodoro."' | at + 5 minutes &> /dev/null | |
| ;; | |
| esac |
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
| #source: http://unix.stackexchange.com/questions/7870/how-to-check-how-long-a-process-has-been-running | |
| ps -p 88966 -o etime= |
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
| echo -n -e "\x00\x01\x02" > o | |
| hexdump -C |
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
| Function::property = (prop, desc) -> | |
| Object.defineProperty @prototype, prop, desc | |
| class Person | |
| constructor: (@firstName, @lastName) -> | |
| @property 'fullName', | |
| get: -> "#{@firstName} #{@lastName}" | |
| set: (name) -> [@firstName, @lastName] = name.split ' ' | |
| p = new Person 'Leroy', 'Jenkins' |
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
| ### Keybase proof | |
| I hereby claim: | |
| * I am danielribeiro on github. | |
| * I am danielrb (https://keybase.io/danielrb) on keybase. | |
| * I have a public key whose fingerprint is C9B0 988E 78CC C29E 4EDC 727B 21E9 F012 A2F0 26D1 | |
| To claim this, I am signing this object: |
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
| #!/usr/bin/env ruby | |
| require 'open3' | |
| # Returns true if all files are EOF | |
| # | |
| def all_eof(files) | |
| files.find { |f| !f.eof }.nil? | |
| end |