Skip to content

Instantly share code, notes, and snippets.

View leha-bot's full-sized avatar
🐝
"Then" (c). I may be slow to respond, sorry about this.

Alex leha-bot

🐝
"Then" (c). I may be slow to respond, sorry about this.
View GitHub Profile
@ry
ry / gcrypt.h
Created October 12, 2009 12:09
/* gcrypt.h - GNU Cryptographic Library Interface -*- c -*-
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of Libgcrypt.
Libgcrypt is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
@jeetsukumaran
jeetsukumaran / custom_iterator.cpp
Created February 18, 2010 02:33
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
@mobius
mobius / lisp_in_200_cpp_lines.cpp
Created December 1, 2010 02:56
Lisp interpreter in 200 lines
// Scheme Interpreter in 90 lines of C++ (not counting lines after the first 90).
// Inspired by Peter Norvig's Lis.py.
// Copyright (c) 2010 Anthony C. Hay. This program leaks memory.
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <map>
@yoggy
yoggy / midi_in_sample.cpp
Created December 16, 2011 08:46
MIDI-in sample program for Win32 (using winmm.lib)
#include <SDKDDKVer.h>
#include <Windows.h>
#include <stdio.h>
#include <conio.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
void PrintMidiDevices()
@enkore
enkore / cl_enum.c
Last active November 5, 2016 15:59
Simple OpenCL enumerator
// I place this in the public domain
// Compile with
// <gcc/clang> <thisfile>.c -lOpenCL-Wall -Wextra -Wpedantic -std=c99
// Created a long time ago
// Updated, some memory leaks fixed and so on 2014-05-28
// Changed to real C instead of some quirky C++ casts inbetween (2014-05-28)
#include <CL/cl.h>
@mridgers
mridgers / pdbdump.c
Created June 21, 2012 21:19
Small tool to list and query symbols in PDB files.
//------------------------------------------------------------------------------
// pdbdump.c - dump symbols from .pdb and executable files (public domain).
// - to compile; cl.exe /Ox /Zi pdbdump.c
// -
// - Martin Ridgers, pdbdump 'at' fireproofgravy.co.uk
//------------------------------------------------------------------------------
#include <stdio.h>
#include <Windows.h>
#include <DbgHelp.h>
@alghanmi
alghanmi / lighttpd.default.conf
Last active March 2, 2022 19:21
Lighttpd Default Configuration File
server.port = 80
#server.bind = ""
server.tag ="lighttpd"
server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_compress",
"mod_expire",
@arq5x
arq5x / test.sh
Last active November 30, 2023 12:50
Compress and then Decompress a string with zlib.
# compile
$ g++ zlib-example.cpp -lz -o zlib-example
# run
$ ./zlib-example
Uncompressed size is: 36
Uncompressed string is: Hello Hello Hello Hello Hello Hello!
----------
@yourpalmark
yourpalmark / IncrementBuildVersion.cs
Last active March 3, 2023 08:41 — forked from darktable/IncrementBuildVersion.cs
Unity: Post-process script that increments revision number of iPhone and Android builds. Uses CFBundleShortVersionString as well as CFBundleVersion. CFBundleShortVersionString (Version) is set to {Major}.{Minor}.{Build}. CFBundleVersion (Build) is set to {Revision}. Revision is the auto-incremented value on every build.
/**
* Copyright 2012 Calvin Rien
* (http://the.darktable.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@t-mat
t-mat / win32-capture-stack-back-trace.cpp
Created December 15, 2013 22:38
Win32: CaptureStackBackTrace
// CaptureStackBackTrace
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb204633(v=vs.85).aspx
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
//////////////////////////////////////////////////////////////
void capture() {
const ULONG framesToSkip = 0;
const ULONG framesToCapture = 64;