Skip to content

Instantly share code, notes, and snippets.

View den-run-ai's full-sized avatar
🎯
Focusing

Denis Akhiyarov den-run-ai

🎯
Focusing
View GitHub Profile
@den-run-ai
den-run-ai / git-selective-merge.md
Created September 27, 2016 21:16 — forked from katylava/git-selective-merge.md
git selective merge

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp
@den-run-ai
den-run-ai / gist:1babeae0c2c7548e486b04f73b817eaa
Created August 29, 2016 19:49 — forked from jdiscar/gist:9144923
Sample code to get mouse click position, pressed ascii key code, and killing a process (Windows/Python)
import os
import pyHook
import pythoncom
import threading
# Requires pyHook: http://sourceforge.net/apps/mediawiki/pyhook/
# Requires pyWin32: http://sourceforge.net/projects/pywin32/
# Kills the process if escape is pressed
class EscapeToKill(threading.Thread):
@den-run-ai
den-run-ai / UseF2Py.cmake
Created April 19, 2016 17:20 — forked from chatcannon/UseF2Py.cmake
This is a modified version of the UseF2Py.cmake script posted to comp.python.f2py.user by Marcel Loose - see http://blog.gmane.org/gmane.comp.python.f2py.user/page=4 for the original
# +-----------------------------------------------------------------------------+
# | Copyright (C) 2011-2015 |
# | Original by Marcel Loose (loose <at> astron.nl) 2011-2013 |
# | Modified by Chris Kerr (chris.kerr <at> mykolab.ch) 2013-2015 |
# | |
# | This program is free software; you can redistribute it and/or modify |
# | it under the terms of the GNU General Public License as published by |
# | the Free Software Foundation; either version 2 of the License, or |
# | (at your option) any later version. |
# | |
@den-run-ai
den-run-ai / dynamic.py
Created January 30, 2016 04:13 — forked from filmor/dynamic.py
Support for DLR types
from System.Dynamic import DynamicObject as _do
from System import Func, Array, Object
from System.Runtime.CompilerServices import CallSite
from Microsoft.CSharp.RuntimeBinder import (
Binder, CSharpBinderFlags, CSharpArgumentInfoFlags,
RuntimeBinderException, CSharpArgumentInfo
)
class _Injected:
@den-run-ai
den-run-ai / mt.py
Created December 30, 2015 01:55 — forked from gdementen/mt.py
Example of multithreading a numba function by releasing the GIL through ctypes
import ast
from timeit import repeat
import threading
from ctypes import pythonapi, c_void_p
import math
import numpy as np
try:
import numexpr as ne
nthreads = ne.ncores
@den-run-ai
den-run-ai / note.md
Last active September 7, 2015 04:45 — forked from fyears/note.md
how to install scipy numpy matplotlib ipython in virtualenv

if you are using linux, unix, os x:

pip install -U setuptools
pip install -U pip

pip install numpy
pip install scipy
pip install matplotlib
#pip install PySide