Skip to content

Instantly share code, notes, and snippets.

@lega911
lega911 / se.xkb
Created December 10, 2022 19:20
xkb
// file: /usr/share/X11/xkb/symbols/se
default partial alphanumeric_keys
xkb_symbols "basic" {
include "latin(type2)"
include "se(se)"
};
partial alphanumeric_keys
@lega911
lega911 / App.xht
Last active January 2, 2022 12:39
Malina.js + TypeScript example
<script type="typescript">
let name: string = 'bar';
</script>
<h1>Hello {name}!</h1>
@lega911
lega911 / bindings.md
Last active September 25, 2020 19:00
Svelte, Malina.js
Svelte Malina.js Shortcut / Comment
Reference to element
bind:this={ref} #ref
1-way binding
prop={prop} prop={prop}
{prop} {prop}
2-way binding
bind:value={value} bind:value={value} :value={value} / :value:value
bind:value bind:value :value
@lega911
lega911 / xkb.symbols.se
Created October 30, 2019 11:15
keyboard layout se for ubuntu 19+
// file /usr/share/X11/xkb/symbols/se
partial alphanumeric_keys
xkb_symbols "se" {
name[Group1]="Swedish";
// tool: xev
// mapping key file: /usr/share/X11/xkb/keycodes/evdev
// reload conf: setxkbmap -layout se
// key <code> {[ default, +shift, +altGr, +shit +altgr ]};
@yi-jiayu
yi-jiayu / count_messages.py
Last active January 21, 2024 15:17
Using Telethon and the Telegram API to count the number of messages in each of your recent conversations
from telethon import TelegramClient
from telethon.errors.rpc_errors_401 import SessionPasswordNeededError
# (1) Use your own values here
api_id = 17349
api_hash = '344583e45741c457fe1862106095a5eb'
phone = 'YOUR_NUMBER_HERE'
username = 'username'
@GLMeece
GLMeece / latency_numbers.md
Last active May 22, 2024 15:57
Latency Numbers Every Programmer Should Know - MarkDown Fork

Latency Comparison Numbers

Note: "Forked" from Latency Numbers Every Programmer Should Know

Event Nanoseconds Microseconds Milliseconds Comparison
L1 cache reference 0.5 - - -
Branch mispredict 5.0 - - -
L2 cache reference 7.0 - - 14x L1 cache
Mutex lock/unlock 25.0 - - -
Online Builder, Basis and Full version
al-init $element
al-model - proxy for al-value, al-focused, al-checked ...
про эвенты и атрибуты - без компонентов
@event
@keydown.alt.control.shift.meta.enter
@kfox
kfox / tcpproxy.js
Created April 5, 2012 20:03
A basic TCP proxy written in node.js
var net = require("net");
process.on("uncaughtException", function(error) {
console.error(error);
});
if (process.argv.length != 5) {
console.log("usage: %s <localport> <remotehost> <remoteport>", process.argv[1]);
process.exit();
}