Skip to content

Instantly share code, notes, and snippets.

View Artisan-Asad's full-sized avatar
Reverse engineering

Asad Shahbaz Artisan-Asad

Reverse engineering
View GitHub Profile
@meetawahab
meetawahab / create-admin-user.php
Last active September 28, 2019 06:40
Create a new admin user in WordPress through code. You just need to change the variables and drop the file in the mu-plugins directory or add the following code in active theme's functions.php, then reload the homepage in WordPress. The new user will be created. Remove the file/code after that.
<?php
add_action( 'init', 'aw610_create_user' );
function aw610_create_user() {
$username = 'admin';
$password = 'password';
$email_address = 'email@domain.com';
if ( ! username_exists( $username ) ) {
@timneutkens
timneutkens / fpdf-image.php
Created April 14, 2016 14:36
Insert base64 image data into fpdf
<?php
// load the 'fpdf' extension
require('fpdf.php');
// just for demonstration purpose, the OP gets the content from a database instead
$h_img = fopen('img.jpg', "rb");
$img = fread($h_img, filesize('img.jpg'));
fclose($h_img);
// prepare a base64 encoded "data url"
@joyrexus
joyrexus / README.md
Last active February 19, 2024 17:15 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})