Skip to content

Instantly share code, notes, and snippets.

@letorbi
letorbi / require.js
Last active November 20, 2018 22:27
The first and now obsolete version of my Node.js' require function for browsers. Check https://github.com/letorbi/smoothie for a latest version.
// NEW VERSION AVAILABLE: Check out my GitHub repository at
// https://github.com/letorbi/smoothie for a new and improved version.
// Require() 0.3.4 unstable
//
// Copyright 2012,2013 Torben Haase <http://pixelsvsbytes.com/>
//
// Require() is free software: you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
@letorbi
letorbi / fontsmoothie.js
Last active January 15, 2022 17:39
This code enforces font-smothing for web fonts even if it's not enabled in the system settings. More info: http://pixelsvsbytes.com/blog/2013/02/nice-web-fonts-for-every-browser
// Font Smoothie copyright 2013,14,15 Torben Haase <http://pixelsvsbytes.com>
// Source-URL <https://gist.github.com/letorbi/5177771>
//
// Font Smoothie is free software: you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version.
//
// Font Smoothie is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
@letorbi
letorbi / dnsmasq.conf
Last active August 29, 2015 14:21
The configuration files used in the Pixels|Bytes "Building a BeagleBone router" tutorial: https://pixelsvsbytes.com
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
# The following two options make you a better netizen, since they
# tell dnsmasq to filter out queries which the public DNS cannot
# answer, and which load the servers (especially the root servers)
# unnecessarily. If you have a dial-on-demand link they also stop
@letorbi
letorbi / pdfsanitize.sh
Created December 14, 2021 22:48
A shell script that tries to remove exploits and malware from PDFs
#!/bin/bash
# References:
# https://security.stackexchange.com/questions/103323/effectiveness-of-flattening-a-pdf-to-remove-malware
# https://superuser.com/a/373740
TEMPFILE=$(mktemp /tmp/pdfsanitize.XXXXXXXXX)
OUTFILE=${1/.PDF/.pdf}