Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 nvidia/cuda:8.0-cudnn5-devel | |
# Supress warnings about missing front-end. As recommended at: | |
# http://stackoverflow.com/questions/22466255/is-it-possibe-to-answer-dialog-questions-when-installing-under-docker | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Install some dependencies | |
RUN apt-get update && \ | |
apt-get install -y \ | |
apt-utils \ |
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
# Author: Linwood Creekmore | |
# Email: [email protected] | |
# Description: Python script to pull content from a website (works on news stories). | |
#Licensed under GNU GPLv3; see https://choosealicense.com/licenses/lgpl-3.0/ for details | |
# Notes | |
""" | |
23 Oct 2017: updated to include readability based on PyCon talk: https://github.com/DistrictDataLabs/PyCon2016/blob/master/notebooks/tutorial/Working%20with%20Text%20Corpora.ipynb | |
18 Jul 2018: added keywords and summary |
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 OpenSSL import SSL | |
... | |
context = SSL.Context(SSL.TLSv1_2_METHOD) | |
context.use_privatekey_file('/etc/letsencrypt/live/DOMAIN.COM/privkey.pem') | |
context.use_certificate_chain_file('/etc/letsencrypt/live/DOMAIN.COM/fullchain.pem') | |
context.use_certificate_file('/etc/letsencrypt/live/DOMAIN.COM/cert.pem') |
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 python | |
# based on http://stackoverflow.com/questions/7052947/split-95mb-json-array-into-smaller-chunks | |
# usage: python json-split filename.json | |
# produces multiple filename_0.json of 1.49 MB size | |
import json | |
import sys | |
with open(sys.argv[1],'r') as infile: | |
o = json.load(infile) |
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 socket, ssl, json, struct, sys | |
#originally from: http://stackoverflow.com/questions/1052645/apple-pns-push-notification-services-sample-code | |
# device token returned when the iPhone application | |
# registers to receive alerts | |
deviceToken = 'XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX' | |
thePayLoad = { |
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 python | |
import ssl | |
import json | |
import socket | |
import struct | |
import binascii | |
def send_push_message(token, payload): | |
# the certificate file generated from Provisioning Portal |
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
ffmpeg -i input.mp3 -acodec pcm_s16le -ac 1 -ar 16000 output.wav | |
# To convert all mp3 files in a directory in Linux: | |
for f in *.mp3; do ffmpeg -i "$f" -acodec pcm_s16le -ac 1 -ar 16000 "${f%.mp3}.wav"; done | |
# Or Windows: | |
for /r %i in (*) do ffmpeg -i %i -acodec pcm_s16le -ac 1 -ar 16000 %i.wav |