Skip to content

Instantly share code, notes, and snippets.

@greg-randall
greg-randall / pixel.php
Last active August 26, 2021 13:39
Super simple tracking pixel. Upload to your server. Add an image to your page like <img alt="" src="pixel.php?e=jim.smith@example.com&fn=jim&ln=smith&c=campaign">
<?php
/* add to an email or on a website like this:
<img alt="" width="1" height="1" src="pixel.php?e=jim.smith@qwerty.com&fn=jim&ln=smith&c=testing">
the information will be logged.
this approach has some limitations, so if you expect heavy volumes you might try something else.
*/
Combine, Crop, and Remove similar frames
find *.mkv | sed 's:\ :\\\ :g'| sed 's/^/file /' > fl.txt; ffmpeg -f concat -i fl.txt -filter:v "crop=704:452:0:28",mpdecimate=hi=1536:lo=640:frac=0.5,setpts=N/FRAME_RATE/TB -qscale:v 2 ../output.mp4
Adjust speed to your liking
ffmpeg -i input.mp4 -r 30 -filter:v "setpts=0.01*PTS" -q:v 10 ouput.mp4
@greg-randall
greg-randall / gist:968129530d1078ce62f9e2bdfcb1be36
Created October 17, 2021 15:23
Samsung Gear 360 2017 Image Bracketing.
#notes:
#follow the instructions on https://github.com/ottokiksmaler/gear360_modding to get to the point of opening the Gear 360's web server -- http://192.168.43.1:8888
#the below series of commands when pasted & executed in the "Execute a command" box will produce 14 bracketed exposures.
#14 exposures is probably overkill. I think probably 5 would work fine. (Maybe 1/8th - 1/2000th)
#The first section sets several variables. For the full list see https://github.com/ottokiksmaler/nx500_nx1_modding/blob/master/ST_CAP_CAPDTM.md
#30 = USERDATA_ISONR -- turn off ISO noise removal
#31 = USERDATA_LTNR -- turn off long exposure noise removal
#5 = USERDATA_ISO -- set ISO to 100
@greg-randall
greg-randall / split.sh
Created October 17, 2021 20:39
Split jpg Samsung Gear 360 2017
#!/bin/bash
#place in a folder with gear 360 images, and it'll split them into the two images.
if [ ! -d "split" ]
then
mkdir split
fi
for i in *
@greg-randall
greg-randall / check.sh
Last active December 9, 2021 15:31
Scans a list of domains for their WordPress version and outputs a CSV.
FILENAME="domains.txt"
LINES=$(cat $FILENAME)
echo "Domain, Version" > domains_with_versions.csv
for LINE in $LINES
do
CHECKLOCATION="${LINE}/feed/"
@greg-randall
greg-randall / gist:0a5d5cbb79d8c5b276a363836204b318
Created December 17, 2021 13:28
Make some boxes on a website the same height. Add a common class name to the boxes, and swap out your class name for ".class-name-of-box". Requires jQuery.
<script>
function equalHeight(group) {
var tallest = 0;
group.each(function() {
var thisHeight = $(this).height();
if(thisHeight > tallest) {
tallest = thisHeight;
}
});
group.height(tallest);
@greg-randall
greg-randall / gist:2fe5e8742f6e69b5d1a60b06680e7c5e
Last active December 17, 2021 19:46
Add a translucent color over a background image in a webpage. https://jsfiddle.net/Lmy6jw03/1/
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><rect style='fill:rgb(41,114,183);' width='100%' height='100%' opacity='0.75' /></svg>"), url('img/background.jpg');
@greg-randall
greg-randall / gist:d321fb18e78a66695c6fa0cb06fad838
Created February 9, 2022 15:22
Check a folder of XML files against a XSD file.
find *.xml -exec xmllint --schema Schema.xsd --noout {} \;
@greg-randall
greg-randall / index.php
Created February 10, 2022 16:21
Generate json file for the WordPress plugin Redirection.
<pre>
<?php
//built to generate a json file for https://wordpress.org/plugins/redirection/
//might want to run this through a json validator before uploading. there isnt any checking to make sure things worked correctly
//paste two columns from excel here.
//make sure to have trailing slashes
$data = "/thing/asdf/ /other-thing/qwerty/
/ideas/ /better-ideas/";
@greg-randall
greg-randall / gist:44dd0f535d7f9671a959c64ee0634c3f
Last active March 23, 2023 14:39
Convert a folder of PDFs to JPGs at web resolutions, and replace spaces with underscores while we're at it.
rename "s/[\s()]/_/g" *; rename "s/_+/_/g" * ; find *.pdf -exec convert -colorspace sRGB -density 150 {} -background white -alpha remove -alpha off -resize 1600x1600 -quality 100 {}.jpg \;