Skip to content

Instantly share code, notes, and snippets.

View nstickney's full-sized avatar

Stick nstickney

View GitHub Profile
@nstickney
nstickney / echo-in-console-instruction-count.md
Last active April 28, 2020 15:21 — forked from zloster/echo-in-console-instruction-count.md
How much work the poor CPU needs to do when we echo 4-characters string in the Linux console?

And the answer is:

310,261 instructions

--@--:~$ uname -a
Linux 5.6.7-arch1-1 #1 SMP PREEMPT Thu, 23 Apr 2020 09:13:56 +0000 x86_64 GNU/Linux
--@--:~$ sudo perf stat echo test
test
@nstickney
nstickney / Makefile
Last active January 5, 2020 16:36 — forked from kristopherjohnson/Makefile
Makefile that uses Pandoc to generate HTML, PDF, DOCX, etc. from Markdown source files
# Makefile
#
# Credits: https://gist.github.com/kristopherjohnson/7466917
#
# Converts Markdown to other formats using Pandoc (https://pandoc.org/)
#
# Convert a single Markdown file to a specific format:
# $ make <filename>.<format_suffix>
#
# Convert all Markdown files to a specific format:
@nstickney
nstickney / sway-alt-tab.py
Last active January 4, 2020 15:42 — forked from SidharthArya/alttab
Sway Windows Manager Alt Tab behavior
#!/usr/bin/env python
''' Switch between all available windows in Sway '''
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
__author__ = 'Stick'
__credits__ = ['https://gist.github.com/SidharthArya']
__email__ = 'stick@stma.is'