Skip to content

Instantly share code, notes, and snippets.

View ramondeklein's full-sized avatar

Ramon de Klein ramondeklein

View GitHub Profile
(function($){
var hasTouch = /android|iphone|ipad/i.test(navigator.userAgent.toLowerCase()),
eventName = hasTouch ? 'touchend' : 'click';
/**
* Bind an event handler to the "double tap" JavaScript event.
* @param {function} doubleTapHandler
* @param {number} [delay=300]
*/
@ramondeklein
ramondeklein / Redirector.ps1
Created November 29, 2014 10:12
Powershell HTTP(S) redirector
# This Powershell script can be used on a server to redirect HTTP/HTTPS
# traffic to different sources. Make sure your DNS routes the requests
# for the source URLs to this server. It automatically forwards the URL
# to the destination server without altering the rest of the URL.
#
# You can use multiple mappings. Of course the 'source' should be
# unique, but the destination can occur multiple times.
#
# Make sure PowerShell is allowed to run this script. You might need to
# change PowerShell's policy by running the following command as admin:
using System;
using StructureMap;
namespace ConsoleApplication5
{
static class Program
{
public interface ISayHello
{
void SayHello();
@ramondeklein
ramondeklein / CreateCaCert.ps1
Last active August 25, 2022 17:18
Script to generate ca-cert.crt file based on the Windows Certificate store
# This script can be used to generate a ca-cert.crt file that can be used by
# Unix-based utilities like curl, git, ...
#
# It allows you to synchronize the root certificates (CA) based on the
# certificates installed in your Windows certification stores. You can also
# get a list from Mozilla, but I think it's convenient to have the same CA
# certificates in all tools.
#
# Some examples on how to use this script:
#
@ramondeklein
ramondeklein / Layout.html
Created June 4, 2018 11:06
Layout issue for Chrome 67 (Android)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
@ramondeklein
ramondeklein / rename-aws-glue-table.py
Created March 2, 2021 18:49
Rename table in AWS glue (including partition scheme)
# This GIST can be used to rename a table in AWS Glue and keep the
# partitioning scheme intact.
import boto3
region = "eu-west-1"
database_name = "rdk-test"
table_name = "yt_uncompressed"
new_table_name = "nyc_taxiset"
client = boto3.client("glue", region_name=region)
@ramondeklein
ramondeklein / azure-update-ddns.dockerfile
Created March 12, 2024 20:08
Update Azure DNS based on current external IP (dyndns)
FROM mcr.microsoft.com/azure-cli:latest
COPY azure-update-ddns.sh /usr/local/bin
RUN chmod 755 /usr/local/bin/azure-update-ddns.sh
CMD ["/usr/local/bin/azure-update-ddns.sh"]