Skip to content

Instantly share code, notes, and snippets.

View vasily-v-ryabov's full-sized avatar

Vasily Ryabov vasily-v-ryabov

View GitHub Profile
import win32api
import win32con
from time import sleep
import Image
import pywinauto
app = pywinauto.Application.start('mspaint')
win = app.top_window_()
win.MoveWindow(0,0)
@trongthanh
trongthanh / gist:2779392
Last active April 24, 2024 23:46
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@baoilleach
baoilleach / chemsketchauto.py
Created September 14, 2012 09:57
Automation of conversion from ChemSketch files to Mol files
import pywinauto
import os
import doctest
from pywinauto import application
from time import sleep
from pywinauto.timings import Timings
Timings.Slow()
Timings.after_sendkeys_key_wait =0.015
Timings.after_menu_wait =0.1
import ctypes
import re
def ValidHandle(value, func, arguments):
if value == 0:
raise ctypes.WinError()
return value
import serial
from serial.win32 import ULONG_PTR, is_64bit
@EBNull
EBNull / getobject.py
Created December 5, 2012 20:19
"Missing" win32com utilities for getting object instances from DLLs or from run-time licenced servers
__all__ = (
####### Class Objects
#CoGetClassObject - Normal, not wrapped
'CoDllGetClassObject', #Get ClassObject from a DLL file
####### ClassFactory::CreateInstance Wrappers
'CoCreateInstanceFromFactory', #Create an object via IClassFactory::CreateInstance
'CoCreateInstanceFromFactoryLicenced', #Create a licenced object via IClassFactory2::CreateInstanceLic
@leftclickben
leftclickben / gist:322b7a3042cbe97ed2af
Last active June 7, 2023 10:58
Steps to migrate from SVN to GitLab

Steps to migrate from SVN to GitLab

This process worked for me. I take no responsibility for any damage or loss incurred as a result of following or not following these steps or, for that matter, anything else you might do or not do.

Setup

  • SVN is hosted at svn.domain.com.au.
  • SVN is accessible via http (other protocols should work).
  • GitLab is hosted at git.domain.com.au and:
@Preston-Landers
Preston-Landers / pyuac.py
Last active June 16, 2023 04:09
pyuac - elevate a Python process with UAC on Windows
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
"""
THIS CODE IS OUTDATED! Please use this instead:
https://pypi.org/project/pyuac/
https://github.com/Preston-Landers/pyuac
@diyan
diyan / gui_automation_python.md
Last active December 4, 2023 14:48
Desktop GUI automation in Python

Desktop

UI Automation. Desktop. Python

GUI toolkit agnostic

autopy - simple, cross-platform GUI automation toolkit. MIT - https://github.com/msanders/autopy/

  • 432 stars, 102 forks, 2950 monthly downloads at 2015-05-13
  • GUI toolkit agnostic
@gbishop
gbishop / Args.ipynb
Last active July 18, 2022 11:43
Allow arguments to be passed to notebooks via URL or command line.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@markddavidoff
markddavidoff / com_extentsion.py
Last active August 8, 2016 19:11
Comtypes wrapper to create an instance of a COM object with IClassFactory2 for objects that require licensing
# based on https://gist.github.com/EBNull/4219140
from uuid import UUID
from comtypes import GUID, IUnknown, CLSCTX_SERVER
from ctypes import OleDLL, WinDLL, c_ulong, byref, WINFUNCTYPE, \
POINTER, c_char_p, c_void_p
from ctypes.wintypes import HRESULT
IID_IClassFactory2 = "{B196B28F-BAB4-101A-B69C-00AA00341D07}"