Skip to content

Instantly share code, notes, and snippets.

@diego3g
diego3g / settings.json
Last active March 28, 2024 20:48
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active March 28, 2024 20:47
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@lopspower
lopspower / README.md
Last active March 28, 2024 20:45
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@imneme
imneme / randutils.hpp
Last active March 28, 2024 20:43
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
*
<html>
<head>
<style>
h1 {
text-align: center;
color: blueviolet;
}
h2 {
text-align: center;
Task 1: Create a project jumphost instance
Navigation menu > Compute engine > VM Instance
Task 2: Create a Kubernetes service cluster
gcloud config set compute/zone us-east1-b
gcloud container clusters create nucleus-webserver1
@alex27riva
alex27riva / rtl_tcp.service
Created January 31, 2022 19:18
Systemd service for running rtl_tcp on startup
[Unit]
Description=Software Defined Radio TCP Server
Requires=network.target
After=network.target
[Service]
ExecStart=/usr/bin/rtl_tcp -a 0.0.0.0
Restart=on-failure
KillMode=control-group
@hiaux0
hiaux0 / file-mime-types.ts
Last active March 28, 2024 20:37
Typescript Enum for file mime types
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
enum MimeTypes {
".aac" = "audio/aac",
".abw" = "application/x-abiword",
".arc" = "application/x-freearc",
".avi" = "video/x-msvideo",
".azw" = "application/vnd.amazon.ebook",
".bin" = "application/octet-stream",
".bmp" = "image/bmp",
@soatok
soatok / idleon.md
Last active March 28, 2024 20:37
Legends of IdleOn RNG Manipulation

Disclosure Timeline

Note: All dates are in YYYY-MM-DD format (as per ISO 8601 and other standards).

Date Action
2023-07-06 Emailed lava at lavaflame2 dot com with these details and a recommended fix.
2023-08-06 A month later, I follow up just asking if Lava has received my messages.
2023-11-15 Additional follow-up email
2023-11-15 Mentioned knowing an exploit in Discord, passed details onto moderator (Hotair)
@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)