Skip to content

Instantly share code, notes, and snippets.

@monkstone
monkstone / QuickHull3D.java
Created June 21, 2011 19:31
Updated quickhull 3D
/**
* Copyright John E. Lloyd, 2004. All rights reserved. Permission to use,
* copy, modify and redistribute is granted, provided that this copyright
* notice is retained and the author is given credit whenever appropriate.
*
* This software is distributed "as is", without any warranty, including
* any implied warranty of merchantability or fitness for a particular
* use. The author assumes no responsibility for, and shall not be liable
* for, any special, indirect, or consequential damages, or any damages
* whatsoever, arising out of or in connection with the use of this
@wangkuiyi
wangkuiyi / pre-commit-clang-format
Last active August 19, 2021 14:04
Git pre-commit hook that invokes clang-format to reformat C/C++/Objective-C source code.
#!/bin/bash
# git pre-commit hook that runs an clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
# modifications for clang-format by [email protected]
# This file is part of a set of unofficial pre-commit hooks available
# at github.
@frk1
frk1 / cf.py
Last active April 8, 2018 18:21
Use the cloudflare firewall to block ddos attacks
#!/usr/bin/env python3
# pip3 install --upgrade requests pycountry dnspython
import ipaddress
import requests
import pycountry
import dns.resolver
ALLOWED_COUNTRIES = ['DE', 'AT']
CF_CREDENTIALS = {'X-Auth-Email': 'YOUR_MAIL',