Skip to content

Instantly share code, notes, and snippets.

@gwarser
gwarser / strip_emoji.py
Created April 23, 2023 06:49 — forked from Alex-Just/strip_emoji.py
Python regex to strip emoji from a string
import re
# http://stackoverflow.com/a/13752628/6762004
RE_EMOJI = re.compile('[\U00010000-\U0010ffff]', flags=re.UNICODE)
def strip_emoji(text):
return RE_EMOJI.sub(r'', text)
print(strip_emoji('🙄🤔'))
@gwarser
gwarser / swapstat.sh
Last active August 30, 2021 12:07 — forked from chriseckhardt/swap-cop.sh
Simple script that displays processes' vm swap usage
#!/bin/bash
# Get current swap usage for all running processes
# NOTE: MUST BE RUN AS ROOT (checks /proc/)
# Erik Ljungstrom 27/05/2011
# Modified by Mikko Rantalainen 2012-08-09
# Modified by Brandon Johnson 2013-07-30
# Pipe the output to "sort -nk3" to get sorted output
# set PID to echo full command path, mysql procs only showed "mysql", which was useless on services with multiple daemons running.
# Also added MB/GB feature for the purposes of using this tool with grep -e "MB" -e "GB"
@gwarser
gwarser / README.md
Last active November 11, 2020 01:59 — forked from indygreg/find_old_lines.pl
Find oldest lines in git repository

I put it in root repo dir and run from filters/ directory, by executing:

../find-oldest-line.sh | ../find-old-lines.pl > ../oldest-lines.txt
-- autosave.lua
--
-- Periodically saves "watch later" data during playback, rather than only saving on quit.
-- This lets you easily recover your position in the case of an ungraceful shutdown of mpv (crash, power failure, etc.).
--
-- You can configure the save period by creating a "lua-settings" directory inside your mpv configuration directory.
-- Inside the "lua-settings" directory, create a file named "autosave.conf".
-- The save period can be set like so:
--
-- save_period=60

Answer to comments on uBlock Origin thread: https://github.com/gorhill/uBlock/commit/5733439f629da948cfc3cae74afa519f6cff7b7f as it seems I do not have permission to comment.

Hi,

First of all I'd like to personnaly thank you for all the work you do on uBlock Origin and other extensions, the source code of which have been an inspiration to me personally many times in the past.

I am also really excited that there are multiple people pushing for more accurate measurements of the efficiency of content-blockers and I think sharing methodologies, data and results is a great start!

It is interesting that the results you obtained diverge from the study published yesterday. If I understand correctly you got similar timings for uBlock Origin itself, but the numbers for Adblock Plus do not seem to match (45µs instead of ~19µs). I'd really like to understand where this difference could come from.