Skip to content

Instantly share code, notes, and snippets.

View shede333's full-sized avatar

shede333 shede333

View GitHub Profile
@corrieriluca
corrieriluca / App-Store-Connect-API-Python.md
Last active June 7, 2024 02:37
Connection to the App Store Connect API using Python3
class Solution(object):
def divide(self, dividend, divisor):
"""
:type dividend: int
:type divisor: int
:rtype: int
"""
if divisor == 0:
return -1
@XueshiQiao
XueshiQiao / wwdc_combine_webvtt.rb
Last active August 21, 2018 00:34
combine WWDC subtitle files (fileSequence*.webvtt) to a srt file.
#!/usr/bin/ruby
docPath = "wwdc_srts"
#exclude . and .. folder
folders = Dir.entries(docPath).select{|folder| folder.to_i > 0}
folders.each{ |folder|
print folder
print "\n"
sequenceFilePath = docPath + "/" + folder
@XueshiQiao
XueshiQiao / extract.py
Last active April 8, 2018 02:20 — forked from nriley/extract.py
import requests
import os, re, sys
RE_SD_VIDEO = re.compile(
r'<a href="(http://devstreaming.apple.com/videos/wwdc/2013/[^"]*-SD.mov)')
RE_WEBVTT = re.compile(r'fileSequence[0-9]+\.webvtt')
# stdin: dump of https://developer.apple.com/wwdc/videos/
for l in sys.stdin:
m = RE_SD_VIDEO.search(l)
@nriley
nriley / extract.py
Created June 27, 2013 06:51
Extract English subtitle text for WWDC 2013 videos.
import requests
import os, re, sys
RE_SD_VIDEO = re.compile(
r'<a href="(http://devstreaming.apple.com/videos/wwdc/2013/[^"]*-SD.mov)')
RE_WEBVTT = re.compile(r'fileSequence[0-9]+\.webvtt')
# stdin: dump of https://developer.apple.com/wwdc/videos/
for l in sys.stdin:
m = RE_SD_VIDEO.search(l)
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active June 11, 2024 08:36
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
#import "SCListener.h" // Remember to link to AudioToolbox.framework.
// Start listening.
[[SCListener sharedListener] listen];
// Retrieve the average power.
[[SCListener sharedListener] averagePower];
// Retrieve the peak power.
[[SCListener sharedListener] peakPower];