Skip to content

Instantly share code, notes, and snippets.

View clsource's full-sized avatar
💻
🥷🏼

Camilo clsource

💻
🥷🏼
View GitHub Profile
@rxliuli
rxliuli / a-less-favorable-vue3.md
Last active April 7, 2025 21:16
Svelte5: A Less Favorable Vue3

Svelte5: A Less Favorable Vue3

Background

Svelte5 was released in October last year, touted as the best version of Svelte to date. The team was particularly proud of "runes," a reactive state system built on proxies. However, after experiencing Vue3's Composition API and SolidJS signals, I didn't feel particularly excited. This blog outlines specific issues encountered when using Svelte5 in real projects. If you're a Svelte5 enthusiast, you might want to stop reading now.

Runes Only Work in Svelte Components or .svelte.ts Files

When trying to write hooks with runes similar to React/Vue, like useCounter:

@zachdaniel
zachdaniel / libraries_and_frameworks.md
Last active June 29, 2023 16:42
EEF Working Group Proposal: Libraries and Frameworks Working Group

Libraries and Frameworks Working Group

Mission Statement

  • To provide resources for library and framework authors to ensure that BEAM languages have a rich, vibrant ecosystem with a high degree of developer experience. Main Objectives
  • Provide and maintain best practices on library and framework standardization, documentation, code, and distribution. Collaborate to work on and make proposals for underlying tooling that improve the experience for library/framework authors and users.
  • Provide more visibility into the library ecosystem of Elixir on behalf of both authors and users.
  • (if Build and Packaging want to move this here, we could also take this over) Improve the user experience in generating and accessing documentation from the shell, IDEs, web pages, and more.
@sorentwo
sorentwo / start_oban_web.livemd
Created July 27, 2022 16:38
Single Page Oban Web

Single Page Oban Web

Application.put_env(:sample, Sample.Repo, database: "oban_dev")

Application.put_env(:phoenix, :json_library, Jason)

Application.put_env(:sample, Sample.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 5001],
  server: true,
@Eleven-am
Eleven-am / phœnix-channels-react-hook.tsx
Last active August 15, 2022 09:39
This is a relatively typed phoenix channels hook that works incredibly well with react. you can create the same channels in multiple components as they share the same channel singleton
import {
createContext,
ReactNode,
useCallback,
useContext,
useEffect, useMemo,
useRef,
useState
} from "react";
import {Channel, Presence, Socket} from "phoenix";

Hello, Diagrams!

GitHub recently added support for including Mermaid diagrams in Markdown files. The good news is that it works for AsciiDoc files as well. Here is an example:

sequenceDiagram
    participant Alice
    participant Bob

Creating a .so dynamic library of a haskell program and calling it from C

TLDR:

  • Export a haskell function with foreign export.
  • Create a C wrapper that calls hs_init when the library is loaded.
  • Compile the .hs and .c wrapper with ghc, linking with lHSrts-ghc8.6.5
  • Use it from C by linking as usual.

(For more details, see here.)

@hollowmaster1496
hollowmaster1496 / msys2-shortcut.md
Last active December 9, 2024 19:12
Open MSYS2 terminal here (mingw-w64) from right-click menu

For anyone who develops software on Windows (but needs quick access to a Linux terminal), here's a quick and easy way to get it with MSYS2.

Before starting, install "MSYS2" with default settings.

  1. From Windows search, launch 'regedit.exe'
  2. Navigate to "HKEY_CLASSES_ROOT\Directory\Background\shell"
  3. Right-click on 'shell' and select New>Key. Call this key MSYS2.
  4. Now right-click on 'MSYS2' and select New>Key. Call this key command
  5. Select command and then double-click on (Default). Set 'Value data' to "C:\msys64\msys2_shell.cmd" "-here"
@Pigu-A
Pigu-A / dmf2ds24.py
Last active January 8, 2022 17:30
Deflemask module (.dmf) to DevSound 2.4 converter. Not all features are converted correctly.
import io, string, sys, zlib
CH3_DMF_VOL_IS_DS_VOL = False
def sane(a):
cap = True
t = ""
for i in a.decode():
if i in string.ascii_letters + string.digits + "_":
t += i.upper() if cap else i
cap = False
@cute
cute / JavaScriptCore+fetch.swift
Created April 26, 2019 22:59 — forked from yycking/JavaScriptCore+fetch.swift
add fetch, console.log and Promise.then/catch to JavaScriptCore on iOS/Mac
import JavaScriptCore
extension JSContext {
subscript(key: String) -> Any {
get {
return self.objectForKeyedSubscript(key)
}
set{
self.setObject(newValue, forKeyedSubscript: key as NSCopying & NSObjectProtocol)
}
@dhkatz
dhkatz / msys2-visual-studio-code.md
Last active April 11, 2025 22:03
Using MSYS2 with Visual Studio Code

Using MSYS2 with Visual Studio Code is extremely easy now thanks to the Shell Launcher extension by Tyriar.

First, install the extension and reload Visual Studio Code.

Then, open the settings.json to edit your settings.

Add the field shellLauncher.shells.windows. I recommend using autocompletion here so that all the default shells are added.

You should having something like this now: