Skip to content

Instantly share code, notes, and snippets.

@jpswade
jpswade / point-in-polygon.php
Created November 5, 2019 10:01 — forked from vzool/point-in-polygon.php
The point-in-polygon algorithm allows you to check if a point is inside a polygon or outside of it.
<?php
/*
Description: The point-in-polygon algorithm allows you to check if a point is
inside a polygon or outside of it.
Author: Michaël Niessen (2009)
Website: http://AssemblySys.com
If you find this script useful, you can show your
appreciation by getting Michaël a cup of coffee ;)
PayPal: michael.niessen@assemblysys.com
@jpswade
jpswade / xphpunit
Last active February 23, 2016 13:15 — forked from rolfvreijdenberger/phpunit-xdebug
xphpunit (/usr/local/bin/xphpunit)
#!/bin/bash
#curl -O https://gist.githubusercontent.com/jpswade/d82392d62bd25b43c6ce/raw/59a7e9c990ba9979f0967de049aea23f76e2bb2d/xphpunit /usr/local/bin/phpunitx && chmod 755 /usr/local/bin/phpunitx
# a wrapper around phpunit with xdebug enabled for eclipse
# make sure the debug session is started in the debug client (eclipse, netbeans, choose one of the settings below)
# see component diagram on https://en.wikipedia.org/wiki/Xdebug
# export XDEBUG_CONFIG="idekey=ECLIPSE_DBGP"
export XDEBUG_CONFIG="idekey=netbeans-xdebug"
phpunit --colors $@
@jpswade
jpswade / mysql2sqlite.sh
Created July 27, 2012 09:34 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite