Skip to content

Instantly share code, notes, and snippets.

@MogulChris
MogulChris / resize.bash
Created October 19, 2020 22:40
Recursively resize images in a directory tree with imagemagick / mogrify
#1. find files matching a pattern
#2. use mogrify to resize them.
# -quality 94 = jpeg quality.
# -verbose so you can tell where it's at in the directory tree
# -resize 2000x\> = resize to a maximum of 2000px wide, automatic height (2000x). Only resize larger images, no upscaling (>). Because > is a special character it is escaped with \
# Aspect ratio is automatically maintained.
#3. write new image in place
#TEST THIS THOROUGHLY AND KEEP A BACKUP OF YOUR ORIGINAL DIRECTORY TREE
anonymous
anonymous / my.css
Created October 27, 2017 19:30
CSS Gradient Animation
background: linear-gradient(270deg, #fb966e, #eaf0ce, #b3c9b0, #f3d45c, #bec8d9, #eb7a77, #ffadbc, #d9d0e0, #8b9cd2, #f7f2af, #97c9c6, #ffcfa8);
background-size: 2400% 2400%;
-webkit-animation: AnimationName 59s ease infinite;
-moz-animation: AnimationName 59s ease infinite;
-o-animation: AnimationName 59s ease infinite;
animation: AnimationName 59s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
@mediaupstream
mediaupstream / make_certs.sh
Last active July 15, 2024 07:57
extract ca-certs, key, and crt from a pfx file
#!/bin/bash
#
# Usage:
# ./make_certs.sh test.example.com
#
# The required input to make_certs.sh is the path to your pfx file without the .pfx prefix
#
# test.example.com.key
# test.example.com.crt (includes ca-certs)
@x35a
x35a / scaleFontSize.js
Last active April 26, 2019 21:17
jq plugin decrease font size on text ovrfl
/*
works with JQ
usage
<p class="targetElement">Text to scale</p>
$('.targetElement').scaleFontSize({minFontsize: 12});
minFontsize минимальное размер шрифта для уменьшения, default 16px.
Определяется переполнение по ширине и высоте.
Определение переполнения по высоте работает если элементу задан height.
@milo
milo / github-webhook-handler.php
Last active October 29, 2024 15:45
GitHub Webhook Handler
<?php
/**
* GitHub webhook handler template.
*
* @see https://docs.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
%reset-Button {
border: none;
margin: 0;
padding: 0;
width: auto;
overflow: visible;
background: transparent;
/* inherit font & color from ancestor */
@jaydson
jaydson / gist:1780598
Created February 9, 2012 15:11
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){