Skip to content

Instantly share code, notes, and snippets.

View mcraveiro's full-sized avatar

Marco Craveiro mcraveiro

View GitHub Profile
@slimsag
slimsag / ramblings.md
Last active December 13, 2023 08:02
Because cross-compiling binaries for Windows is easier than building natively

Because cross-compiling binaries for Windows is easier than building natively

I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.

The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.

The source of truth for the 'open source' C#, C++, Rust, and other Windows SDKs is proprietary

You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.

@rougier
rougier / Toolbar.el
Created November 30, 2020 12:05
Emacs SVG Toolbar
;; An experiment for an SVG toolbar using icons from material.io
;;
;; Example usage: (toolbar 48 "black" "white" t t)
;; Material icons freely available (Apache 2 license) from
;; - https://material.io/resources/icons/?style=outline
;; - https://github.com/google/material-design-icons
(require 'xml) (require 'svg)
(defun toobar-item (label icon fg-color bg-color size with-icon with-label)
@ekaschalk
ekaschalk / esh-custom.el
Created June 24, 2017 04:39
Customizing your emacs shell.
(require 'dash)
(require 's)
(defmacro with-face (STR &rest PROPS)
"Return STR propertized with PROPS."
`(propertize ,STR 'face (list ,@PROPS)))
(defmacro esh-section (NAME ICON FORM &rest PROPS)
"Build eshell section NAME with ICON prepended to evaled FORM with PROPS."
`(setq ,NAME
@Anmint
Anmint / org-clock-time%-mod.el
Last active June 30, 2020 07:59
more precise percentage for clock table in org-mode
;; Copyright (C) 2017 by Anmint
;; Author: Anmint <anmint at outlook.com>
;; URL:
;; Version: 0.01
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
@peterspackman
peterspackman / mingw-w64-x86_64.cmake
Last active March 7, 2024 22:37
cmake toolchain file for mingw-w64 x86_64 builds on Ubuntu
# Sample toolchain file for building for Windows from an Ubuntu Linux system.
#
# Typical usage:
# *) install cross compiler: `sudo apt-get install mingw-w64`
# *) cd build
# *) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake ..
# This is free and unencumbered software released into the public domain.
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
@simgt
simgt / message.hpp
Created April 14, 2016 14:11
Flatbuffers, Boost.Asio, TCP
#pragma once
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
namespace net {
@windoze
windoze / rx-asio.hpp
Created December 19, 2015 14:06
Boost.ASIO scheduler for RxCPP
#include "rxcpp/rx-scheduler.hpp"
// TODO: C++17 Networking TS
#ifdef WITHOUT_BOOST
// Standalone ASIO
#include <asio.hpp>
namespace asio_ns=::asio
namespace system_ns=::std
#else
// Boost.ASIO
#include <asio.hpp>
#include <asio/ssl.hpp>
#include <algorithm>
#include <atomic>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <memory>
#include <thread>
@gregsexton
gregsexton / gist:dd2d6c304d06fc3e6833
Created July 11, 2015 17:50
Company backend for completing eshell history
(defun company-eshell-history (command &optional arg &rest ignored)
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-eshell-history))
(prefix (and (eq major-mode 'eshell-mode)
(let ((word (company-grab-word)))
(save-excursion
(eshell-bol)
(and (looking-at-p (s-concat word "$")) word)))))
(candidates (remove-duplicates
@imneme
imneme / randutils.hpp
Last active March 4, 2024 12:44
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*