Skip to content

Instantly share code, notes, and snippets.

View sxlijin's full-sized avatar
🎯
doing things

Samuel Lijin sxlijin

🎯
doing things
View GitHub Profile
@sxlijin
sxlijin / maturin.log
Created June 19, 2024 22:48
maturin license-file.workspace log
~/sandbox/python-repro is 📦 v0.1.0 via 🐍 v3.12.3 | [0] at 15:45:16
❯ poetry remove baml-py; RUST_LOG=maturin=debug poetry run maturin build --manifest-path ~/baml/engine/language_client_python/Cargo.toml && poetry add ~/baml/engine/target/wheels/baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl
Updating dependencies
Resolving dependencies... (0.1s)
Package operations: 0 installs, 0 updates, 1 removal
- Removing baml-py (0.40.0 /Users/sam/baml/engine/target/wheels/baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl)
@sxlijin
sxlijin / attempt2.rs
Created June 7, 2024 05:27
ruby-tokio-demo
use futures::{future, FutureExt};
use magnus::{
class, exception::runtime_error, function, method, prelude::*, Error, IntoValue, RModule,
};
//#[cfg(ruby_have_ruby_fiber_scheduler_h)]
use rb_sys::bindings::uncategorized::{
rb_fiber_current, rb_fiber_scheduler_block, rb_fiber_scheduler_current, rb_fiber_scheduler_get,
rb_fiber_scheduler_kernel_sleep, rb_fiber_scheduler_unblock,
};
use std::cell::RefCell;
@sxlijin
sxlijin / caps_lock-is-ctrl.json
Created June 5, 2024 19:52
karabiner-elements rules
{
"description": "In Terminal/VSCode, caps_lock is CTRL",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal",
"^com\\.googlecode\\.iterm2",
"^com\\.microsoft\\.VSCode"
@sxlijin
sxlijin / remove_dir_safe.rs
Created May 16, 2024 21:46
rustfmt does not handle macros nicely example
fn remove_dir_safe(&self, output_path: &Path) -> Result<()> {
if !output_path.exists() {
return Ok(());
}
const MAX_UNKNOWN_FILES: usize = 5;
let mut unknown_files = vec![];
for entry in walkdir::WalkDir::new(output_path) {
if unknown_files.len() > MAX_UNKNOWN_FILES {
break;
@sxlijin
sxlijin / json_to_ruby.rs
Last active April 25, 2024 06:32
draft: ruby to json
use magnus::{
class, define_class,
encoding::{CType, RbEncoding},
exception::runtime_error,
function, method,
prelude::*,
scan_args::get_kwargs,
value::Value,
IntoValue, KwArgs, RArray, RHash, RObject, RString, Ruby,
};
@sxlijin
sxlijin / github-logo.svg
Last active August 28, 2023 20:33
github-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sxlijin
sxlijin / pnpm-lock.yaml
Created August 23, 2023 22:13
pnpm install jsonwebtoken@8.5.1
lockfileVersion: '6.1'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
jsonwebtoken:
specifier: 8.5.1
version: 8.5.1
@sxlijin
sxlijin / new-existing-issues-test.json
Last active July 6, 2023 20:49
new-existing-issues-test.json
{
"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/schemas/sarif-schema-2.1.0.json",
"runs": [
{
"results": [
{
"locations": [
{
"physicalLocation": {
"artifactLocation": {"uri": "package.json"},
@sxlijin
sxlijin / gist:c7a7147afc11bf23c10198db5c101c39
Created June 11, 2023 02:22
sofle_choc qmk build errors
sxlijin@sxlijin-debian:2023-06-10T19:21:16-0700:~/repos/blow-qmk (choc2) [0]
$ g lgn
++ 2023-06-10T19:21:21-0700 ++ git lgn
42f7458b04 (8 weeks ago) - (HEAD -> choc2, origin/choc2) Fix photo url of sofle choc
871e067678 (8 weeks ago) - Apply tri layer handling for sofle choc.
4217deafeb (8 weeks ago) - Add default encoder behaviour.
11a7c61569 (8 weeks ago) - Replace deprecated RGB_DI_PIN.
8ab84c008a (8 weeks ago) - Merge remote-tracking branch 'upstream/master' into choc2
6d965d486c (8 weeks ago) - Add hardware information momokai keyboards (#20434)
ce417226b2 (8 weeks ago) - 4pplet/eagle_viper_rep/rev_a Layout Macro Conversion and Additions (#20414)
@sxlijin
sxlijin / utf8_examples.md
Last active November 16, 2019 05:15
UTF8 Examples
Helsingør, Espergærde, Humlebæk, Nivå, Vedbæk, Østerport, Nørreport, København H

Jan Łukasiewicz, Wacław Sierpiński, Paul Erdős, Évariste Galois

Andrey Nikolaevich Kolmogorov (Russian: Андрей Николаевич Колмогоров)
Pafnuty Lvovich Chebyshev (Russian: Пафну́тий Льво́вич Чебышёв)
Aleksandr Mikhailovich Lyapunov (Russian: Алекса́ндр Миха́йлович Ляпуно́в)
Grigori Yakovlevich Perelman (Russian: Григо́рий Я́ковлевич Перельма́н)
Georgy Feodosevich Voronoy (Ukrainian: Георгій Феодосійович Вороний)