Skip to content

Instantly share code, notes, and snippets.

@fosterbrereton
fosterbrereton / better_macros_better_flags.cpp
Last active April 28, 2024 15:20
Companion source code for the article "Better Macros, Better Flags."
/*
MIT License
Copyright 2019 Foster T. Brereton
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:
@slavirok
slavirok / benthos_eh_to_kafka_conf.yaml
Last active April 28, 2024 15:19
BenthOS AzureEventHub Source
input:
kafka:
addresses:
- ${EVENTHUB_BOOTSTRAP_SERVER}
topics: [${EVENTHUB_TOPIC}]
tls:
enabled: true
skip_cert_verify: true
root_cas_file: ""
client_certs: []
@tanxpyox
tanxpyox / else.yaml
Last active April 28, 2024 15:17
2005年《A Dictionary Of Cantonese Slang》jyutping
㗎仔 gaa4 zai2
㗎佬 gaa4 lou2
㗎妹 gaa4 mui1
㗎話 gaa4 waa2
㗎頭 gaa4 tau4
㢥旗 dung6 kei4
㢥起床板 dung6 hei2 cong4 baan2
㩒機 gam6 gei1
㬌轟 ging2 gwang2
䟴䟴吓 an3 an3 haa2
@CocoaCaa
CocoaCaa / vscode-sawaratsuki-logo.css
Created April 27, 2024 15:50
Visual Studio Code with @sawaratsuki1004's custom logo
.editor-group-watermark {
max-width: 400px !important;
}
.editor-group-watermark > .letterpress {
aspect-ratio: 1920/1080 !important;
background-image:url('https://github.com/SAWARATSUKI/ServiceLogos/blob/c2cf29211b93efe48e5c34451bac5c56f979ab94/VisualStudioCode/VisualStudioCodeRound.png?raw=true') !important;
background-position: center;
}
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 15:20
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@singledigit
singledigit / cognito.yaml
Last active April 28, 2024 15:12
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@DartPower
DartPower / ms-office-dl-links
Last active April 28, 2024 15:11
MS Office Download Links
@InNoHurryToCode
InNoHurryToCode / ClangOnWindows.md
Last active April 28, 2024 15:10
How to install clang on windows using the visual studio build tools

Clang on Windows (VS 2017 build tools)

There are plenty of tutorials online on how to install clang on windows with visual studioIDE and MinGW. However, there are none on clang with visual studio build tools.

Requirements:

  • 64-bit Windows 7 SP1 or newer with the latest updates installed
  • 6 GB of free space on the partition where Windows is installed
  • internet connection (for installation only)

1. Install VS 2017 build tools

%VS2017BuildToolsDir% = installation directory of VS 2017 build tools

@sebjai
sebjai / Execution_Limit_MarketOrder.ipynb
Last active April 28, 2024 15:10
Implementation of optimal execution using limit and market orders from Chap 8.5 of Algorithmic and High-Frequency Trading by Cartea, Jaimungal, & Penalva (2015) Cambridge University Press
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bUxEE
bUxEE / wp-recursive-menu.php
Last active April 28, 2024 15:07
Recursive menu/submenu list from wp_get_nav_menu_items. Change menu name and style to your needs. Supports unlimited number of submenus.
<?php
$menu_name = 'menu-name';
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) );
//echo '<pre>'.print_r($menuitems).'</pre>';
function buildTree( array &$elements, $parentId = 0 )
{