Skip to content

Instantly share code, notes, and snippets.

View PabloWestphalen's full-sized avatar
🏠
Working from home

Pablo Westphalen PabloWestphalen

🏠
Working from home
View GitHub Profile
#!/usr/bin/env bash
# WP-CLI Back up Script to Amazon S3
# Source: https://www.jonathan.vc
# Author: Jonathan Dingman
# Adapted from Mike at WP Bullet
#define local path for backups
BACKUPPATH=/tmp/backups
#path to WordPress installations
(async function() {
let torrents = [];
let q = prompt("Search: ");
let dest = 'https://1337x.to/search/' + q;
let searchPage = await getDom(dest + '/1/');
let totalPages = parseInt( searchPage.querySelector('.pagination .last a').href.match(/\/(\d+)\/$/)[1] );
(
function() {
let div = '<div id="progress" style="position: fixed; z-index: 1000; background-color: #424c59; padding: 1em; bottom: 1em; left: 1em; border-radius: 4px; box-shadow: 1px 2px 12px 0 black">Clearing wishlist...</div>';
document.querySelector("body").innerHTML+=div;
let progress = document.getElementById("progress");
let promises = [], count = 0;
for (let id of g_Wishlist.rgAllApps) {
let form = new FormData();
form.append('sessionid', g_sessionID);
<?php
/*
* Author: Pablo Westphalen
*
* http://www.github.com/PabloWestphalen
*
*
* Usage: place this file in wp root dir
* then access your WP_URL/logmein.php
*/
@PabloWestphalen
PabloWestphalen / wp-logmein.php
Last active June 22, 2023 23:38
Simple Wordpress Login Hack
<?php
/*
* Author: Pablo Westphalen
*
* http://www.github.com/PabloWestphalen
*
*
* Usage: place this file in wp root dir, alongside wp-config
* then access your WP_URL/wp-logmein.php?user=something
*/
@PabloWestphalen
PabloWestphalen / wp-import-template.php
Created May 30, 2016 23:40
Stub for a PHP script that can use Wordpress' functions to manipulate the database
<?php
//Força report de erros
error_reporting(E_ALL|E_STRICT);
//Inicializa o wordpress, trazendo todas as funções e contexto dele pra dentro desse script
require_once("../wp-config.php");
$wp->init(); $wp->parse_request(); $wp->query_posts();
$wp->register_globals(); $wp->send_headers();
//Inicializa a referência à interface de query do WP (ver https://codex.wordpress.org/Class_Reference/wpdb)
/*
* TODO FOR TODAY: date fix, filter by highlight, tabs
*
* background-color: transparent // normal
background-color: rgb(xxx, xxx, xxx) //highlighted
*
* adicionar a variável currentFilteredTasks, que será
*
* nofilter deve bloquear todas as dropdowns. caso cnotrário, isso quebra a minha regra de inversão
*
@PabloWestphalen
PabloWestphalen / FileBrowser.java
Created September 5, 2013 02:59
Jin's File Explorer
package com.jin.explorer.servlets;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;