Related tutorial: https://code64.de/visionerdy/wordpress-backups/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div id="result"></div> | |
<script> | |
if (typeof(EventSource) !== 'undefined') { | |
console.info('Starting connection...'); | |
var source = new EventSource('/stream.php'); | |
source.addEventListener('open', function(e) { | |
console.info('Connection was opened.'); | |
}, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const path = require("path"); | |
function newItem(name, url) { | |
return { name, url }; | |
} | |
const bookmarkPath = path.join( | |
process.env.HOME, | |
"/Library/Application Support/Google/Chrome/Default/Bookmarks" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
googlechromebookmarks() { | |
cat ~/.config/google-chrome/Default/Bookmarks | \ | |
grep -E '\"name|\"url' | \ | |
grep -vE '\"type\"\:' | \ | |
awk '{print $1 substr($0,index($0,$2))}' | \ | |
sed s'/^\"name\"\:/title \= /' | \ | |
sed s'/^\"url\"\:/url \= /' | \ | |
sed s'/\,$//' | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: TOPTAL WP-CLI Commands | |
* Version: 0.1 | |
* Plugin URI: https://n8finch.com/ | |
* Description: Some rando wp-cli commands to make life easier... | |
* Author: Nate Finch | |
* Author URI: https://n8finch.com/ | |
* Text Domain: toptal-wpcli | |
* Domain Path: /languages/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This has to be run from master | |
git checkout master | |
# Update our list of remotes | |
git fetch | |
git remote prune origin | |
# Remove local fully merged branches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var domStyle = document.createElement("style"); | |
domStyle.append( | |
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\ | |
* * { background-color: rgba(0,255,0,.2) !important; }\ | |
* * * { background-color: rgba(0,0,255,.2) !important; }\ | |
* * * * { background-color: rgba(255,0,255,.2) !important; }\ | |
* * * * * { background-color: rgba(0,255,255,.2) !important; }\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//whenever uncached images are added to the dom tree within target, | |
//replace them with a spinner gif until they're loaded | |
function replaceImages(target, spinner_src) { | |
var spinner, observer; | |
//detect support | |
if (window.MutationObserver) { | |
//preload spinner (probably a gif) | |
//if it's not ready for first use, oh well | |
spinner = new Image(); |
You can play with the GraphQL API live here. It's pretty nice and has autocompletion based on the GraphQL schema.
The first example gets your first 3 starred repos, the cursor values can be used for pagination.
Here's an example response from the first query:
{
NewerOlder