Skip to content

Instantly share code, notes, and snippets.

View erthalion's full-sized avatar

Dmitrii Dolgov erthalion

View GitHub Profile
#!/usr/bin/env bash
FILE=$1
cat $FILE | jq -c 'paths' | fzf --preview "cat $FILE | jq getpath\({}\) | bat -l json --color=always --style=grid"
\set aid random_zipfian(1, 100000 * :scale, 1.07)
\set bid random_zipfian(1, 1 * :scale, 1.07)
\set tid random_zipfian(1, 10 * :scale, 1.07)
\set delta random(-5000, 5000)
BEGIN;
UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
@erthalion
erthalion / numa-maps-summary.pl
Created April 2, 2018 14:47 — forked from sitano/numa-maps-summary.pl
Show numa maps distribution
#!/usr/bin/perl
# Copyright (c) 2010, Jeremy Cole <jeremy@jcole.us>
# Modified (c) 2014, Ivan Prisyazhniy <john.koepi@gmail.com>
# - top [num] - mode to print numa map distribution from mem top
# This program is free software; you can redistribute it and/or modify it
# under the terms of either: the GNU General Public License as published
# by the Free Software Foundation; or the Artistic License.
#
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import glob
import json
from matplotlib import rc, rcParams
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=True)
rcParams['text.latex.preamble'] = [r"\usepackage{amsmath}"]

https://tonsky.livejournal.com/314598.html

Мнение такое, что он, крутой для своего времени, сегодня просто морально устарел.

Варианта два. Если мы говорим о датах, то Vim начинает историю с 1991. В тот же год появился Python. Оба активно развиваются до сих пор. Врядли кто-то из них устарел. Если же мы говорим о том, что концепция устарела - это ваше персональное мнение.

Для начала давайте оспорим тезис, что набор текста — редкая операция. По моим оценкам, набор и трансформации делятся скорее как 50%/50%

#!/usr/bin/env runhaskell
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import Data.Text (unpack)
import Data.Text.IO as T
import Turtle
dbImage = "postgres:9.6"
usb_modeswitch -v 12d1 -V 12d1 -p 1f01 -P 14db -M "55534243123456780000000000000011062000000101000100000000000000"
ifconfig eth0 down
ifconfig wlan0 down
ifconfig eth1 up
dhcpcd
long double TImmersedBoundaryProblem::Coord(T3dNormalGrid *grid, const int index, const int type, const int data_axis)
{
long double step;
if (type == COORD_X) {
step = grid->GetSeparator1().Separation[0];
}
else if (type == COORD_Y) {
step = grid->GetSeparator2().Separation[0];
}
else if (type == COORD_Z) {

Зависимости для cборки

  • cnpy (+ не забыть про zlib, если сборка под win)
  • компилятор с поддержкой c++11
  • система сборки (в проекте уже есть настройки для cmake, для VS тоже есть, но требует небольших исправлений)
  • deps/property/property.h (уже есть в проекте, для систем сборки, отличных от cmake нужно незабыть его добавить в include dirs)

Визуализация

long double TImmersedBoundaryProblem::Coord(T3dNormalGrid *grid, const int index, const int type, const int data_axis)
{
long double step;
if (type == COORD_X) {
step = grid->GetSeparator1().Separation[0];
}
else if (type == COORD_Y) {
step = grid->GetSeparator2().Separation[0];
}
else if (type == COORD_Z) {