Skip to content

Instantly share code, notes, and snippets.

Chad Z ChadSki

Block or report user

Report or block ChadSki

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
View alloc_test.fs
open System
// returns: median value of a list
let inline median input =
let sorted = input |> Seq.toArray |> Array.sort
let m1,m2 =
let len = sorted.Length-1 |> float
len/2. |> floor |> int, len/2. |> ceil |> int
(sorted.[m1] + sorted.[m2] |> float)/2.
View ForestSim.fs
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.
open System
open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Graphics
type Tile = Grass | Rock | Sand
type GameState = {
@ChadSki
ChadSki / mywindow.py
Created Apr 8, 2017
Python 3 WndClass example
View mywindow.py
import win32api
import win32con
import win32gui
from ctypes import windll, pointer
from ctypes.wintypes import MSG
class MyWindow:
@ChadSki
ChadSki / winapp.py
Created Apr 7, 2017 — forked from mouseroot/winapp.py
Win32 CreateWindow example in python
View winapp.py
from ctypes import *
from ctypes.wintypes import *
WNDPROCTYPE = WINFUNCTYPE(c_int, HWND, c_uint, WPARAM, LPARAM)
WS_EX_APPWINDOW = 0x40000
WS_OVERLAPPEDWINDOW = 0xcf0000
WS_CAPTION = 0xc00000
View darkfiletree.py
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (
QTreeView, QListView, QFileSystemModel, QApplication)
class Main(QTreeView):
def __init__(self):
QTreeView.__init__(self)
# self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
model = QFileSystemModel()
model.setRootPath('C:\\')
View messagebox.reds
Red/System [
Title: "Hello"
File: %messagebox.reds
]
; --- lib imports -----
#import [
"user32.dll" stdcall [
MessageBox: "MessageBoxA" [
View road_graph.py
class Node(object):
"""A node in the road graph. Node functionality doesn't matter, we just
need something to refer to by name."""
def __lt__(self, other):
"""Use the object ID Just so we have a canonical way to sort Nodes."""
id(self) < id(other)
class Edge(object):
@ChadSki
ChadSki / MAPMAKER.BAS
Created Oct 29, 2016
QBASIC tile-based map
View MAPMAKER.BAS
DECLARE SUB clearline ()
DECLARE SUB save ()
DECLARE SUB save1 ()
DECLARE SUB wtile ()
DECLARE SUB tracker ()
DECLARE SUB wlocate ()
DECLARE SUB z014 ()
DECLARE SUB z013 ()
DECLARE SUB z012 ()
DECLARE SUB z011 ()
View ADVENTUR.BAS
DECLARE SUB spellatk ()
DECLARE SUB Battle ()
DECLARE SUB border ()
DECLARE SUB msattle ()
DECLARE SUB deleteone ()
DECLARE SUB cdisplay ()
DECLARE SUB deletemenu ()
DECLARE SUB delete ()
DECLARE SUB savechar ()
DECLARE SUB charback ()
View python.cs
using System;
using System.Runtime.InteropServices;
namespace CPythonBinding
{
class Program
{
[DllImport("python34.dll")]
public static extern void Py_Initialize();
You can’t perform that action at this time.