Skip to content

Instantly share code, notes, and snippets.

Niko Klaric nikola

Block or report user

Report or block nikola

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nikola
nikola / drives.py
Created Nov 4, 2014
Enumerate drives
View drives.py
# coding: utf-8
import re
from itertools import izip_longest
import win32com.client
from win32file import GetDriveType
from win32api import GetLogicalDriveStrings, GetVolumeInformation
@nikola
nikola / getpywin32color.py
Created Nov 11, 2014
Get Win32 Color Brush
View getpywin32color.py
import ctypes
def getColorBrush(red=0, green=0, blue=0):
class _COLORREF(ctypes.Structure):
_fields_ = [
('byRed', ctypes.c_byte),
('byGreen', ctypes.c_byte),
('byBlue', ctypes.c_byte),
]
return ctypes.windll.gdi32.CreateSolidBrush(_COLORREF(red, green, blue))
@nikola
nikola / genchromeappid.py
Created Nov 11, 2014
Generate Chrome Application ID
View genchromeappid.py
import hashlib
def getChromeApplicationId(pathname):
if len(pathname) > 1 and pathname[0].islower() and pathname[1] == ":":
pathname = pathname[0].upper() + pathname[1:]
pathname = pathname.encode("utf-16le")
offset = ord("a")
applicationId = "".join([chr(int(digit, 16) + offset) for digit in hashlib.sha256(pathname).hexdigest()[:32]])
@nikola
nikola / enum.js
Created Nov 19, 2014
Create enumeration
View enum.js
Array.apply(null, Array(1000)).map(Function.prototype.call.bind(Number))
You can’t perform that action at this time.