Skip to content

Instantly share code, notes, and snippets.

View codito's full-sized avatar
🐢
https://codito.in/now

codito

🐢
https://codito.in/now
View GitHub Profile
@codito
codito / RTM_on_top_-chrome.css
Created October 14, 2011 15:01
Personalized "RTM on top -chrome" user style
/* Original style: http://userstyles.org/styles/46647/rtm-on-top-chrome */
/* Fix 1: Modified notifications to show on bottom (div.orange_rbroundbox) */
/* Fix 2: Hide the online help and keyboard shortcut divs */
/* Remove these comments if the style doesn't work :) */
.xtd_task_name {
display: block ;
margin-bottom: 3px ;
font-size: 10pt;
}
@codito
codito / pyembed.c
Last active March 16, 2024 20:29
A simple embedded python interpreter
// Demo a simple embedded python interpreter
// See this post for context: http://codito.in/notes-on-vim-python-interop
//
// Compile with: gcc $(python-config --cflags --ldflags) pyembed.c -o pyembed
// Tested on python 3.6 in arch linux
//
// See https://docs.python.org/3/c-api/init.html for details of APIs.
//
#include <Python.h>
@codito
codito / dbus_demo.py
Last active April 5, 2021 13:07
QtDBus demo with PyQt5
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5 import QtCore, QtDBus, QtWidgets
def notify(header, msg):
item = "org.freedesktop.Notifications"
path = "/org/freedesktop/Notifications"
interface = "org.freedesktop.Notifications"
@codito
codito / convert.py
Last active May 16, 2020 07:51
Utility to convert DV1-TTSurekh font to devanagari unicode
# -*- coding: utf-8 -*-
#!/usr/bin/env python2
# usage:
# mkdir /tmp/trial
# git clone https://github.com/sushant354/indic2unicode
# sudo pacman -S python2-ply
# # copy the below code in /tmp/trial and save as convert.py
# cd /tmp/trial
# python2 convert.py input.txt output.txt
@codito
codito / KernelMode.md
Created February 1, 2012 08:44
WinDBG Debug Snippets

Kernel driver debugging tips

Enable DbgPrint/KdPrint

kd> ed nt!Kd_DEFAULT_MASK 0xFFFFFFFF

reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Debug Print Filter" /v DEFAULT /t REG_DWORD /d 0xFFFFFFFF

@codito
codito / RunningTestForPublishedProject.md
Created October 3, 2017 04:14
Running tests from published project
> mkdir g:\tmp\trial
> cd g:\tmp\trial
> dotnet --info
.NET Command Line Tools (2.0.2-vspre-006949)

Product Information:
 Version:            2.0.2-vspre-006949
 Commit SHA-1 hash:  23fc6ec23d
@codito
codito / 0001-Comtype-Fix-metaclass-conflict.patch
Created August 12, 2013 01:41
Fix for metaclass conflict. Get the latest snapshot of comtypes from svn. Run 2to3.py refactoring. Then apply the following patch. (Tested with Python 3.3.2/Windows 8/x86).
---
comtypes/__init__.py | 8 ++++++--
comtypes/automation.py | 4 +++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/comtypes/__init__.py b/comtypes/__init__.py
index 6590ead..fa604af 100644
--- a/comtypes/__init__.py
+++ b/comtypes/__init__.py
@@ -268,7 +268,9 @@ class _cominterface_meta(type):
@codito
codito / gre-voice.sh
Created October 3, 2012 16:23
GRE Word Call
#!/bin/bash
# Script to speak out GRE words, turn it on and sleep ;)
# Get wordlist from http://pastebin.com/JLQs9MT2
#espeakcmd="espeak -g 1 -s 170 -a 150 -p 10 -v english-us"
espeakcmd="festival --tts"
shuf GREwordlist.txt | while read line
do
word=`echo $line | cut -f 1 -d " " -`
meaning=`echo $line | cut -f 2- -d " " -`
@codito
codito / msbuild.message.csproj
Created November 21, 2011 09:49
Debugging msbuild properties with Message task
<Project ToolsVersion="4.0" InitialTargets="Log" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- other properties go here.... -->
<Target Name="Log">
<Message Text="SearchPath = $(AssemblySearchPaths)"/>
</Target>
</Project>
@codito
codito / spike_commonmark.py
Last active August 29, 2015 14:23
Spike on markdown for Slokas
# -*- coding: utf-8 -*-
import CommonMark
if __name__ == "__main__":
with open("trial.md") as f:
parser = CommonMark.DocParser()
renderer = CommonMark.HTMLRenderer()
ast = parser.parse(f.read())
html = renderer.render(ast)
json = CommonMark.ASTtoJSON(ast)