Here's a step-by-step to get started scripting Minecraft with Python on Mac OSX
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
; update as needed | |
chrome := userprofile "\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" | |
iexplorer := "C:\Program Files (x86)\Internet Explorer\iexplore.exe" | |
; Open Gmail Inbox | |
#^e:: OpenChromeUrl("http://mail.google.com/mail") | |
; Compose Gamil Email | |
#^c:: OpenChromeUrl("https://mail.google.com/mail/?view=cm&fs=1&tf=1") |
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
// A simple hello world microservice | |
// Click "Deploy Service" to deploy this code | |
// Service will respond to HTTP requests with a string | |
module['exports'] = function helloWorld (hook) { | |
// hook.req is a Node.js http.IncomingMessage | |
var host = hook.req.host; | |
// hook.res is a Node.js httpServer.ServerResponse | |
// Respond to the request with a simple string | |
hook.res.end(host + ' says, "Hello there world!"'); | |
}; |
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
module['exports'] = function echoHttp (hook) { | |
var request = require('request'); | |
var mongodb = require('mongodb'); | |
paths = { | |
'requestbin': hook.env['manpow-homeland-hubspot-proxy-requestbin-url'], | |
'moneybug': "http://homeland2.nwaoftexas.com/hubspot/money-bug-hook", | |
'nwa': 'https://homeland.nwaoftexas.com/nwa/import/investor-lead-data', | |
'testnwa': 'http://heartland.nwaoftexas.com/money-bug/collect-newwestern', | |
'testmb': "http://heartland.nwaoftexas.com/money-bug/collect" } |
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
# convert yaml to json | |
# pip3 install pyyaml | |
# http://pyyaml.org/wiki/PyYAMLDocumentation | |
# py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml | |
# gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73 | |
import yaml, json, sys | |
sys.stdout.write(json.dumps(yaml.load(sys.stdin), sort_keys=True, indent=2)) |
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 python3 | |
# convert json to yaml | |
# http://pyyaml.org/wiki/PyYAMLDocumentation | |
# python3 json2yaml.py < ~/code/manpow/moneybug/mbuploader/support/offices.json | |
# gist https://gist.github.com/noahcoad/46909253a5891af3699580b8f17baba8 | |
import yaml, json, sys | |
sys.stdout.write(yaml.dump(json.load(sys.stdin))) |
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
import platform, re, subprocess, os.path, logging; | |
log = logging.getLogger('simple_example') | |
log.setLevel(logging.INFO) | |
# get local system serial identifier | |
# tested for Raspberry Pi and Mac OSX | |
def get_serial(): | |
log.info("getting serial number") | |
ptn = None |
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
<dict> | |
<key>name</key> | |
<string>Noah Text: header</string> | |
<key>scope</key> | |
<string>plaintxt.header</string> | |
<key>settings</key> | |
<dict> | |
<key>foreground</key> | |
<string>#a6e22e</string> | |
</dict> |
Due to GPL limitations, OSX ships with bash v3.2.57. As of writing this the current version is bash v5.0.2. bash v4 and beyond support unicode characters, and much more.
Check current bash version with:
echo $BASH_VERSION
To upgrade use Homebrew