Skip to content

Instantly share code, notes, and snippets.

View srghma's full-sized avatar

Serhii Khoma srghma.github.io/how-life-was-created srghma

View GitHub Profile
@Gabriella439
Gabriella439 / trans.md
Last active November 28, 2023 06:30
I'm trans

I'm writing this post to publicly come out as trans (specifically: I wish to transition to become a woman).

This post won't be as polished or edited as my usual posts, because that's kind of the point: I'm tired of having to edit myself to make myself acceptable to others.

I'm a bit scared to let people know that I'm trans, especially because I'm not yet in a position where I can transition (for reasons I don't want to share, at least not in public) and it's really shameful. However, I'm getting really

@zoellner
zoellner / utf16test.js
Created May 28, 2020 20:37
write utf-16 encoded files in node.js (both utf16be and utf16le)
const fs = require('fs');
// our demo string is in 'default' utf8 with emoji character assuming you are using an editor that supports those.
// if not, you can test this gist by setting utf8string to the equivalent '->\ud83d\ude03\ud83e\uddd2\ud83c\udffc\u00fc\u010d\u0113<-'
// gist doesn't support all ZWJ sequences, so can't show this here but it works with those as well, e.g. '\ud83d\udc68\ud83c\udffc\u200d\ud83d\udcbb'
const utf8string = '->😃🧒🏼üčē<-';
// this is what you'd usually do to write to a utf-8 encoded file
fs.writeFileSync('test-utf8.txt', utf8string);
" turn all symbols into unicode or back
autocmd FileType purescript map <buffer> <silent> <leader>hu :%s/ => / ⇒ /ge<CR>:%s/ -> / → /ge<CR>:%s/ <- / ← /ge<CR>:%s/ :: / ∷ /ge<CR>:%s/ <= / ⇐ /ge<CR>:%s/ forall / ∀ /ge<CR>
autocmd FileType purescript map <buffer> <silent> <leader>hU :%s/⇒/=>/ge<CR>:%s/→/->/ge<CR>:%s/←/<-/ge<CR>:%s/∷/::/ge<CR>:%s/⇐/<=/ge<CR>:%s/∀/forall/ge<CR>
" convert symbols while typing
autocmd FileType purescript iab forall ∀
autocmd FileType purescript iab -> →
autocmd FileType purescript iab <- ←
@Icelandjack
Icelandjack / Yoneda.markdown
Last active February 10, 2023 00:06
Yoneda
import Data.Functor.Yoneda
import Data.Char
import Data.Kind

infixr 5
  ·

type  List :: (Type -> Type) -> Constraint
class List f where
@michaellihs
michaellihs / gitlab_access_token.md
Last active March 18, 2024 05:09
Create Gitlab Personal Access Token using curl

Create Gitlab Personal Access Token using curl

Prerequisites

  • You need a Gitlab server up and running
  • You need user credentials for a (admin) user on the Gitlab server
  • You need curl and Perl on your server
@0sc
0sc / aws-go+docker-setup.sh
Last active September 10, 2019 12:15
Setup script for golang, docker and docker-compose on Amazon Linux AMI 2017.09.0 (HVM) on EC2
#!bin/sh
# Update installed packages and package cache
sudo yum update -y
# make sure in the home folder
cd ~/
# Golang installation

I have been an aggressive Kubernetes evangelist over the last few years. It has been the hammer with which I have approached almost all my deployments, and the one tool I have mentioned (shoved down clients throats) in almost all my foremost communications with clients, and it was my go to choice when I was mocking my first startup (saharacluster.com).

A few weeks ago Docker 1.13 was released and I was tasked with replicating a client's Kubernetes deployment on Swarm, more specifically testing running compose on Swarm.

And it was a dream!

All our apps were already dockerised and all I had to do was make a few modificatons to an existing compose file that I had used for testing before prior said deployment on Kubernetes.

And, with the ease with which I was able to expose our endpoints, manage volumes, handle networking, deploy and tear down the setup. I in all honesty see no reason to not use Swarm. No mission-critical feature, or incredibly convenient really nice to have feature in Kubernetes that I'm go

@adamwespiser
adamwespiser / free-mtl-notes
Last active February 4, 2018 21:54
A comparison of performance between Free Monad and mtl transformers
Objective: A comparison of performance between Free Monad and mtl transformers
```Haskell
Free f a = { unFree :: f (Free f a) }
```
http://softwareengineering.stackexchange.com/questions/242795/what-is-the-free-monad-interpreter-pattern
# construction of free monad via individual functions
http://www.atamo.com/articles/free-monads-wont-detox-your-colon/
@srghma
srghma / MindTrash.md
Last active October 10, 2022 09:54
MindTrash

How to debug sublime plugins:

  • install rpdb through pip
  • import rpdb; rpdb.set_trace()
  • telnet 127.0.0.1 4444

Разница между CSRF (Cross-Site Request Forgery) и XSS (Cross-Site Scripting)

Оба - атака на пользователя, в отличие от SQL Injection (атака на сервер)

XSS:
  • цель - заставить браузер жертв(ы) исполнить код
// ==UserScript==
// @name VK.com Kill news feed
// @namespace Cooluck
// @author Roman Rybalchenko
// @description Hide all posts from vk.com feed. Скрывает в ленте VK посты.
// @include https://vk.com/feed*
// @include https://vkontakte.ru/feed*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @version 0.16
// ==/UserScript==