This file contains 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
<?php | |
class IRRHelper{ | |
//Adapted from Javascript version here: https://gist.github.com/ghalimi/4591338 | |
// | |
// Copyright (c) 2012 Sutoiku, Inc. (MIT License) | |
// | |
// Some algorithms have been ported from Apache OpenOffice: | |
// |
This file contains 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
#Instructions: | |
# 1. Launch ipython | |
# 2. manually set filename = '/path/to/file.php' | |
# 3. Copy/Paste the below code to write transformed content to ./output.txt | |
import re | |
with open(filename,'r') as f: code = f.read() | |
code = code.replace('<?php','').replace('<?','') |
This file contains 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_60fps.mov -f rawvideo -pix_fmt yuv420p -vcodec rawvideo -y pipe:1 | ffmpeg -r 60 -f rawvideo -pix_fmt yuv420p -r 60 -s 1280x800 -i - -vf framestep=3 -y output_20fps.mov |
This file contains 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
#Usage: python show_licenses_for_requirements.py ./requirements.txt | |
# Setup: | |
# pip install requirements-parser | |
import sys | |
import pkg_resources | |
import requirements | |
def get_modules(requirements_file_path): |
This file contains 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
# Manual steps initially: | |
# 1. Use the Alexa developer console "Test" mode to test your phrase | |
# 2. View NETWORK DEBUG panel, find the "getTTS" POST request, right-click and "Save as HAR with content" to a file called 'get_tts.txt' | |
# 3. Run the code below to convert to audio file 'audio.ogg' | |
import urllib | |
import json | |
import base64 | |
with open('tts.txt','r') as f: |
This file contains 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 cProfile | |
from django.template.defaultfilters import floatformat as floatformat_django | |
from django.contrib.humanize.templatetags.humanize import intcomma as intcomma_django | |
num = 100000 | |
float_num = 1 / 3.0 | |
def floatformat(value, places=2): |