Skip to content

Instantly share code, notes, and snippets.

View tinku99's full-sized avatar

Naveen Garg tinku99

View GitHub Profile
from skimage.viewer import ImageViewer
from skimage.viewer.widgets import Slider
from skimage import data
from skimage.viewer.plugins.lineprofile import LineProfile
image = data.camera()
viewer = ImageViewer(image)
plugin = Plugin(image_filter=lambda img,
threshold: img > threshold)
WM_KEYDOWN = 0x100
GoSub, GetHTML
OnMessage(WM_KEYDOWN, "WM_KeyDown")
Gui Add, ActiveX, w350 h300 x0 y0 vdoc, HTMLFile
doc.write(html)
Gui, Show, w310 h265 Center, HTML Based GUI
doc.all.type.focus
ComObjConnect(doc, "Doc_")
return
@tinku99
tinku99 / dcmanonymize.sh
Created May 10, 2012 12:54
simple dicom anonymization with dcmtk
dcmodify -ie -gin -nb -ea "(0010,0010)" -ea "(0010,0020)" -ea "(0010,0030)" -ea "(0020,000E)" -ea "(0020,000D)" -ea "(0008,0080)" -ea "(0008,0081)" -ea "(0008,0050)" -ea "(0008,0090)" -ea "(0008,1070)" -ea "(0008,1155)" -ea "(0010,1000)" -ea "(0020,0010)" -ea "(0020,4000)" *.dcm
@tinku99
tinku99 / zsendrecvjson.ahk
Created April 18, 2012 23:26
send and receive ahk objects using json / zmq
z := zstart("tcp://localhost:5555")
omsg := ["what", "else"]
zsendrcv(z, omsg)
return
;; ztart()
zstart(endpoint="tcp://localhost:5555"){
z := new zmq()
z.context := z.zmq_init(1)
@tinku99
tinku99 / asdfmouse.ahk
Created April 15, 2012 22:43
mouse with the keyboard
CustomColor = 000000
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, Color, %CustomColor%
Gui, Font, s10 cwhite
yb := A_ScreenHeight - 40
xb := A_ScreenWidth - 40
loop, 26{
char := chr(Asc("A") + A_Index - 1)
x := floor(A_ScreenWidth * (1 - ((asc("Z") - asc(char) + 1) / 26)) )
loop, 26{
@tinku99
tinku99 / testahk.cs
Created April 11, 2012 05:15
using autohotkey.dll from csharp / .net
// early binding example
clr.AddReferenceToFileAndPath("drive:\\path\\to\\Interop.LibCOMServer.dll")
from LibCOMServer import CoCOMServerClass as AutoHotkey
ahk = AutoHotkey()
ahk.ahktextdll("msgbox hello world")
// late binding example
from System import Activator, Type
ahk = Activator.CreateInstance(Type.GetTypeFromProgID('AutoHotkey.Script'))
@tinku99
tinku99 / AlwaysAtBottom.ahk
Created November 26, 2011 07:54
ahk stdlib
; http://www.autohotkey.com/forum/viewtopic.php?p=54403#54403
AlwaysAtBottom(Child_ID)
{
WinGet, Desktop_ID, ID, ahk_class Progman
Return DllCall("SetParent", "uint", Child_ID, "uint", Desktop_ID)
}
@tinku99
tinku99 / ahkobj2comarray.ahk
Created November 6, 2011 04:56
convert between autohotkey objects and safearrays (comobjarray)
/*
Author: Naveen Garg
license: GPL v2
*/
testahkobj2comarray:
o := {a: 4, b: 5}
a := ahkobj2comarray(o)
o2 := comarray2ahkobj(a)
if (tostring(o) != tostring(o2))
@tinku99
tinku99 / viper-vi-global-user-map.el
Created October 9, 2011 07:44
viper-vi-global-user-map
(require 'picture)
;; do something usefull instead of ringing error bell when trying to move right or down past a newline or end of file
(define-key viper-vi-global-user-map "l" 'picture-forward-column)
(define-key viper-vi-global-user-map "h" 'picture-backward-column)
(define-key viper-vi-global-user-map "j" 'picture-move-down)
(define-key viper-vi-global-user-map "k" 'picture-move-up)
(define-key viper-vi-global-user-map "1" 'delete-other-windows)
(define-key viper-vi-global-user-map "e" 'picture-end-of-line)
(define-key viper-vi-global-user-map " " 'scroll-up)
@tinku99
tinku99 / ahkLoadCLRassembly.ahk
Created September 8, 2011 15:24
call entrypoint in a .net assembly from autohotkey
c# =
(
using System.Windows.Forms;
using System.Windows.Automation;
public class Foo {
public static void Main() {
MessageBox.Show("hello from Foo entrypoint");
}
public void Test() {
MessageBox.Show("Hello from nonentrypoint");