Skip to content

Instantly share code, notes, and snippets.

View kurumpa's full-sized avatar
🦀
typing...

Kirill kurumpa

🦀
typing...
View GitHub Profile
export function formatNumber(fmt: string, value: number) {
// special case for `#,##0.0###`
// warning! you can't use `,` as a decimal delimiter in that particular case
// also, you can use up to 8 decimal places here
if (fmt[fmt.length - 1] === "#") {
const dotPos = fmt.lastIndexOf(".")
if (dotPos > -1) {
// fractional part
// -0.345; toFixed() is used to get rid of 0.9994999999180436 that is formatted using 0.0## into 0.999 which is wrong
/**
* Ever wanted webix segmented button to have a few segments of fixed width AND a button that fills remaining space?
* Here comes this custom template. It can also be modified to split "remaining space" into segments with equal width.
*/
function segmentedFillWidth (obj, common) {
var origOpts = common.config.options
var opts = origOpts.slice()
function hasWidth (v) { return !!v.width }
function hasNoWidth (v) { return !v.width }
@kurumpa
kurumpa / autohotkey.ahk
Last active March 19, 2023 19:05
dynamic clantag cs go
; This script for http://autohotkey.com will constantly press
; the middle mouse button to change CS:GO clan tag 6 times per second
; (the script is active only when CS:GO is running)
; you can change the button to whatever you don't use in the game, eg. F12
; in that case update user.cfg accordingly
;
; Groups to join:
; http://steamcommunity.com/groups/loading001
; http://steamcommunity.com/groups/loading002
; http://steamcommunity.com/groups/loading003