Skip to content

Instantly share code, notes, and snippets.

class Array(DotNetAbstractClass)
def GetUpperBound(self, *args, **kwargs):
""" Int32 GetUpperBound(Int32) """"
def GetEnumerator(self, *args, **kwargs):
""" System.Collections.IEnumerator GetEnumerator() """"
IsReadOnly = False
def GetValue(self, *args, **kwargs):
/*
* fork.c
* Experimental fork() on Windows. Requires NT 6 subsystem or
* newer.
*
* Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
@juntalis
juntalis / cl.py
Created January 14, 2013 18:06
Stuff
class AdditionalIncludeDirectories(StringListProperty):
"""Specifies one or more directories to add to the include path; separate with semi-colons if more than one. (/I[path])"""
category = "General"
display_name = "Additional Include Directories"
subtype = "folder"
switch = "I"
class AdditionalUsingDirectories(StringListProperty):
"""Specifies one or more directories (separate directory names with a semicolon) to be searched to resolve names passed to a #using directive. (/AI[path])"""
# coding: utf-8
"""
__init__.py
TODO: Description
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.
@juntalis
juntalis / User32.cs
Created February 2, 2013 18:14
Pinvokes and whatnot
#region Imports
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using TickTock.Interop.Properties;
#endregion
%library("./libm5.dll", "math")
%library("./msvcrt.dll", "libc")
%import("samples/imported.asm", "imported")
# this changes the default code size just before we start the next function
# we can call it at any time before a function to change its code size
%code_size(200)
# these are part of this module, you can also have them in a function
MY_NAME = "Zed A. Shaw"
MY_AGE = 1200
#ifndef _FLAGS_H_
#define _FLAGS_H_
#pragma once
#define ACTION_ACTIVATE 0x1
#define ACTION_CANCEL 0x2
#define ACTION_COMPLETE 0x4
#define ACTION_PAUSE 0x3
#define DUE_SET 0x8
@juntalis
juntalis / msvc-cpp.py
Created February 25, 2013 05:20
Limited expansion C/C++ preprocessor using the MSVC compiler. I wrote this, more or less, to avoid having to scour system headers for constants when writing bindings, etc. The script will expand all macros and preprocessor directives in the current file while leaving the included headers as their original #include statements.
import sys, os, re, string
import subprocess as _subp, tempfile as _tmp, time as _time, shutil as _shutil
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
# CPU Identification and ctypes general stuff
## Figure out platform architecture
from ctypes import c_void_p, c_ulonglong, c_long, c_uint, byref, c_ulong, WinDLL, cast, \
import os
from shutil import copyfile
from site import addsitedir
currFolder = os.path.dirname(__file__)
addsitedir(currFolder)
# Some variables. Too lazy to do a proper
# config file. Sorry.
pathLogs = 'C:/ShellEnv/j-tree/sbin/www/apache/logs/'
pathVhosts = 'C:\\ShellEnv\\j-tree\\sbin\\www\\apache\\config\\vhosts'
#include <stdio.h>
#include <stdlib.h>
#ifdef _MSC_VER
unsigned long __stdcall GetTickCount(void);
#else
# include <sys/time.h>
unsigned long GetTickCount(void)
{