Skip to content

Instantly share code, notes, and snippets.

~/.zshrc
bindkey "\e\eOD" backward-word
bindkey "\e\eOC" forward-word
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@jackzard
jackzard / autostart.sh
Last active March 24, 2018 22:25
Autostart Forever Bash
#!/usr/bin/env bash
### BEGIN INIT INFO
# Provides: autostart.sh
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Autostart
# Description: AutoStart
### END INIT INFO
update_option('siteurl','http://example.com');
update_option('home','http://example.com');
html2canvas(document.getElementsByClassName('parent-container')[0], {
onrendered : function(canvas){
document.querySelector('.parent-container').style.display = 'none'
let div = document.createElement('div')
div.classList.add('parent-container-canvas')
div.classList.add('parent-container')
div.appendChild(canvas)
document.body.appendChild(div)
})
Array.filter((val, index, self) => {
return self.indexOf(val) === index
})
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason)
});
mongodump -d <database_name> -o <directory_backup>
mongorestore -d <database_name> <directory_backup>
https://stumbles.id.au/nginx-dynamic-image-resizing-with-caching.html
server {
# Internal image resizing server.
server_name localhost;
listen 8888;
location ~ "^/cdn/(?<width>\d+)/(?<image>.+)$" {
alias /var/www/website/public/$image;
image_filter resize $width -;
create credential
https://console.developers.google.com/apis/credentials
create service account
https://console.developers.google.com/iam-admin/serviceaccounts/
add analytics user management from service account email