Skip to content

Instantly share code, notes, and snippets.

@balazser
balazser / myweechat
Created November 3, 2022 17:38 — forked from ecool/myweechat
My always up-to-date WeeChat configuration (weechat-dev)
# Encrypted password in sec.conf
/secure passphrase <pass>
/secure set zncpass <pass>
# Default setting for all network
@balazser
balazser / emojis.sh
Created September 15, 2022 09:28 — forked from BuonOmo/emojis.sh
A list of all UTF-8 emojis in bash or zsh
# Obtained with the code written in next file
emoji_grinning_face=😀
emoji_grinning_face_with_big_eyes=😃
emoji_grinning_face_with_smiling_eyes=😄
emoji_beaming_face_with_smiling_eyes=😁
emoji_grinning_squinting_face=😆
emoji_grinning_face_with_sweat=😅
emoji_rolling_on_the_floor_laughing=🤣
emoji_face_with_tears_of_joy=😂
emoji_slightly_smiling_face=🙂
@balazser
balazser / calculate_pct.js
Last active September 22, 2020 15:58
Galaxus #website #inbrowser
// show percentage
Array.from(document.querySelectorAll('.products-wrapper .product-price'))
.map(e => {
var price;
try {
price = Object.assign(
e.innerHTML.toString().match(/was (?<from>[\d\.]+)/).groups,
e.innerHTML.toString().match(/>CHF<\/span> (?<to>[\d\.]+)/)
.groups
);
@balazser
balazser / SampleActor.js
Created June 19, 2019 13:15
Use csv stream package #csv
const fs = require('fs')
const path = require('path')
const csvParser = require('csv-parse')
const stringify = require('csv-stringify')
const file = path.resolve(process.cwd(), './_data/samples.csv')
/**
* Actor definition class.
*/
@balazser
balazser / all.sh
Created June 13, 2019 13:29
commands #git
git commit -m [BUILD] --allow-empty
@balazser
balazser / mkdir_if_not_exists.js
Last active June 13, 2019 08:01
Make dir if not exists #fs
const dir = dirQueue;
await new Promise((resolve, reject) => {
fs.exists(dir, exists => {
if (!exists) {
fs.mkdir(dir, err => {
if (err) {
reject(err);
}
resolve(dir);
});
@balazser
balazser / comedy_fork.js
Created June 7, 2019 11:00
#actor #comedy #fork #test
var actors = require('comedy');
/**
* Actor definition class.
*/
class MyActor {
sayHello(to) {
// Reply with a message, containing self PID.
return `Hello to ${to} from ${process.pid}!`;