Skip to content

Instantly share code, notes, and snippets.

@01100001
01100001 / falsehoods-programming-time-list.md
Created December 3, 2021 12:44 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@01100001
01100001 / unbound.conf
Created September 28, 2021 15:27 — forked from Overbryd/unbound.conf
A pretty good unbound.conf, DNSSEC, caching and local forwarding
remote-control:
control-enable: yes
server:
do-ip6: no
do-ip4: yes
do-udp: yes
tls-cert-bundle: /etc/ssl/certs/ca-certificates.crt
num-threads: 4
# Enable logs
verbosity: 1
@01100001
01100001 / functions.php
Created July 24, 2020 14:53 — forked from remcotolsma/functions.php
Custom WordPress the_terms() function to sort the post terms by "Category Order and Taxonomy Terms Order".
<?php
/**
* The terms
*/
function prefix_the_terms( $post_id, $taxonomy ) {
$term_ids = wp_get_post_terms( $post_id, $taxonomy, array(
'fields' => 'ids',
) );
@01100001
01100001 / ImageMagick Fake Scanned Document.sh
Last active July 18, 2022 11:26 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf

Linux distros: Ubuntu Server → Debian. (CentOS for educational purposes only.) Maybe Arch (or Gentoo) in the future.

Basic Path: Linux, Command-line & Shell scripting, Python programming, Security, Networking (Cisco, HP, Juniper), Virtualization, and High Availability. See IT Certification Roadmap.pdf for more info.

Programming Path: JS, Python, PHP, Ruby, C, C++, Go, Java, Swift, Rust, Scala, C#.

Certifications:

SysAdmin

Why read books when you can learn things the hard way? Because good books are written by people with experience, people who learnt from their mistakes. No point in comitting the same mistakes and learning from them, when you can read a book and do better. Be better informed so that you make mistakes that very few have yet to come across.

HTML, CSS & JavaScript

Learn

Starting with the best introductory books to HTML, CSS & JS by Jon Duckett, just so that I am not caught unaware by any unexpected JS in the other books. Then moving on to the high quality publishers of content on Web Design, because as a beginner I should be learning from the best. Then everything else, keeping in mind that even if I learn just one thing that's extremely useful or thoughtful from an entire book, that's still great.

  1. HTML and CSS: Design and Build Websites by Jon Duckett (Official Site)
  2. JavaScript and JQuery: Interactive Front-End Web Development by Jon Duckett ([Official Site]

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@01100001
01100001 / git-extract-file.markdown
Created November 19, 2016 10:53 — forked from ssp/git-extract-file.markdown
Extract a single file from a git repository

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch