Skip to content

Instantly share code, notes, and snippets.

@dchaplinsky
dchaplinsky / inflector.py
Last active May 7, 2023 19:06
A script for the pymorhpy3/pymorphy3-dicts-uk to generate inflections of ngrams
# pip install pymorphy3
# pip install pymorphy3-dicts-uk
import pymorphy3
from collections import defaultdict
from itertools import product
from typing import List, List
morph = pymorphy3.MorphAnalyzer(lang="uk")
@Zibri
Zibri / KMS_office.cmd
Created January 18, 2020 15:59 — forked from CHEF-KOCH/KMS_office.cmd
KMS server Windows
@echo off
title Microsoft Office 2019 versions are supported!&cls&echo
============================================================================&echo
#Project: Activating Microsoft software products for FREE without software&echo
============================================================================&echo.&echo
#Supported products:&echo - Microsoft Office Standard 2019&echo - Microsoft Office Professional Plus 2019&echo.&echo.&(if exist
"%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist
"%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b
..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b
..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo
@IanColdwater
IanColdwater / twittermute.txt
Last active May 23, 2024 18:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@Mordo95
Mordo95 / TcpProxy.cs
Created February 7, 2018 15:10
Asynchronous TCP proxy in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace HolePunchTest
{
public class TcpProxy
@voidlizard
voidlizard / special-olympics-resume.md
Last active November 6, 2017 03:37
Специальная олимпиада имени memcpy: послесловие

Надеюсь, что теперь эта специальная олимпиада затихнет, потому что код-победитель только на ~20% уступает простой записи нулей в /dev/null.

При ближайшем рассмотрении, задача оказалась на скорость вывода в stdout, т.е. так как вход у неё довольно маленький (~10K элементов), то парсить практически всё равно как -- на любом языке из использовавшихся.

После понимания этого, задача сводится к эффективной буферизации вывода и размышлениям, почему же нигде не работает стандартная буферизация --- по идее, она должна делать именно

@esquireofoz
esquireofoz / cloudfront_pop_locations.psv
Created September 29, 2016 12:41
AWS CloudFront POPs by City and Region
AMS1 | Amsterdam, The Netherlands | Europe
AMS50 | Amsterdam, The Netherlands | Europe
ARN1 | Stockholm, Sweden | Europe
ATL50 | Atlanta, Georgia | United States
ATL52 | Atlanta, Georgia | United States
BOM2 | Mumbai, India | India
BOM51 | Mumbai, India | India
CDG3 | Paris, France | Europe
CDG50 | Paris, France | Europe
DEL51 | Paris, France | Europe
@keithchambers
keithchambers / gist:80b60559ad83cebf1672
Last active October 21, 2021 01:12
Ansible role to set 'noop' i/o scheduler (CentOS 7)
---
- name: test if grub configured for noop i/o scheduler
command: egrep -q 'elevator=noop' /boot/grub2/grub.cfg
register: grub
changed_when: no
failed_when: grub_test.rc == 2
- name: configure grub for noop i/o scheduler
sudo: yes
command: grubby --update-kernel=ALL --args=elevator=noop
@jboner
jboner / latency.txt
Last active June 30, 2024 14:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD