Skip to content

Instantly share code, notes, and snippets.

@itzmeanjan
itzmeanjan / google-benchmark-with-libpfm.md
Last active May 6, 2024 02:28
Using Performance Monitoring Unit(s), when benchmarking with google-benchmark.

Background

I'm demonstrating following on a machine, running Ubuntu 22.04 with GNU/Linux kernel 5.19.0.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
@obfusk
obfusk / bdiff.sh
Last active May 6, 2024 02:28
diff + bat
#!/bin/bash
diff -Naur "$@" | bat -p -l diff
@phineas-pta
phineas-pta / xoa_dau.md
Last active May 6, 2024 02:22
xoá dấu tiếng Việt với Python

xoá dấu tiếng Việt với Python

phương pháp nhanh hơn và không cần cài thêm package

code hoàn chỉnh:

import unicodedata

BANG_XOA_DAU = str.maketrans(
@druska
druska / engine.c
Created September 17, 2018 15:18
Quant Cup 1's winning order book implementation
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@ttimasdf
ttimasdf / 00-Systemd_service_for_autossh.md
Last active May 6, 2024 02:21 — forked from thomasfr/autossh.service
Systemd service for autossh

Usage

curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@host1 | \
  sudo tee /etc/default/autossh@example
curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@.service | \
  sudo tee /etc/systemd/system/autossh@.service

sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh # and copy your private key here
@mkody
mkody / README.md
Last active May 6, 2024 02:20
Custom CSS for FreshRSS (using Swage as a base)

This is a dark color scheme for the Swage theme in FreshRSS. To use it, copy/paste the content of custom.css in the settings of the Custom CSS extension.


To go further, I've edited manifest.json and layout.phtml so that the colors for the window and PWA matches.

You can replace those files or if you use docker (compose) you can mount them.
For example this is the volumes settings in my docker-compose.yaml:

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 6, 2024 02:17
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@afeld
afeld / civictech.md
Last active May 6, 2024 02:12
civic tech jobs in NYC (or remote)
@eliben
eliben / gist:5797351
Created June 17, 2013 14:36
Generic regex-based lexer in Python
#-------------------------------------------------------------------------------
# lexer.py
#
# A generic regex-based Lexer/tokenizer tool.
# See the if __main__ section in the bottom for an example.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
# Last modified: August 2010
#-------------------------------------------------------------------------------