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 random | |
import warnings | |
def __prime_factors(n): | |
""" | |
https://stackoverflow.com/a/412942/6078370 | |
Returns all the prime factors of a positive integer | |
""" | |
factors = [] | |
d = 2 |
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 requests | |
import lxml.html | |
t = requests.get("https://www.hearthpwn.com/news/5425-final-witchwood-card-reveal-stream-live-updates").text | |
html = lxml.html.fromstring(t) | |
links = html.xpath("//span/span[@class='pretty-bg']/a") | |
for link in links: | |
print(link.get("href")) |
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
// install and or goto adb | |
// download from device (usb) -d | |
// list full path of third party packages | |
adb -d shell pm list packages -f -3 | |
// package:/data/app/com.google.android.inputmethod.japanese-1/base.apk=com.google.android.inputmethod.japanese | |
// download apk to path | |
adb -d pull /data/app/com.google.android.inputmethod.japanese-1/base.apk path/to/ |
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
#!/usr/bin/env python3 | |
# this is python 2 and 3 compatible | |
import smtplib | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
import datetime | |
COMMASPACE = ', ' | |
sender = 'sender@example.com' |
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
@echo off | |
SET st3Path=c:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f | |
pause |
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
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath | |
// http://stackoverflow.com/questions/1880321/why-does-the-260-character-path-length-limit-exist-in-windows | |
// converts a relative path like "abc\" or a filename like "savehere.zip" | |
// to full escaped path \\?\c:\currentdir\abc\ | |
// note that all slashes have to be backslashes | |
func FuckWin(path string) string { | |
pwd, err := os.Getwd() | |
if err != nil { panic(err) } | |
result := pwd + "\\" + 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
package pw.dschmidt.helper; | |
import android.os.Bundle; | |
public class Bundler { | |
private Bundle bundle; |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# see https://github.com/rvalles/brntool | |
#Keep python2 working | |
from __future__ import division #1/2 = float, 1//2 = integer | |
from __future__ import print_function #print("blah", file=whatever) | |
#Keep python2 working end | |
from optparse import OptionParser | |
import serial | |
import sys |
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 random | |
import __future__ | |
a = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWYXZ23456789$%&()=?+#-}][{*/:<>~' #0Ol1!I | |
b = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWYXZ23456789' | |
d = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWYXZ23456789@#%_-&*()' | |
all = "".join((chr(i) for i in range(33,127))) | |
def doa(l = 20, chars = a): | |
return "".join(chars[int(random.random() * (len(chars[:-1])+1))] for i in range(l)) |
NewerOlder