Skip to content

Instantly share code, notes, and snippets.

@mbikovitsky
mbikovitsky / unistd.h
Created November 14, 2014 20:00
Windows unistd.h replacement
#ifndef _UNISTD_H
#define _UNISTD_H 1
/* This file intended to serve as a drop-in replacement for
* unistd.h on Windows.
* Please add functionality as neeeded.
* Original file from: http://stackoverflow.com/a/826027
*/
#include <stdlib.h>
@mbikovitsky
mbikovitsky / CMakeLists.txt
Last active August 29, 2015 14:09
MinGW-w64 getopt
cmake_minimum_required (VERSION 2.8.12)
project(getopt)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_library(getopt STATIC getopt.c getopt.h)
/* Copyright (c) 2013 Michael Bikovitsky
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
@mbikovitsky
mbikovitsky / privateer.html
Created December 9, 2013 18:39
Small application for stripping Pidgin logs of private information.
<!-- Copyright (c) 2013 Michael Bikovitsky
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@mbikovitsky
mbikovitsky / kanobu_featured.py
Last active December 28, 2015 04:59
Python 3 script for downloading the featured image from the homepage of Kanobu. After running the script the current directory will contain the individual panels and the merged image. Dependencies: - Beautiful Soup 4 (https://pypi.python.org/pypi/beautifulsoup4/) - Pillow (https://pypi.python.org/pypi/Pillow)
@mbikovitsky
mbikovitsky / gist:6752403
Created September 29, 2013 13:11
Hex Workshop *.PFF structure library
#include "standard-types.hsl"
#pragma maxarray(65536)
#pragma hide()
typedef struct DDS_PIXELFORMAT {
DWORD dwSize;
DWORD dwFlags;
DWORD dwFourCC;
DWORD dwRGBBitCount;
DWORD dwRBitMask;
@mbikovitsky
mbikovitsky / greetings.bf
Created September 13, 2013 15:39
Happy Programmers' Day!
++++++++[->++++++++<]>++++++++.<+++++[->+++++<]>.<+++[->+++<]>++++++..+++++++++.
<+++++++++[->---------<]>--------.<++++++[->++++++<]>++++++++++++.<+++++[->+++++
<]>+++++++++.---.--------.<+++[->+++<]>++.<++++[->----<]>-.<+++[->+++<]>+++..---
-----.<+++[->+++<]>++++.+.<++++++++[->--------<]>------------.-------.<++++++[->
++++++<]>.<+++++[->+++++<]>++++.<++++[->++++<]>++++++++.<+++++++++[->---------<]
>-------.<++++[->----<]>----.---.<
#!/bin/bash
# Copyright (c) 2013 Michael Bikovitsky
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: