- redom (1.6k) - Tiny turboboosted JavaScript library for creating user interfaces
- frzr (1.6k) - Turboboosted 2 KB view library for browser & node.js
- killroy (1.9k) - A tiny ui library inspired by React
- real-dom (0.7k) - A ~1K non-virtual DOM non-framework framework for simple apps
- domchanger (1.8k) - Dombuilder that applies diffs only to the real dom
- vomit (3.2k) - A high order function using virtual dom to build user interfaces
- bel (3.5k) - A simple library for composable DOM elements using tagged template strings
- yo-yo (5.4k) - A tiny library for building modular UI components using DOM diffing and ES6 tagged template literals (build on bel)
- [choo](https://github.com/yos
Discover gists
#! /bin/sh | |
# the metadata only contains the name of the default sink | |
default_sink_name=$(pw-metadata 0 'default.audio.sink' | grep 'value' | sed "s/.* value:'//;s/' type:.*$//;" | jq .name) | |
default_sink_id=$(pw-dump Node Device | jq '.[].info.props|select(."node.name" == '" $default_sink_name "') | ."object.id"') | |
current_volume=$(pw-cli enum-params "$default_sink_id" 'Props' | grep -A 2 'Spa:Pod:Object:Param:Props:channelVolumes' | awk '/Float / {gsub(/.*Float\s/," "); print $1^(1/3) }') | |
change="${1:-0.1}" # defaults to increment of 0.1 | |
new_volume=$(echo "$current_volume $change" | awk '{printf "%f", $1 + $2}') | |
# we need to reconvert to cubic root | |
#new_volume_cube=$(echo "$new_volume" | awk '{ print $1^3 }') |
This is my edited version of Jeff Hoogland's original article on the eet command. It is posted here because it is hard to find online as the original link is now dead and not even found in the Wayback Machine.
One of the things that allow the Enlightenment Foundation Libraries to be as fast and efficient as they are in their use of compiled files for storing information. While these compiled files are fast, the drawback to using them is that there is some difficulty when you want to manually access/edit the data these files contain. Today I am going to talk about how we can gain access to the data contained in compiled Enlightenment Foundation Library EET data files.
EET files are binary data files that generally hold configuration options/settings for applications. To work with these files we will need acce
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
/* This is a wrapper library that will give your server the power of | |
* /dev/null as a service, as seen at http://devnull-as-a-service.com/ | |
* | |
* Compile: | |
* gcc -ggdb -shared -fPIC dnaas.c -ldl -lcurl -o libdnaas.so | |
* | |
* Try: | |
* LD_PRELOAD=./libdnaas.so dd if=/dev/sda of=/dev/null bs=8192 count=16 | |
* | |
* Install: |
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` | |
? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` | |
: Lowercase<S> | |
type KeysToCamelCase<T> = { | |
[K in keyof T as CamelCase<string & K>]: T[K] | |
} | |
type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? |
Install and Build and Screenshot.
git clone https://gist.github.com/906764beb36481301405c586abd81011.git
cd 906764beb36481301405c586abd81011
npm install
npm run build
npm run screenshot https://gist.github.com/ukyo/906764beb36481301405c586abd81011
open out.html
import tiktoken | |
import langdetect | |
T = tiktoken.get_encoding("o200k_base") | |
length_dict = {} | |
for i in range(T.n_vocab): | |
try: | |
length_dict[i] = len(T.decode([i])) | |
except: |
# coding=utf-8 | |
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. | |
# | |
# 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 | |
# | |
# Unless required by applicable law or agreed to in writing, software |