Skip to content

Instantly share code, notes, and snippets.

View almibe's full-sized avatar
😺

Alex Michael Berry almibe

😺
View GitHub Profile
@MonoidMusician
MonoidMusician / sugar.js
Created January 26, 2024 05:05
Silly little syntax sugars for JavaScript :3
// Silly little syntax sugars :3
// _.name({name:"hello"}) == "hello"
// mk.name("hello") == {name: "hello"}
// _pipe.join(", ").length.line_(["do", "re", "mi"]) == 10
// Create a simple proxy for syntactic sugar for method names and function calls
const sugar = (handler, applier=undefined) => new Proxy(applier ? ()=>{} : {}, {
get: (_target, property, _thisArg) => {
return handler(property);

Quick start

Tauri is shipped with state management function/feature by default.

Basic usage is quite simple: a variable of State type can be accessed on the tauri commands which you have defined; in other words, "with tauri commands, they'll magically inject state for you," so that once a variable is managed you can inject them directly as additional input when defining the command.

Example Implementation

@mbbx6spp
mbbx6spp / covidate
Last active March 11, 2023 02:40
Only shows in UTC because timezones are bullshit and I needed to pick one. Sorry. It is what my servers use.
#!/usr/bin/env bash
main() {
local -ri mar_end=1583042400
local -ri today="$(date +"%s")"
local -r dow="$(date -u +"%a")"
local -r time="$(date -u +"%T")"
local -ri secs=86400
local -ri days_since="$(( ((${today} - ${mar_end}) / ${secs}) + 1 ))"
@staltz
staltz / app.kt
Last active May 6, 2024 03:15
Cycle giving baby steps into Kotlin
import kotlin.browser.document
import kotlin.browser.window
// Type definitions
native("Cycle")
val Cycle : dynamic = noImpl
native("Cycle.h")
fun h(tagName: String) : VTree = noImpl
@jewelsea
jewelsea / SlideOut.java
Last active November 19, 2020 12:33
Example of a JavaFX Pane which slides in and out on command.
import javafx.animation.*;
import javafx.application.Application;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.text.Text;
import javafx.scene.web.WebView;
import javafx.stage.Stage;