Skip to content

Instantly share code, notes, and snippets.

@sunmeat
sunmeat / main.cpp
Last active May 6, 2024 17:22
one server multiple clients C++ example (TCP)
CLIENT SIDE:
#define WIN32_LEAN_AND_MEAN
#include <ws2tcpip.h>
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
@juliusmarminge
juliusmarminge / enum-generator.ts
Last active May 6, 2024 17:22
prisma enum generator
import { generatorHandler } from "@prisma/generator-helper";
import fs from "node:fs/promises";
import path from "node:path";
const header = `// This file was generated by a custom prisma generator, do not edit manually.\n`;
generatorHandler({
onManifest() {
return {
defaultOutput: "./enums/index.ts",
@GOROman
GOROman / CRSFProtocol.md
Last active May 6, 2024 17:20
ExpressLRS / CRSF Protocol 解析メモ
@endofcake
endofcake / Dockerfile
Last active May 6, 2024 17:20
Copy *.csproj files during a docker build, preserving the directory structure (kudos to @aidansteele)
COPY src/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p ${file%.*}/ && mv $file ${file%.*}/; done
@ZhaofengWu
ZhaofengWu / install_zsh.sh
Last active May 6, 2024 17:19
Install zsh without root
#!/bin/bash
set -e
# OPTIONAL: zsh will not install without ncurses. IF your machine doesn't have ncurses, you need to install it first.
export CXXFLAGS=" -fPIC" CFLAGS=" -fPIC" CPPFLAGS="-I${HOME}/include" LDFLAGS="-L${HOME}/lib"
wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.2.tar.gz
tar -xzvf ncurses-6.2.tar.gz
cd ncurses-6.2
./configure --prefix=$HOME --enable-shared
@mbinna
mbinna / effective_modern_cmake.md
Last active May 6, 2024 17:19
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

@rxaviers
rxaviers / gist:7360908
Last active May 6, 2024 17:18
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jerodg
jerodg / windows_and_office_kms_setup.adoc
Last active May 6, 2024 17:18
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@Makeshift
Makeshift / tutorial.md
Last active May 6, 2024 17:17
Tutorial for automatically syncing an Obsidian vault with Git on an Android device

How to sync Obsidian with Git on Android

Limitations

  • If Termux is closed in the background by Android, the cron service will stop updating your repository and you must open Termux again. Refer to instructions for your device model to disable the killing of certain background applications.
  • This may negatively affect your devices battery life. I'm not entirely sure yet.

Setup

@shortjared
shortjared / list.txt
Last active May 6, 2024 17:16
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com