Skip to content

Instantly share code, notes, and snippets.

View jnehlmeier's full-sized avatar

Jens Nehlmeier jnehlmeier

View GitHub Profile
@BretFisher
BretFisher / docker-for-mac.md
Last active May 23, 2024 22:25
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@vladimirsiljkovic
vladimirsiljkovic / select.css
Last active November 26, 2022 09:59
Cross-browser (IE11+) <select> element styling without wrapper <div> https://jsbin.com/diqene/edit?html,css,output
select {
-webkit-appearance: none; /* Webkit */
-moz-appearance: none; /* FF */
-ms-appearance: none; /* Edge */
appearance: none; /* Future */
/* Optional styles */
padding: 0.3em 1.5em 0.3em 0.6em;
border: 1px solid currentColor;
background: white;
public class InterceptorDataSource implements InvocationHandler {
private final DataSource delegate;
private InterceptorDataSource(final DataSource delegate) {
this.delegate = delegate;
}
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return (method.getName().equals("getConnection")) ? getConnection() : method.invoke(delegate, args);
}
@midwire
midwire / reset_routing_table.sh
Last active May 16, 2024 10:29
[Reset routing table on OSX] #osx #devops #networking
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times
@rhmoller
rhmoller / build.gradle
Created October 20, 2014 21:32
Gradle example of fetching dependencies from GWT_TOOLS
repositories {
ivy {
url "https://google-web-toolkit.googlecode.com/svn/tools/lib"
layout "pattern", {
artifact "[artifact]-[revision].[ext]"
}
}
}
configurations {
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@mckamey
mckamey / bezier.js
Created September 25, 2012 16:35
JavaScript port of Webkit CSS cubic-bezier(p1x.p1y,p2x,p2y) and various approximations
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@tbroyer
tbroyer / Html5Historian.java
Created February 22, 2012 10:07
GWT PlaceHistoryHandler.Historian using HTML5 pushState and onpopstate
/*
* Copyright 2012 Thomas Broyer <t.broyer@ltgt.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software