Due to the high usage of this guide and the lack of comfort in Gist's commenting area, I decided to make a blog post out of this which you can find here:
http://blog.frd.mn/install-os-x-10-10-yosemite-in-virtualbox/
Due to the high usage of this guide and the lack of comfort in Gist's commenting area, I decided to make a blog post out of this which you can find here:
http://blog.frd.mn/install-os-x-10-10-yosemite-in-virtualbox/
| def add_cors_headers(response): | |
| response.headers['Access-Control-Allow-Origin'] = '*' | |
| if request.method == 'OPTIONS': | |
| response.headers['Access-Control-Allow-Methods'] = 'DELETE, GET, POST, PUT' | |
| headers = request.headers.get('Access-Control-Request-Headers') | |
| if headers: | |
| response.headers['Access-Control-Allow-Headers'] = headers | |
| return response | |
| app.after_request(add_cors_headers) |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;; Terminal notifier | |
| ;; requires 'sudo gem install terminal-notifier' | |
| ;; stolen from erc-notifier | |
| (defvar terminal-notifier-command (executable-find "terminal-notifier") "The path to terminal-notifier.") | |
| ; (terminal-notifier-notify "Emacs notification" "Something amusing happened") | |
| (defun terminal-notifier-notify (title message) |
| #!/bin/sh | |
| if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi | |
| exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit | |
| -- another way of waiting until an app is running | |
| on waitUntilRunning(appname, delaytime) | |
| repeat until my appIsRunning(appname) | |
| tell application "Messages" to close window 1 | |
| delay delaytime | |
| end repeat |
| import cStringIO | |
| import requests | |
| from xml.etree import cElementTree as ElementTree | |
| url = 'http://climate.weather.gc.ca/climateData/bulkdata_e.html' | |
| query = { | |
| # Spelling of keys is case-sensitive at the URL-processor end | |
| 'timeframe': 1, | |
| 'stationID': 6831, # Sandheads | |
| 'format': 'xml', |
| -- A Pandoc filter to use Pygments for Pandoc | |
| -- Code blocks in HTML output | |
| -- Nickolay Kudasov 2013 | |
| -- Requires Pandoc 1.12 | |
| import Text.Pandoc.Definition | |
| import Text.Pandoc.JSON (toJSONFilter) | |
| import Text.Pandoc.Shared | |
| import Data.Char(toLower) | |
| import System.Process (readProcess) |
| <!DOCTYPE html> | |
| <!-- By Jan Wrobel. See it working at: | |
| http://mixedbit.org/blog/2013/02/10/random_walk_illustrated_with_d3.html | |
| --> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
| <title>Random walk</title> |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |