Skip to content

Instantly share code, notes, and snippets.

@mmozeiko
mmozeiko / !README.md
Last active May 2, 2024 21:22
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone 64-bit MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for 64-bit native desktop app development.

Run python.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.32.17.2 and v10.0.22621.0.

You can list available versions with python.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe from output folder, first run setup.bat - after that PATH/INCLUDE/LIB env variables will be setup to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@SandroMaglione
SandroMaglione / File.ts
Created May 1, 2024 20:56
File upload validation service created using `effect` only
import { Brand, Context, Data, Effect, Layer } from "effect";
type FileMetadata = Readonly<{ type: string; size: number }>;
export type ValidFile = FileMetadata & Brand.Brand<"ValidFile">;
const ValidFile = Brand.nominal<ValidFile>();
class FileTooLargeError extends Data.TaggedError("FileTooLargeError")<
Readonly<{ size: number }>
> {}
@regallll
regallll / readme.md
Created February 26, 2024 23:06
All Pre-Release/Non-Retail Builds

A list of all known pre-release and non-retail MotorStorm builds with download links accompanying the released builds. This list will be continuously updated. If you have anything to add to this list, please let me know.

Monument Valley

  • 2006/12/16 Preview Code
  • 2007/03/02 [BCES-00006/BCUS-98137]*
  • MotorStorm review

Pacific Rift

  • Pre-Alpha Demo (40% Complete)
  • Pre-Beta Demo (50% Complete)
@opus-x
opus-x / Spotify_Eliminate_Advertisements
Last active May 2, 2024 21:13
Eliminate Spotify Advertisements + Complete Server List
##################################################################################
# ELIMINATE SPOTIFY ADS (VERSION 1.2 - 8.5) - ABANDONED FOR NOW #
##################################################################################
#
# NOTE: SOMETIMES ONLY ANNOUNCEMENT OF AN AD WHILE USING APP VERSION 7.5-7.9?-8.x.
# USING AN OFFICIAL OLDER VERSION SOLVES THIS. TEST IT (APKMIRROR). THIS WILL NOT
# OCCUR USING CHROMECAST / GOOGLE HOME.
#
# COULD NOT SOLVE THE AUDIO AD INRO/OUTRO IN THE APP.
# SUGGESTIONS? WRITE A COMMENT BELOW.
@asambol
asambol / effective_c++.md
Last active May 2, 2024 21:12
Effective C++ by Scott Meyers

Chapter 1. Accustoming Yourself to C++

Item 1: View C++ as a federation of languages

  • Rules for effective C++ programming vary, depending on the part of C++ you are using.

Item 2: Prefer consts, enums, and inlines to #defines

  • For simple constants, prefer const objects or enums to #defines.
  • For function-like macros, prefer inline functions to #defines.
@fnky
fnky / ANSI.md
Last active May 2, 2024 21:12
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
openapi: 3.0.3
info:
version: '3.0'
title: 'V3'
description: |
Request Timing
When methods on the SDK are called, it should generally enqueue data locally into offline storage, and make batched flushes to the above endpoints on a timed basis, or when explicitly requested by the user. In general, the default flush interval should be in the 10s of seconds (reasonable default may depend on the nature of the platform), and should be configurable.
In the case of request failure (any non-20x response), the SDK should re-enqueue any failed events or attributes into local offline storage, and should begin an exponential slowdown of the flush interval, until a successful response is received. The backoff function should follow the decorrelated jitter algorithm below:
/*
*
* Original code by Miononno
* https://www.youtube.com/watch?v=1kanq1w2DA0
*
* Enhanced by unknown @ lteforum.at
*
*/
console.log("Loading ZTE Script v" + "2024-03-29-#1");
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active May 2, 2024 21:05
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@roychri
roychri / README.md
Created May 2, 2024 17:50
Stream Ollama (openai) chat completion API on CLI with HTTPie and jq

Stream Ollama (openai) chat completion API on CLI with HTTPie and jq

Explanation

This command sends a request to the Chat Completion API to generate high-level documentation for the file @src/arch.js. The API is configured to use the llama3-gradient model and to respond in Markdown format.

The messages array contains two elements:

  • The first element is a system message that provides the prompt for the API.
  • The second element is a user message that specifies the file for which to generate documentation.