2013-04-02, 10:28pm
Below is my feeble attempt to convert the moon-phase Ruby script into Bash.
Unfortunately, this doesn't work for two reasons:
- I don't know shell scripting very well.
- Bash arithmetic can't handle anything other than integers.
| (* | |
| Set Mail.app Sender | |
| By Matthew McVickar | |
| Description: | |
| Mail.app's AppleScript library does not allow access to the properties | |
| of the outgoing message object. The only way to change those properties | |
| is by GUI scripting. This particular script changes the sender of the | |
| message. If you have, for example, personal and work email addresses |
| tell application "Finder" | |
| tell application "System Events" to set current_user to name of current user | |
| set AppleScript's text item delimiters to "/Users/" & current_user | |
| try | |
| return "~" & text item 2 of POSIX path of (target of front Finder window as text) | |
| on error | |
| return POSIX path of (target of front Finder window as text) | |
| end try | |
| end tell |
| # Get the current phase of the moon for use as prompt | |
| # Adapted from: http://wan.pengganas.net/entry/calculating-phase-of-moon-in-ruby | |
| function moonphase() { | |
| /usr/bin/env ruby <<-EORUBY | |
| # Convert a date to Julian. | |
| def julian(year, month, day) | |
| a = (14-month)/12 | |
| y = year+4800-a | |
| m = (12*a)-3+month |
2013-04-02, 10:28pm
Below is my feeble attempt to convert the moon-phase Ruby script into Bash.
Unfortunately, this doesn't work for two reasons:
Since I made my first bot, I haven't been able to stop thinking about bot ideas.
Also, I have a collection of links to tutorials, resources, inspiration.
I hereby claim:
To claim this, I am signing this object:
| # Browsers that we support. | |
| # https://github.com/browserslist/browserslist | |
| last 1 version and > .1% and not dead | |
| not OperaMini all |
This is a set of PHP scripts to fetch the most-viewed pages from a Google Analytics property.
You will need to set up API access for this project in the Google Cloud Platform Console and create an authorization JSON file.