Skip to content

Instantly share code, notes, and snippets.

View kyleparisi's full-sized avatar

Kyle Parisi kyleparisi

  • Newtown, PA
View GitHub Profile
@kyleparisi
kyleparisi / Drag.js
Last active January 2, 2019 13:21
A single script to handle dragging of html or svg elements
try {
if (document) {
}
} catch (e) {
throw new Error("Drag module only works in browsers");
}
const Drag = function(view) {
let documentation = `
# Usage
# Forcefully remove images that don't have tags
docker rmi -f $(docker images | grep "<none>" | awk '{print $3}')
# Remove dead and exited containers
docker ps --filter status=dead --filter status=exited -aq \
| xargs docker rm -v
# Remove images that have dependent children
docker image prune -a
window.addClass = function(el, className) {
if (el.classList) el.classList.add(className);
else el.className += " " + className;
};
window.removeClass = function(el, className) {
if (el.classList) el.classList.remove(className);
else
el.className = el.className.replace(
new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"),
#!/usr/bin/env bash
docker run --rm --interactive --tty \
--user $(id -u):$(id -g) \
--volume $PWD:/var/www/default \
--workdir /var/www/default \
--entrypoint "composer" \
kyleparisi/larasible $1
@kyleparisi
kyleparisi / acme.sh
Last active April 28, 2018 22:44
For reference
acme.sh --issue --dns dns_dnsimple -d example.com -d www.example.com
zfs set acltype=posixacl lxd
# set /etc/hosts to 10.0.2.2 first
VBoxManage list runningvms
VBoxManage modifyvm "VM name" --natdnshostresolver1 on
find . -name "vendor" -type d -maxdepth 3 -exec vendor-prune {} \;
find . -name "node_modules" -type d -maxdepth 3 -exec node-prune {} \;
0 1 * * * [[ -e /var/run/docker.sock ]] && /usr/local/bin/docker system prune --force
0 2 * * * [[ -e /var/run/docker.sock ]] && /usr/local/bin/docker volume prune --force
@kyleparisi
kyleparisi / README.md
Last active January 2, 2018 15:01
init.d script for java jar
vi /etc/init.d/java-app
chmod +x /etc/init.d/java-app
/etc/init.d/java-app start
# reminder:
# chown -R www-data: /needed/paths