Skip to content

Instantly share code, notes, and snippets.

@raysan5
raysan5 / raylib_vs_sdl.md
Last active March 12, 2025 13:38
raylib vs SDL - A libraries comparison

raylib_vs_sdl

In the last years I've been asked multiple times about the comparison between raylib and SDL libraries. Unfortunately, my experience with SDL was quite limited so I couldn't provide a good comparison. In the last two years I've learned about SDL and used it to teach at University so I feel that now I can provide a good comparison between both.

Hope it helps future users to better understand this two libraries internals and functionality.

Table of Content

@JSerZANP
JSerZANP / ContentView.swift
Created March 4, 2021 14:01
communication between native(swiftUI) and wkwebview
import SwiftUI
import WebKit
struct WebView: UIViewRepresentable {
class Coordinator: NSObject, WKNavigationDelegate, WKScriptMessageHandler {
var webView: WKWebView?
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.webView = webView
}
@skyline75489
skyline75489 / prompt.sh
Last active December 18, 2022 08:44
Windows Terminal OSC 9;9 for Bash & Zsh in WSL
__wt_osc9_9 () {
_win_path=$(wslpath -m $(pwd))
printf "\033]9;9;%s\033\\" "$_win_path"
}
[ -n "$BASH_VERSION" ] && [ -n "$WT_SESSION" ] && PROMPT_COMMAND="__wt_osc9_9"
[ -n "$ZSH_VERSION" ] && [ -n "$WT_SESSION" ] && precmd_functions+=(__wt_osc9_9)
true

Reason

I have heard a lot of complaints about lack of editor integration or flaky editor tooling in the Reason community. At my previous job we had ~3000 modules and ~80k LOC. I'll admit that we were not very vigilant with .rei files or keeping our inter module dependencies really clean so this slowed both bsb and especially reason-language-server down a lot.

In fact so much that people couldn't use reason-language-server anymore on 15" MacBook Pros.

I myself have always used a Merlin based setup since I joined the Reason eco system before reason-language-server, and in our project my setup had never failed. Therefor I went on a quest of setting up 3 of the major editors (Emacs, Vim and VSCode) and documenting how to get them working

@akoppela
akoppela / README.md
Last active June 10, 2023 18:32
Custom Elements with ES5 syntax

You'll need to include two pollyfils before you include a code with your custom elements:

webcomponents/webcomponentsjs/custom-elements-es5-adapter.js - this is for new browsers in order to understand ES5 syntax

webcomponents/custom-elements/custom-elements.min.js - this is for old browsers without customElements support

You can add them to your index.html file in the following way:

<div id="custom-elements-adapter">
@thesocialdev
thesocialdev / npm_repository_info.sh
Last active October 22, 2018 14:53
This Bash script is a prototype that recursively checks npm dependencies and its info and saves it into a CSV file.
#!/bin/sh
# Set NPM tree depth of search
DEPTH=2
# SET Github Development Token to search for repos in Github
OAUTH_TOKEN=
# SET Header with proper authorization
GITHUB_HEADER="Authorization: token ${OAUTH_TOKEN}"
# Path to CSV generated files
CSV_PATH="/path/to/csv/generated/files"
@mfeineis
mfeineis / ElmFsaPorts.elm
Last active March 6, 2018 01:53
This is a "minimal" example for integrating Elm with Flux-Standard-Actions of ReactJS fame (https://ellie-app.com/d6C53Vf3Pa1/0).
port module ElmFsaPorts exposing (main)
import Html exposing (Html, text)
import Json.Decode as Decode exposing (Decoder, Value)
import Json.Encode as Encode
port fromElm : Value -> Cmd msg
import React from 'react';
import lively from 'lively';
// Global registry and resize handler
let _registeredInstances = [];
function register(inst) {
if (_registeredInstances.length === 0) {
window.addEventListener('resize', onResize);
}
@jdlrobson
jdlrobson / pixies.py
Last active February 20, 2019 19:35
#!/usr/bin/env python
'''
Copyright [2017] [Jon Robson]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
import React, { PropTypes, Component } from 'react'
import { getRef, listToArray } from '../utils/firebase'
import { ErrorMessage, Loading } from '../Theme'
/*
```js
<Ref path="/somewhere">
{({ error, loaded, value }) => (
// `value` is an object w/ keys