Skip to content

Instantly share code, notes, and snippets.

View tarasn's full-sized avatar
🎯
Focusing

Taras Naumtsev tarasn

🎯
Focusing
View GitHub Profile
data:text/html, <html contenteditable>
@tarasn
tarasn / toc.xml
Created November 19, 2012 15:54
Converting XML to HTML list
<?xml version="1.0" encoding="utf-8"?>
<menuitems>
<menuitem>
<lang>csharp,js</lang>
<type>header</type>
<text>some header 0</text>
</menuitem>
<menuitem>
<lang>csharp,js</lang>
<type>composite</type>
@tarasn
tarasn / boilerplate-jquery.html
Last active October 12, 2015 23:48
HTML boilerplate
<!DOCTYPE html>
<html>
<head>
<title>HTML boilerplate with JQuery</title>
</head>
<body>
<h1>Hello, world!</h1>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</body>
</html>
@tarasn
tarasn / my-graph.py
Created November 13, 2012 17:18
Defening and printing with indentation graph data structure
mygraph = { '0':['1','2','3','4','5'],
'1':[],
'2':[],
'3':['6'],
'4':[],
'5':[],
'6':['7'],
'7':[],
}
@tarasn
tarasn / write-to-windebug.py
Created November 13, 2012 09:45
Logging to Win32 debug output
import logging
import ctypes
OutputDebugString = ctypes.windll.kernel32.OutputDebugStringA
OutputDebugString.argtypes = [ctypes.c_char_p]
class DbgViewHandler(logging.Handler):
def __init__(self):
logging.Handler.__init__(self)
@tarasn
tarasn / clear-console.py
Created October 11, 2012 11:32
Clear python console (win)
import os
clear = lambda: os.system('cls')
# now, to clear the screen
clear()
@tarasn
tarasn / myapp.exe.config
Created August 7, 2012 15:04
Granting full trust to the assemblies from remote sources
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
class MyPrimitiveSynchronisationContext : SynchronizationContext
{
private readonly Queue<Action> messagesToProcess = new Queue<Action>();
private readonly object syncHandle = new object();
private bool isRunning = true;
public override void Send(SendOrPostCallback codeToRun, object state)
{
throw new NotImplementedException();
}