Skip to content

Instantly share code, notes, and snippets.

View dsseng's full-sized avatar

Dmitry Sharshakov dsseng

View GitHub Profile
@dsseng
dsseng / root-podman-wayland.sh
Created October 7, 2023 15:06 — forked from eoli3n/root-podman-wayland.sh
Run an application with dbus and wayland sockets in a rootless podman container
# Install docker or podman package on your distro (podman doesn't need a daemon like dockerd to work). All args are exactly same, just replace ``podman`` with ``docker`` in command if you want to.
sudo pacman -S podman
# Run an archlinux container with dbus and wayland sockets.
sudo podman run \
--volume "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY":/tmp/wayland-0 \
--device /dev/dri \
--volume /run/user/1000/bus:/tmp/bus \
--rm -it archlinux /bin/bash
@dsseng
dsseng / app_camera.cpp
Created May 27, 2023 18:59
A snippet to stream from ESP32-CAM using local UDP transport (no error correction etc). Just sends JPEG in chunks, it turns out to be the most performant way. Is not a complete example
#include <Arduino.h>
#include <esp_camera.h>
#include <ESPAsyncWebServer.h>
#include <AsyncUDP.h>
#include <stdint.h>
AsyncUDP vid_udp;
IPAddress client_ip;
uint16_t client_port;
// MTU for data in packets
@dsseng
dsseng / Arc-settings
Last active March 14, 2021 07:09
Arc menu set up to match NordSur theme (for new Arcmenu extension)
[/]
alphabetize-all-programs=true
application-shortcuts-list=[['Settings', 'preferences-system-symbolic', 'gnome-control-center.desktop'], ['Tweaks', 'org.gnome.tweaks-symbolic', 'org.gnome.tweaks.desktop'], ['Terminal', 'utilities-terminal-symbolic', 'org.gnome.Terminal.desktop'], ['Activities Overview', 'view-fullscreen-symbolic', 'ArcMenu_ActivitiesOverview']]
arc-menu-placement='DTP'
available-placement=[false, true, false]
border-color='rgb(63,62,64)'
color-themes=[['ArcMenu Theme', 'rgba(28, 28, 28, 0.98)', 'rgba(211, 218, 227, 1)', 'rgb(63,62,64)', 'rgba(238, 238, 236, 0.1)', 'rgba(255,255,255,1)', 'rgb(63,62,64)', '9', '0', '0', '0', '0', 'false'], ['Dark Blue Theme', 'rgb(25,31,34)', 'rgb(189,230,251)', 'rgb(41,50,55)', 'rgb(41,50,55)', 'rgba(255,255,255,1)', 'rgb(41,50,55)', '9', '1', '5', '12', '24', 'true'], ['Light Blue Theme', 'rgb(255,255,255)', 'rgb(51,51,51)', 'rgb(235,235,235)', 'rgba(189,230,251,0.9)', 'rgba(89,89,89,1)', 'rgba(189,230,251,0.9)', '9', '1', '5', '12', '24', 'true'], ['NordSu
@dsseng
dsseng / heic-to-gnome.py
Last active February 23, 2021 18:46
Run without root. Install macOS 10.14+ dynamic HEIC wallpapers on Linux (in GNOME). You will need `exiftool` and `heif-convert` to be available in your PATH. All created wallpaper and config files' names are printed out. At the moment this script lacks support for sun-based wallpapers. Some H24 wallpapers might also be parsed incorrectly.
import plistlib
import sys
import os
import json
import base64
from pathlib import Path
name = ".".join(sys.argv[1].split(".")[:-1]).split("/")[-1]
if sys.argv[1].split(".")[-1] != "heic":
@dsseng
dsseng / vue.global.js
Last active October 26, 2019 13:46
Vue 3 alpha global build (commit 8edfbf9)
var Vue = (function (exports) {
'use strict';
// Patch flags are optimization hints generated by the compiler.
// when a block with dynamicChildren is encountered during diff, the algorithm
// enters "optimized mode". In this mode, we know that the vdom is produced by
// a render function generated by the compiler, so the algorithm only needs to
// handle updates explicitly marked by these patch flags.
// runtime object for public consumption
const PublicPatchFlags = {
@dsseng
dsseng / vue.esm-browser.js
Last active October 26, 2019 13:47
Vue 3 alpha ESM build (commit 8edfbf9)
// Patch flags are optimization hints generated by the compiler.
// when a block with dynamicChildren is encountered during diff, the algorithm
// enters "optimized mode". In this mode, we know that the vdom is produced by
// a render function generated by the compiler, so the algorithm only needs to
// handle updates explicitly marked by these patch flags.
// runtime object for public consumption
const PublicPatchFlags = {
TEXT: 1 /* TEXT */,
CLASS: 2 /* CLASS */,
STYLE: 4 /* STYLE */,
@dsseng
dsseng / keybase.md
Created May 15, 2019 14:20
Keybase

Keybase proof

I hereby claim:

  • I am sh7dm on github.
  • I am sh7dm (https://keybase.io/sh7dm) on keybase.
  • I have a public key whose fingerprint is 3F48 3A2A 9EB3 49A5 13B2 8761 471F D32E 15FD 8473

To claim this, I am signing this object:

package main
import (
"fmt"
"math/rand"
"strconv"
"github.com/go-redis/redis"
"github.com/kataras/iris"
@dsseng
dsseng / gist:99b0c95714d979c396c88d845835c823
Last active February 18, 2018 07:18
Axios for Vue.js (Select one of variants)
import axios from 'axios'
Vue.prototype.$http = axios
// or
Vue.prototype.$http = axios.create({ baseURL: '//path/to/your/api/root' })
@dsseng
dsseng / vue-lscache.js
Created February 3, 2018 15:06
vue.js plugin for lscache
const lscache = require('lscache')
// This is your plugin object. It can be exported to be used anywhere.
const MyPlugin = {
// The install method is all that needs to exist on the plugin object.
// It takes the global Vue object as well as user-defined options.
install (Vue, options) {
// We add $ls for lscache
Vue.prototype.$ls = {
get: lscache.get,