Skip to content

Instantly share code, notes, and snippets.

@jianyun8023
jianyun8023 / book-convert.sh
Created April 21, 2022 10:36
ebook convert base on eCore
#!/bin/bash
workdir=$(pwd)
filepath=$1
format=$2
outdir=$3
book_convert(){
filepath=$1
format=$2
tmp_dir="$HOME/Downloads/eCoreCmdtmp/$(uuidgen)"
mkdir -p $tmp_dir
@StephenCleary
StephenCleary / chat.lua
Last active July 3, 2024 02:12
Starting point for a custom TCP Wireshark dissector in Lua
-- authors: Hadriel Kaplan <hadriel@128technology.com>, Stephen Cleary
-- Copyright (c) 2015-2022, Hadriel Kaplan, Stephen Cleary
-- This code is in the Public Domain, or the BSD (3 clause) license if Public Domain does not apply in your country.
-- Thanks to Hadriel Kaplan, who wrote the original FPM Lua script.
-- This is a starting point for defining a dissector for a custom TCP protocol.
-- This approach assumes that each message has a header that indicates the message length.
-- The code in this example uses a 4-byte header which is just a 4-byte big-endian message length,
-- and this length does not include the length of the header.
-- Modify the sections marked TODO to adjust these assumptions.
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active July 2, 2024 07:04
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@kfreezen
kfreezen / datagridcomboboxcolumn-singleclick.markdown
Last active August 2, 2023 08:14
DataGridComboBoxColumn single-click edit. Commit edit after selection changed

I experienced some frustration with lack of other examples on getting select boxes to work on WPF DataGrid.

The first problem I encountered was that combo boxes did not have single-click to edit. That's what the Setters are for.

The next problem was that once I selected an item in a combobox, the combobox would not leave edit mode if I clicked directly into the next row. That's what the LostFocus and GotFocus events fix.

<!-- XAML -->
<DataGridComboBoxColumn
    ItemsSource="{Binding Source=Blah}"
@raphaelvallat
raphaelvallat / ecg_derived_respiration.ipynb
Last active December 5, 2023 13:45
Extract respiration signal and respiratory rate from ECG using R-R interval.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davideicardi
davideicardi / BsonToJson.cs
Last active April 28, 2024 14:49
BsonDocument to Json string
// This method convert a json to a valid string json
// It should handle all mongodb data types correctly (Date, ObjectId, ...) thanks to the
// Newtonsoft.Json.Bson.BsonReader serializer
public string ToJson(BsonDocument bson)
{
using (var stream = new MemoryStream())
{
using (var writer = new BsonBinaryWriter(stream))
{
@hygull
hygull / generating-toast-notifications-on-windows.md
Last active June 9, 2023 23:12
Generating toast notifications on windows 10 using Python
@mbinna
mbinna / effective_modern_cmake.md
Last active June 26, 2024 13:26
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@ChuckSavage
ChuckSavage / AppendImageExtension.cs
Created August 29, 2017 18:29
C# Is file an image and get its type
// Includes a mini-program for checking and fixing files that have no extension
// Only checks for the most common types
// If you create a better version, please upload it here.
using System;
using System.Collections.Generic;
using System.IO;
namespace AppendJPG
{