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 time | |
timestr = time.strftime("%Y%m%d-%H%M%S") | |
print timestr |
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 os | |
for root, dirs, files in os.walk("."): | |
for file in files: | |
if file.endswith(".tif") or file.endswith(".TIF"): | |
print(os.path.join(root, file)) |
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 img2pdf | |
pdf_bytes = img2pdf.convert(['test.jpg']) | |
file = open("name.pdf","wb") | |
file.write(pdf_bytes) |
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 Tkinter | |
from tkFileDialog import askopenfilename, askdirectory | |
class simpleapp_tk(Tkinter.Tk): | |
def __init__(self,parent): | |
Tkinter.Tk.__init__(self,parent) | |
self.parent = parent | |
self.initialize() | |
def initialize(self): |
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
subst h: c:\Users\bla\blabla | |
https://www.python.org/ftp/python/2.7.10/python-2.7.10.amd64.msi | |
msiexec /a python-2.7.10.amd64.msi /qb TARGETDIR=H:\python27 | |
H: | |
cd python27 |
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
<?php | |
function get_form_entries($baseurl, $username, $password, $uid, $formid) { | |
$headerfile = tempnam("/tmp", "formidable-header"); | |
$cookiefile = tempnam("/tmp", "formidable-cookie"); | |
$csvfile = tempnam("/tmp", "formidable-csv"); | |
$login_cmd = "curl -s -D $headerfile -c $cookiefile 'http://$baseurl/wp-login.php' --data 'log=$username&pwd=$password&testcookie=1' -H 'Cookie: wp-settings-time-$uid=2829600000; wordpress_test_cookie=WP+Cookie+check' 2> /dev/null"; | |
$pull_csv_cmd = "curl -s -D $headerfile -b $cookiefile -o $csvfile -c $cookiefile 'http://$baseurl/wp-admin/admin-ajax.php?frm_action=0&action=frm_entries_csv&form=$formid'"; | |
exec($login_cmd, $output, $status); | |
if ($status != 0) { | |
throw new Exception("Can't login"); |
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
#!/bin/bash | |
set -e | |
set -o pipefail | |
function main() { | |
setup_env | |
print_welcome | |
mount_dir | |
back_up | tee -a $BACKUPDIR/backup.log |
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
DisplayInfo() | |
Related URLs: | |
• Postman—http://getpostman.com | |
• Hurl.it—http://hurl.it | |
• Runscope—http://runscope.com | |
• HTTPie—http://httpie.org | |
• Charles Proxy—http://charlesproxy.com | |
• mitmproxy—http://mitmproxy.org | |
• API Tools—http://apitools.com | |
• Requestb.in—http://requestb.in |
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
#Examples: pyhook_demo.py | |
import pythoncom, pyHook | |
def OnKeyboardEvent(event): | |
print 'MessageName:',event.MessageName | |
print 'Message:',event.Message | |
print 'Time:',event.Time | |
print 'Window:',event.Window | |
print 'WindowName:',event.WindowName | |
print 'Ascii:', event.Ascii, chr(event.Ascii) |
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 wx | |
class OverlayFrame( wx.Frame ) : | |
def __init__( self ) : | |
wx.Frame.__init__( self, None, title="Transparent Window", | |
style=wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP ) | |
self.ShowFullScreen( True ) |