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
@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.
@mcvarer
mcvarer / cuda-11.2_installation_on_Ubuntu-18.04
Last active March 12, 2024 02:29
CUDA 11.2 Installation on Ubuntu 18.04
#!/bin/bash
## This gist contains instructions about cuda v11.2 and cudnn 8.1 installation in Ubuntu 18.04 for PyTorch
#############################################################################################
##### forked by : https://gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73 ########
#############################################################################################
### steps ####
# verify the system has a cuda-capable gpu
@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
@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
@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:
@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
@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.
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
@RemcoTukker
RemcoTukker / pywinauto_firstchild.py
Created June 18, 2017 19:36
Monkey patch for pywinauto that adds a first_only parameter to the window function for the UIA backend, in order to work around slow FindAll calls (win10 bug?)
# Monkey patch for pywinauto that adds a first_only parameter to the window function
# for the UIA backend, in order to work around slow FindAll calls (win10 bug?)
# First copy paste this code on your REPL, then do:
# d1 = pywinauto.Desktop("uia")
# d1.window(first_only=True, title="Calculator").window_text()
# Currently only title is supported, but its easy to implement all the others as well,
# most importantly title_re
def first_child(self):
print("Getting first child")
@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}"