Skip to content

Instantly share code, notes, and snippets.

@roktas
roktas / square.html
Created January 30, 2024 09:20
Test Square 10cm x 10cm
<!DOCTYPE html>
<html>
<head>
<style>
#square {
width: 10cm;
height: 10cm;
border: solid 1px;
margin: 0cm;
padding: 0cm;
@roktas
roktas / gist:4f10793e8a3772b5a10e2cc7e9005528
Created October 17, 2023 12:02 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
#!/usr/bin/env bash
# Process spool of scanned images
# Copyright (c) 2020, Recai Oktaş
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@roktas
roktas / vit
Created October 14, 2023 22:50
#!/usr/bin/env bash
# Copyright (c) 2020, Recai Oktaş
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#!/usr/bin/env bash
set -Eeuo pipefail; shopt -s nullglob; [[ -z ${TRACE:-} ]] || set -x; unset CDPATH; IFS=$' \t\n'
cd "$(dirname "$(readlink -f "$0")")"/../.. || exit
# shellcheck disable=2034
declare -gr PROGNAME=${0##*/} # Program name
cry() {
dpkg-divert --add --rename --divert /usr/share/X11/xkb/symbols/pc.orig /usr/share/X11/xkb/symbols/pc
patch <<-EOF
--- pc.orig 2020-07-09 15:13:44.428924012 +0300
+++ pc 2020-07-09 15:50:21.658899698 +0300
@@ -19,7 +19,7 @@
key <TAB> { [ Tab, ISO_Left_Tab ] };
key <RTRN> { [ Return ] };
- key <CAPS> { [ Caps_Lock ] };
+ key <CAPS> { [ backslash ] };
local wezterm = require("wezterm")
------------------------------------------------------------------------------------------------------------------------
-- Constants and helpers
------------------------------------------------------------------------------------------------------------------------
local FONT_FAMILY = wezterm.font("Spleen 32x64")
local FONT_SIZE = 16
local CHAR_SOLID_LEFT = wezterm.nerdfonts.pl_right_hard_divider
local COLOR_BACKGROUND = "#2e3440"
# SPDX-License-Identifier: GPL-2.0
#
# clang-format configuration file. Intended for clang-format >= 4.
#
# For more information, see:
#
# Documentation/process/clang-format.rst
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
function mc --wraps=mc
set -l f (mktemp)
if set -q f[1]
env SHELL=/bin/bash mc -P "$f" $argv
if test -r "$f"
set -l d (cat "$f")
if test -n "$d"; and test -d "$d"; and test "$d" != "$PWD"
builtin cd "$d"
require 'victor'
svg = Victor::SVG.new width: 140, height: 100, style: { background: '#ddd' }
svg.build do
rect x: 10, y: 10, width: 120, height: 80, rx: 10, fill: '#666'
circle cx: 50, cy: 50, r: 30, fill: 'yellow'
circle cx: 58, cy: 32, r: 4, fill: 'black'
polygon points: %w[45,50 80,30 80,70], fill: '#666'