Skip to content

Instantly share code, notes, and snippets.

View lkwatson's full-sized avatar
🤖
Beep boop

Lucas Watson lkwatson

🤖
Beep boop
View GitHub Profile
@lkwatson
lkwatson / composite_gif
Created February 3, 2020 22:31
Overlay two gifs on top of each other with ImageMagick
convert source-a.gif -coalesce a-%04d.gif
convert source-b.gif -coalesce b-%04d.gif
for i in {0000..0200}; do composite -blend 50% a-$i.gif b-$i.gif c-$i.gif; done
convert -loop 0 -delay 10 c-*.gif result.gif
@lkwatson
lkwatson / god_save_me.md
Last active August 21, 2019 01:47
Compiling OpenCV 4.1.0 on NVIDIA Jetson Nano

sudo vi /usr/local/cuda/include/cuda_gl_interop.h

# Comment the following lines, near the top
//#if defined(__arm__) || defined(__aarch64__)
//#ifndef GL_VERSION
//#error Please include the appropriate gl headers before including cuda_gl_interop.h
//#endif
//#else
 #include 

Docker notes

Mac X11: https://cntnr.io/running-guis-with-docker-on-mac-os-x-a14df6a76efc Ubuntu X11: xhost +local:docker

Mac: docker run -it --rm -e DISPLAY=${HOSTNAME}:0 -v /tmp/.X11-unix/:/tmp/.X11-unix osrf/ros:kinetic-desktop-full-xenial Ubuntu: docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix osrf/ros:kinetic-desktop-full-xenial

@lkwatson
lkwatson / redirect.html
Created March 8, 2018 03:07
Simple Code for Doing a Redirect
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=https://www.example.me/">
</head>
<body>
<p>If you aren't automatically redirected,
<a href="https://www.example.me/">click here.</a></p>
</body>
</html>
@lkwatson
lkwatson / enforce-https.js
Created February 21, 2018 02:23
Enforce HTTPS
if(window.location.host == "example.com") {
var host = "example.com";
if ((host == window.location.host) && (window.location.protocol != "https:")) {
window.location.protocol = "https";
}
}else{
var host = "www.example.com";
if ((host == window.location.host) && (window.location.protocol != "https:")) {
window.location.protocol = "https";
}
@lkwatson
lkwatson / keybase.md
Created November 12, 2017 23:14
My verification for keybase

Keybase proof

I hereby claim:

  • I am lkwatson on github.
  • I am lkwatson (https://keybase.io/lkwatson) on keybase.
  • I have a public key ASCgH0hGIHjfaLt31lgo8dqGOg1obHYkvVnq00vJSY8elgo

To claim this, I am signing this object:

@lkwatson
lkwatson / script.js
Created July 11, 2017 04:39
Hide email addresses from (poorly coded) email-scraping bots
$('.email-spam-hide').text(function(i,t){
return t.replace("[at]","@");
});