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 / 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
@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 / 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 / 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 / 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 / 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:7fc5c00530d77bc14bf7813e68314274
Created September 28, 2016 04:40 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@den-run-ai
den-run-ai / keymouseloggertest.py
Created October 4, 2016 14:39 — forked from Sebelino/keymouseloggertest.py
Key/mouse logger demo with PyUserInput
#!/usr/bin/env python
# The following 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 3 of the License, or
# (at your option) any later version.
from pykeyboard import PyKeyboardEvent
from pymouse import PyMouseEvent
from threading import Thread
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@den-run-ai
den-run-ai / bench_excel_writers.py
Created April 18, 2017 18:33 — forked from jmcnamara/bench_excel_writers.py
Benchmark of several Python Excel writing modules
##############################################################################
#
# Simple Python program to benchmark several Python Excel writing modules.
#
# python bench_excel_writers.py [num_rows] [num_cols]
#
#
import sys
from time import clock