Skip to content

Instantly share code, notes, and snippets.

var square = document.getElementById("square");
var red = 255;
var green = 0;
var blue = 0;
var towardsBlue = true;
setInterval(function(){
// template literal:
@leigler
leigler / image_srcset.php
Last active October 28, 2019 14:22
image_srcset for Kirby
<img
class="header_image img_preload"
title="<?= $image->toFile()->title() ?>"
alt="<?= $image->toFile()->title() ?>"
srcset="<?= $image->toFile()->resize(700)->url() ?> 700w,
<?= $image->toFile()->resize(1400)->url() ?> 1400w"
sizes="(min-width: 768px) 80vw, 100vw"
src="<?= $image->toFile()->url()?>"
>
var Site = {};
Site.loaded = function(){
console.log("DOMContentLoaded")
}
document.addEventListener('DOMContentLoaded', function(event) {
Site.loaded();
})

digital ocean wp + react build

install

  • wordpress 18.04 marketplace droplet
  • submit an ssh key ssh-keygen -t rsa
  • once droplet is created, create A record to point at the droplet's IP
  • ssh into ssh root@YOURIP to set root password/finish install
    • includes LetsEncrypt, for later SSL, run certbot --apache -d YOURDOMAIN.com -d www.YOURDOMAIN.com

SFTP cli notes

Establishing a connection

sftp root@your_server_ip

Commands

  • help or ?
  • exit bye
@leigler
leigler / safari_footer.js
Last active April 8, 2020 16:04
safari mobile fixed footer bug function
@leigler
leigler / meta-tags.md
Last active February 25, 2019 14:53
list of minimal meta tags
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
  
	<meta name="description" content="" />
	<meta name="keywords" content="">

  <!-- Schema.org markup for Google+ -->
	<meta itemprop="name" content="">
	<meta itemprop="description" content="">
@leigler
leigler / .babelrc
Last active November 13, 2018 17:37
node app with preact build, using the webpack bundler, and babel compiler
{
"presets": ["@babel/preset-env"],
"plugins":[
["@babel/transform-react-jsx", {"pragma" : "h"}]
]
}

sudo killall VDCAssistant

change the files to chmod 644 and folders to 755:

  • .htaccess to 644: chmod 644 .htaccess
  • index.php to 644: chmod 644 index.php
  • panel/ to 755: chmod 755 panel/
  • panel/index.php to 644 chmod 644 panel/index.php

chmod can be edited through ssh: chmod XXX filepath