Skip to content

Instantly share code, notes, and snippets.

@jvranish
jvranish / stack_traces.c
Last active July 15, 2024 16:39
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>
@mmozeiko
mmozeiko / win32_crt_float.cpp
Last active February 16, 2024 14:24
Visual C/C++ CRT functionality
extern "C"
{
int _fltused;
#ifdef _M_IX86 // following functions are needed only for 32-bit architecture
__declspec(naked) void _ftol2()
{
__asm
{
@jonathanasdf
jonathanasdf / python-3.7-cygwin.patch
Last active March 4, 2017 00:17
Python 3.7 Cygwin
diff --git a/Include/py_curses.h b/Include/py_curses.h
index 336c95d..0d87624 100644
--- a/Include/py_curses.h
+++ b/Include/py_curses.h
@@ -17,6 +17,13 @@
#define NCURSES_OPAQUE 0
#endif /* __APPLE__ */
+#ifdef __CYGWIN__
+/* the following define is necessary for Cygwin; without it, the
namespace GitBuildInfo
{
/// <summary>
/// A MSBuild task that generates the msbuild information for an assembly.
///
/// Note: use in the BeforeBuild target.
/// </summary>
public class GitBuildInfoGenericTask : GitBuildInfoTask
{
/// <inheritdoc/>
@jnm2
jnm2 / Ref assembly NuGet package with refout.csproj
Created June 2, 2020 20:06
For when you need refout rather than refonly two produce two artifacts: a ref assembly NuGet package, and a non-NuGet distribution mechanism for the lib assembly.
<Project Sdk="Microsoft.NET.Sdk">
<!-- ... -->
<!-- Ref assembly NuGet packaging -->
<PropertyGroup>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<BuildOutputTargetFolder>ref</BuildOutputTargetFolder>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);UseRefAssemblyAsBuildOutputInPackage</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
@AraHaan
AraHaan / main.asm
Created July 15, 2021 22:49
Some old asm code of mine.
TITLE main.asm
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES
PUBLIC _memcpy
@ZacharyPatten
ZacharyPatten / gist:6172f642337e4adc9f404bca973d7182
Last active February 3, 2023 16:02
This is a prototype README for the dotnet GitHub organization

dotnet GitHub Dashboard

dotnet is a free, cross-platform, open-source developer platform for building many different types of applications