Skip to content

Instantly share code, notes, and snippets.

View nazares's full-sized avatar
👨‍💻
Coding

Sergei Nazarenko nazares

👨‍💻
Coding
View GitHub Profile
@nazares
nazares / mkfavicon.sh
Created June 5, 2024 09:12
make favicon in a right way
#!/usr/bin/env bash
svgFile=$1
extension=${svgFile##*.}
OUT_DIR="./favicons"
TEMP_DIR='/tmp'
@nazares
nazares / keybase.md
Created February 24, 2024 21:56
keybase.md

Keybase proof

I hereby claim:

  • I am nazares on github.
  • I am nazares (https://keybase.io/nazares) on keybase.
  • I have a public key ASA4-Wyp_UUkVEda1Z9VWjv-ApkA6hyE722KN4IkbrNqCQo

To claim this, I am signing this object:

@nazares
nazares / README.md
Created October 30, 2023 14:48
readme for deb-sphp

Debian-based distributives PHP Switcher

Debian PHP switcher is a simple script to switch your Apache and CLI configs quickly between major versions of PHP. This supports any version of php installed onto the Debian-based system.

If you support multiple products/projects that are built using either brand new or old legacy PHP functionality and you find it a pain to change config files continually this will make the whole process just one command.

Caveats

@nazares
nazares / autoload.php
Created February 14, 2023 04:58
php psr-4 autoloader
<?php
declare(strict_types=1);
$configuration = json_decode(file_get_contents(__DIR__ . '/../project.json'), true);
$namespaces = $configuration['autoload']['psr-4'];
function fqcnToPath(string $fqcn, string $prefix)
{
$relativeClass = ltrim($fqcn, $prefix);
@nazares
nazares / pygments-native.css
Last active October 25, 2020 19:43
Native theme for pygments
/*! Native theme; http://blog.favrik.com/2011/02/22/preview-all-pygments-styles-for-your-code-highlighting-needs/#stylesheetNavigator */
.highlight, .highlight pre, .highlight table { background: #202020 !important; color: #d0d0d0 !important; }
.highlight .hll { background-color: #404040 !important; }
.highlight .c { color: #999999 !important; } /* Comment */
.highlight .err { color: #a61717 !important; background-color: #e3d2d2 !important; } /* Error */
.highlight .g { color: #d0d0d0 !important; } /* Generic */
.highlight .k { color: #6ab825 !important; } /* Keyword */
.highlight .l { color: #d0d0d0 !important; } /* Literal */
.highlight .n, .highlight .h { color: #d0d0d0 !important; } /* Name */
.highlight .o { color: #d0d0d0 !important; } /* Operator */
@nazares
nazares / 32.asm
Last active April 3, 2017 15:48
Hello World assembly macOS x86_64
; nasm -f macho 32.asm
; ld -macosx_version_min 10.12 -o 32 32.o -lSystem
; ./32
global _main
section .text
_main:
push dword msg.len
push dword msg
push dword 1