- Download & install VirtualBox for OS X
- Acquire a Windows 10 environment. Easiest way:
- Use a maintained fork of ievms, like this:
curl -s https://raw.githubusercontent.com/amichaelparker/ievms/master/ievms-node.sh | env IEVMS_VERSIONS="EDGE" bash
- Start Windows instance in VirtualBox.
- The password for the default Windows IEUser is
Passw0rd!
(mentioned here)
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
#!/bin/bash | |
set -e | |
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/ "$1" stdout -l eng | xml esc) | |
hex=$((cat <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
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
// PhantomJS program to generate a PNG based on stdin (e.g. SVG image) | |
// Example: curl http://upload.wikimedia.org/wikipedia/commons/f/fd/Ghostscript_Tiger.svg | phantomjs png.js > test.png && open test.png | |
/* | |
From Flask/Python: | |
import os | |
from subprocess import Popen, PIPE, STDOUT | |
p = Popen(['phantomjs', '%s/png.js' % os.path.dirname(os.path.realpath(__file__))], stdout=PIPE, stdin=PIPE, stderr=STDOUT) | |
out = p.communicate(input=svg.encode('utf-8'))[0] | |
strIO = StringIO.StringIO() | |
strIO.write(out) |
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
def render_pdf_weasyprint(html): | |
from weasyprint import HTML | |
pdf = HTML(string=html.encode('utf-8')) | |
return pdf.write_pdf() | |
def render_pdf_xhtml2pdf(html): | |
"""mimerender helper to render a PDF from HTML using xhtml2pdf. | |
Usage: http://philfreo.com/blog/render-a-pdf-from-html-using-xhtml2pdf-and-mimerender-in-flask/ | |
""" |
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
FROM ubuntu:14.04.5 | |
#Install newer version of Python 2.7 | |
RUN DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y software-properties-common \ | |
&& add-apt-repository -y ppa:fkrull/deadsnakes-python2.7 && apt-get update \ | |
&& apt-get install -y python2.7=2.7.12-1~trusty1 && rm -rf /var/lib/apt/lists/* |
Uses a (basically free) Amazon Dash Button to play/pause your iTunes music over AirPlay speakers.
Requires OS X and an AirPlay compatible speaker (e.g. Apple TV or any speaker hooked up to AirPort Express).
- Install node-dash-button and follow the instructions to get your Dash Button's MAC address.
- Install node-applescript
- Tweak code as desired, filling in your button's MAC address, name of your AirPlay speakers, etc.
- Run via Terminal:
node dash_buttons.js
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
#!/bin/bash -x | |
# User script to bootstrap any instance. | |
# This will set up, array, and format every instance storage | |
# drive present in the instance (if any) | |
# | |
# The disk format/layout is read from an EC2 tag "DiskLayout" | |
# (defined in the cloudformation templates) and it defaults to | |
# "raid0". Possible values are: | |
# * raidN: grabs all available instance storage drives, creates a |
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
define([ | |
'underscore', | |
], | |
function(_) { | |
'use strict'; | |
// https://en.wikipedia.org/wiki/List_of_file_signatures | |
var fileSignatures = { | |
'mp3': [ |
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
class StructlogRollbarHandler(RollbarHandler): | |
def __init__(self, prefix, *args, **kwargs): | |
self.prefix = prefix | |
super(StructlogRollbarHandler, self).__init__(*args, **kwargs) | |
def format_title(self, data): | |
# Keys used to construct the title and for grouping purposes. | |
KEYS = ['event', 'func', 'exception_name', 'queue'] | |
def format_field(field, value): |
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
netstat -na | grep LISTEN | grep -v 127.0.0.1 | grep -v ::1 |