Skip to content

Instantly share code, notes, and snippets.

View beta.txt
Google Inc.
Copyright 2018 Google Inc. All rights reserved.
Google Chrome 71.0.3578.80 (Official Build) beta (64-bit) (cohort: Beta)
Revision 2ac50e7249fbd55e6f517a28131605c9fb9fe897-refs/branch-heads/3578@{#860}
OS Windows
JavaScript V8 7.1.302.28
Flash 32.0.0.101 C:\Windows\system32\Macromed\Flash\pepflashplayer64_32_0_0_101.dll
User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36
Command Line "C:\Program Files (x86)\Google\Chrome Beta\Application\chrome.exe" --flag-switches-begin --disable-accelerated-video-decode --load-media-router-component-extension=0 --disable-smooth-scrolling --flag-switches-end
View stable.txt
Google Inc.
Copyright 2018 Google Inc. All rights reserved.
Google Chrome 71.0.3578.80 (Official Build) (64-bit) (cohort: 71_Win_80)
Revision 2ac50e7249fbd55e6f517a28131605c9fb9fe897-refs/branch-heads/3578@{#860}
OS Windows
JavaScript V8 7.1.302.28
Flash 32.0.0.101 C:\Windows\system32\Macromed\Flash\pepflashplayer64_32_0_0_101.dll
User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36
Command Line "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --flag-switches-begin --disable-accelerated-video-decode --load-media-router-component-extension=0 --disable-smooth-scrolling --flag-switches-end
@fireattack
fireattack / vtt_to_srt.py
Last active Aug 14, 2018
Py3 requirement: chardet
View vtt_to_srt.py
import argparse
import datetime
import re
from os.path import exists, splitext, join
from os import walk
import chardet
def main():
parser = argparse.ArgumentParser()
View DumpAZW6_py3.py
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
import sys
import os, getopt, struct
import imghdr
def get_image_type(imgname, imgdata=None):
imgtype = imghdr.what(imgname, imgdata)
View chapter.xml
<?xml version="1.0"?>
<Chapters>
<EditionEntry>
<ChapterAtom>
<ChapterTimeStart>00:0:00.000000000</ChapterTimeStart>
<ChapterDisplay>
<ChapterString>Opening</ChapterString>
<ChapterLanguage>jpn</ChapterLanguage>
</ChapterDisplay>
</ChapterAtom>
View dota_player_cards.m
iter = 50000;
gold_result = zeros(1, iter);
gold_odd = 0.1;
initial_dust = 2000;
for method = 1:2
for i = 1:iter
bag = 0;
gold = 0;
View audio_spectrum.m
filenames = {'samples/teacher/super.wav','samples/teacher/yume_deem.wav','samples/teacher/yume2005_deem.wav'};
%'samples/panic.wav','samples/super.wav', 'samples/yume.wav','samples/yume2005.wav','samples/single.mp3'
%filenames = {'old/good_rg.wav','old/bad_rg.wav'};
method = 'peri'; % peri, welch, fft, fftband
close all
for i = 1:length(filenames)
file = filenames{i};
[wave,Fs]=audioread(file);
x=(wave(:,1)+wave(:,2))/2; %Downmix
@fireattack
fireattack / normalizerms.m
Created Jul 1, 2017
Normalize audio signal via target RMS (in dB)
View normalizerms.m
function [ y ] = normalizerms( x, targetdB )
%NORMALIZERMS Summary of this function goes here
% Detailed explanation goes here
%normalize
targetrms=10^(targetdB/20);
myrms=rms(x);
% valueDBFS = 20*log10(abs(myrms));
y=x/(myrms/targetrms);
end
@fireattack
fireattack / ti_age.py
Last active Jul 7, 2018
Grab DOB of TI8 players from Liquipedia
View ti_age.py
import re
import requests
from bs4 import BeautifulSoup
url = 'https://liquipedia.net/dota2/The_International/2018'
html = requests.get(url)
html.encoding = 'utf-8'
soup = BeautifulSoup(html.text, "lxml")
divs = soup.find_all('div', class_='teamcard')
View rename_gamecg_pack.py
import re
from os import listdir, rename, makedirs
from os.path import join, splitext, basename, exists
from urllib.parse import quote
from bs4 import BeautifulSoup as bs
from requests import get # to make GET request
def advrename(original_full_path, new_filename, c):
new_full_path = join(pathforrenamed, new_filename)