Skip to content

Instantly share code, notes, and snippets.

View ggdx's full-sized avatar

Daniel White ggdx

View GitHub Profile
@ggdx
ggdx / site_block.py
Created March 28, 2021 11:08
Adds a huge list of domains to block to /etc/hosts
import os
""" site_block.txt - https://gist.github.com/ggdx/e333c291312c90a6c5f35d5b06fd9632
This script takes a while, could most likely be made more efficient but
does the job in prevent my kids from accessing things they shouldn't
as well as largely stops tracking scripts embedded in websites.
"""
path = './site_block.txt'
@ggdx
ggdx / site_block.txt
Last active June 21, 2023 20:27
Massive list of domains to block
0--e.info
0-24bpautomentes.hu
0-800-email.com
0-day.us
0-secure-paypal.com
00-gov.cn
000-hidro-1.info
000359.xyz
000free.us
000invaliddomain.local
@ggdx
ggdx / values_pointers.go
Created October 6, 2019 11:11 — forked from josephspurrier/values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@ggdx
ggdx / dummy_contact_form.php
Last active March 6, 2019 14:12
Basic contact form with DB
<?php
$errors = [];
$success = false;
if ($_POST) {
// Set required fields
$requires = ['email', 'name', 'message'];
foreach($requires as $field) {
if (!isset($_POST[$field])) {
@ggdx
ggdx / .gitignore
Created July 22, 2017 20:59
Wordpress Gitignore
/node_modules
/wp-admin
/wp-content/uploads
/wp-content/upgrade
/wp-includes
index.php
license.txt
readme.html
wp-activate.php
wp-blog-header.php
@ggdx
ggdx / CustomPostType.php
Last active March 26, 2024 21:18
Makes creating custom post types more OOP in WordPress.
<?php
class PostType
{
private $post_type = false;
private $name = false;
private $singular_name = false;
private $add_new = false;
private $add_new_item = false;
private $edit_item = false;
@ggdx
ggdx / newdev.sh
Last active April 1, 2017 17:17
Bash script to scaffold new dev projects.
#!/bin/bash
echo -e " \n"
echo -e "--------------------------"
echo -e "- Create a new project -"
echo -e "--------------------------"
echo -e " \n"
echo -n "Who is the client? "
read client
if [ ! -d "/srv/http/$client" ]; then