Skip to content

Instantly share code, notes, and snippets.

View milesich's full-sized avatar

Martin Milesich milesich

  • 17:42 (UTC +01:00)
View GitHub Profile
@milesich
milesich / gist:d81298122c56f265e10092a8f02b9fcc
Created March 1, 2023 10:03
accessing host machine ports from Kind pods
https://github.com/kubernetes-sigs/kind/issues/1200#issuecomment-1304855791
For those interested I think I came with a simpler solution to route network to the host machine, using headless or ExternalName services. The solution is different for Linux and Mac/Window (the latter using Docker desktop).
Linux solution: headless service + endpoint:
---
apiVersion: v1
kind: Endpoints
metadata:
@milesich
milesich / clear-apc.php
Last active April 13, 2018 09:33 — forked from stuartcarnie/clear-apc.php
Self-contained php script to clear shared-memory cache in php5-fpm via command-line. In this instance it is clearing APC, but can be easily changed to clear other shared-memory caches.
#!/usr/bin/env php
<?php
/*
Copyright 2013 Stuart Carnie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@milesich
milesich / quill-renderer.js
Last active July 5, 2017 22:42
runkit file
var jsdom = require("jsdom")
exports.endpoint = function(request, response) {
if (request.method == 'POST') {
var jsonString = '';
request.on('data', function (data) {
jsonString += data;
});
@milesich
milesich / data.txt
Created March 7, 2017 16:08
paste this into a chrome console
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+
@milesich
milesich / KMPolyline.js
Created August 15, 2013 11:34
Draw solid or dashed polylines on Google Maps.
/*!
* KMPolyline - Draw solid or dashed polylines.
*
* Extended Google's GPolyline class.
*
* Rewritten Bill Chadwick's BDCCPolyline.js script.
* http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm
*
* Non-solid polylines only if drawing is performed using VML or SVG.
*
@milesich
milesich / vincenty.php
Created August 15, 2013 11:27
Calculate geodesic distance (in meters) between two points specified by latitude/longitude using Vincenty inverse formula for ellipsoids.
<?php
/**
* Calculate geodesic distance (in meters) between two points specified by
* latitude/longitude using Vincenty inverse formula for ellipsoids
*
* from: Vincenty inverse formula - T Vincenty, "Direct and Inverse
* Solutions of Geodesics on the Ellipsoid with application of nested
* equations", Survey Review, vol XXII no 176, 1975
* http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
*