Skip to content

Instantly share code, notes, and snippets.

View lmariscal's full-sized avatar
🫖
418

Leonardo Mariscal lmariscal

🫖
418
View GitHub Profile
@Widdershin
Widdershin / ssr.md
Last active March 8, 2024 11:21
The absurd complexity of server-side rendering

In the olden days, HTML was prepared by the server, and JavaScript was little more than a garnish, considered by some to have a soapy taste.

After a fashion, it was decided that sometimes our HTML is best rendered by JavaScript, running in a user's browser. While some would decry this new-found intimacy, the age of interactivity had begun.

But all was not right in the world. Somewhere along the way, we had slipped. Our pages went uncrawled by Bing, time to first meaningful paint grew faster than npm, and it became clear: something must be done.

And so it was decided that the applications first forged for the browser would also run on the server. We would render our HTML using the same logic on the server and the browser, and reap the advantages of both worlds. In a confusing series of events a name for this approach was agreed upon: Server-side rendering. What could go wrong?

In dark rooms, in hushed tones, we speak of colours.

@lmariscal
lmariscal / leo@ldmd.mx.pgp
Created December 7, 2020 04:51
leo@ldmd.mx.pgp
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEXrdSgBYJKwYBBAHaRw8BAQdAnHxKwzQ6sMAcEcDU/OPs8CTAVlnRg2j3iCEM
xG4Q1ga0H0xlb25hcmRvIE1hcmlzY2FsIDxsZW9AbGRtZC5teD6IjgQTFgoANhYh
BLMwIx3BjpFcvoEpM5bOgxcHIHSfBQJet1KAAhsDBAsJCAcEFQoJCAUWAgMBAAIe
AQIXgAAKCRCWzoMXByB0n78RAQD4X6q/vDeRJRCJtDF63Dw8e1kpAd8dfevnBUUh
2uI30wD7BhO4RXTUCebr/1/r+q7g0TK9D4pv6k2/a1AYvhAWTwO4OARet1KAEgor
BgEEAZdVAQUBAQdAaavByids3jXKXtNAPIf9AOZ3ZjKdVNHIgUAEwmnuZloDAQgH
iHgEGBYKACAWIQSzMCMdwY6RXL6BKTOWzoMXByB0nwUCXrdSgAIbDAAKCRCWzoMX
ByB0n6C8AP9fKh6W8lWYeptpzdzxc1jnVOC+E24webvR44OrXT+v5gD/Z+PxjIXd
@caiorss
caiorss / CMakeLists.txt
Created November 27, 2020 14:05
QuickJS engine sample project - shows how to embedded in C++
cmake_minimum_required(VERSION 3.9)
project(QuickJS-Experiment)
#========== Global Configurations =============#
#----------------------------------------------#
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_VERBOSE_MAKEFILE ON )
set( CMAKE_CXX_EXTENSIONS OFF)
@demotomohiro
demotomohiro / Hotcodereloading_with_glfw_ sample.md
Created February 4, 2020 16:17
Nim's hot code reloading with GLFW sample

Tested this sample with Nim 1.0.6 on Windows 8.1

  1. Install Nim Game Library
nimble install nimgl
  1. Get glfw3.dll Go to GLFW web site, go to Download page and download Windows pre-compiled binaries. Unzip it and copy glfw3.dll to where you run sample program.

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

https://youtu.be/-C-JoyNuQJs?t=39m45s
When I put the reference implementation onto the website I needed to
put a software license on it.
And I looked at all the licenses that were available, and there were a lot
of them. And I decided that the one I liked the best was the MIT License,
which was a notice that you would put on your source and it would say,
"you're allowed to use this for any purpose you want, just leave the
notice in the source and don't sue me."
set(triple "x86_64-scei-ps4")
set(CMAKE_SYSTEM_NAME "FreeBSD")
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_C_COMPILER_AR "ar")
set(CMAKE_LINKER "clang")
set(CMAKE_ASM_COMPILER "clang")
set(CMAKE_FIND_ROOT_PATH "$ENV{PS4SDK}/usr" CACHE STRING "")

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

#pragma once
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
namespace ImGui
{
inline void SetupImGuiStyle( bool bStyleDark_, float alpha_ )
{
@bkaradzic
bkaradzic / orthodoxc++.md
Last active April 23, 2024 13:59
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?