Skip to content

Instantly share code, notes, and snippets.

@seasonny
seasonny / gist:6a405a709a4732a1419382db07a275d5
Last active September 25, 2019 15:59
create simple app for dns logger
oc new-project dns-checker
oc new-app nginx:1.12~https://github.com/sclorg/nginx-container.git --context-dir=1.12/
oc expose svc/nginx-container
cat <<EOF | oc apply -f -
apiVersion: v1
kind: Pod
metadata:
name: dns-checker
var extend_keyboard_event_with_keycode = function(original_event_name) {
var $fn_original = $.fn[original_event_name];
var keyboard_event_function_wrapper = function(keycodes, handler) {
return function(e) {
if(keycodes.indexOf(e.which) != -1)
return handler(e);
}
}
@seasonny
seasonny / dabblet.css
Created March 15, 2013 05:56
CSS image crop. Forces image to 4:3 aspect ratio cropping at the middle.
/**
* CSS image crop. Forces image to 4:3 aspect ratio cropping at the middle.
* http://dabblet.com/gist/4711695
*/
.img-crop,
.img-crop img{
width: 100%; /* gotta be responsive these days */
}
.img-crop{
background-color: #ededed; /* some background color for short images */