Skip to content

Instantly share code, notes, and snippets.

View gvlx's full-sized avatar

Gerardo Lisboa gvlx

View GitHub Profile
@gvlx
gvlx / SET-LOCAL_LAN_ACCESS.cmd
Created June 29, 2018 08:53
sets a route to the local network (to be used after starting a VPN)
@echo off
::
:: SET-LOCAL_LAN_ACCESS.cmd [-n|--dry-run][-d|--debug]
::
:: sets a route to the local network (to be used after starting a VPN)
:: NEEDS ELEVATION
::
:: where
:: [-n|--dry-run] don't actually set the route
:: [-d|--debug] print debug information
@gvlx
gvlx / get_dns_blacklists.sh
Created October 18, 2017 09:09 — forked from tvlooy/get_dns_blacklists.sh
Block ads by DNS
#!/bin/sh
# "include: /etc/unbound/ad-blacklist.conf" in /var/unbound/etc/unbound.conf
# run this script as a daily cron
#
# The list URLs were taken from the pi-hole project.
# More experimental lists are at https://github.com/pi-hole/pi-hole/blob/master/adlists.default
TMPFILE=$( mktemp get_dns_blacklists-XXXXXXXXX )
trap 'rm -f $TMPFILE; exit 1' EXIT KILL INT QUIT TERM
@gvlx
gvlx / unit.sh
Last active October 5, 2018 05:47 — forked from tvlooy/unit.sh
Bash test: get the directory of a script
#!/bin/bash
# Following stackoverflow discussion, from https://gist.github.com/tvlooy/cbfbdb111a4ebad8b93e (rev7)
function test(){
local __MESSAGE__="$1"
local __RECEIVED__="$2"
local __EXPECTED__="$3"
if [ "${__RECEIVED__}" == "${__EXPECTED__}" ]; then
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>interactive xpath tester</title>
<!-- From http://ponderer.org/download/xpath/ by ([email protected]) on 2017-03-28 -->
<!-- license unknown -->
<style>
body {
background-color: #eee;
}
#in {
@gvlx
gvlx / Email accessibility compliance.txt
Created September 21, 2016 08:25
Email accessibility compliance
Email accessibility compliance
http://www.interactiveaccessibility.com/services/wcag-20-compliance
http://www.headstar.com/ten/
http://www.email-standards.org/
@gvlx
gvlx / L10n - Localization resources.txt
Created September 21, 2016 08:13
L10n - Localization resources
L10n - Localization resources
ICU - International Components for Unicode
http://site.icu-project.org/
CLDR - Unicode Common Locale Data Repository
http://cldr.unicode.org/
http://l10ns.org/
https://www.youtube.com/watch?v=4ZXagCR9urg
@gvlx
gvlx / notepadpp_helper_remove_duplicate_lines.txt
Created September 2, 2016 12:27
Notepad++ Helper: remove duplicate lines
http://stackoverflow.com/a/16293580/43408
https://stackoverflow.com/questions/3958350/removing-duplicate-rows-in-notepad
Since Notepad++ Version 6 you can use this regex in the search and replace dialogue:
^(.*?)$\s+?^(?=.*^\1$)
and replace with *nothing*. This leaves from all duplicate rows the last occurrence in the file.
- ^ - matches the start of the line.
@gvlx
gvlx / gist:7ad780f369474b0bff230705a7669546
Created June 10, 2016 09:33
Error handling vs Exceptions
http://dave.cheney.net/2012/01/18/why-go-gets-exceptions-right
@gvlx
gvlx / Text vs Diagrams.txt
Created June 10, 2016 08:07
Text vs Diagrams
https://blog.abstratt.com/2008/05/05/on-code-and-diagrams/
https://web.archive.org/web/20120127085644/http://blog.objectmentor.com/articles/2007/09/06/why-we-write-code-and-dont-just-draw-diagrams
https://web.archive.org/web/20101118004330/http://www.rgoarchitects.com/nblog/2007/08/28/AD2007BuildingDSLsInStaticAndDynamicLanguagesNealFord.aspx
@gvlx
gvlx / TM_makeImage.sh
Created October 20, 2013 11:06
A bash script to create a time machine disk image suitable for backups with OS X 10.6 (Snow Leopard)
#!/bin/bash
# A bash script to create a time machine disk image suitable for
# backups with OS X 10.6 (Snow Leopard)
# This script probably only works for me, so try it at your own peril!
# Use, distribute, and modify as you see fit but leave this header intact.
# (R) sunkid - September 5, 2009
#
# retrived from http://www.insanelymac.com/forum/topic/184462-guide-106-snow-leopard-time-machine-backup-to-network-share/
# http://www.insanelymac.com/forum/index.php?app=core&module=attach&section=attach&attach_id=55807