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 | |
class Ath_DB | |
{ | |
protected static $table = null; | |
function __construct() | |
{ | |
global $wpdb; | |
$this->db = $wpdb; |
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
<!-- Add this anywhere in the page. It assumes your content is inside an <article> tag. --> | |
<a class="floating-twitter-share-link" href="#" title="Share this" target="_blank"> | |
<i class="fa fa-twitter floating-twitter-share"></i> | |
</a> |
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 | |
//One way | |
$this->validate($request, | |
[ | |
'data.*.name' => 'unique:priorities' | |
], | |
[ | |
'data.*.name.unique' => 'Priority name exists already, please pick a different name.' | |
] | |
); |
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
//Removes all dots after the first one. | |
function removeExtraDots(str) { | |
return str.replace( /^([^.]*\.)(.*)$/, function ( a, b, c ) { | |
return b + c.replace( /\./g, '' ); | |
}); | |
} | |
function dotsCount(number) { | |
return (number.match(/[.]/g) || []).length; | |
} |
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
var invoicesTable = $('table.invoices-table').DataTable({ | |
processing: true, | |
serverSide: true, | |
lengthChange: true, | |
rowId: 'id', | |
"ajax": { | |
"url": '/invoices', | |
"dataSrc": "data.data", | |
data: function ( d ) { | |
var dateType = $('#dateType').val(); |
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 | |
namespace App\Console\Commands; | |
use Aws\S3\MultipartUploader; | |
use Aws\Exception\MultipartUploadException; | |
use Illuminate\Console\Command; | |
use Storage; | |
class BackupCRM extends Command |
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
//Helper function for getting the exif data. | |
function base64ToArrayBuffer (base64) { | |
base64 = base64.replace(/^data\:([^\;]+)\;base64,/gmi, ''); | |
var binaryString = atob(base64); | |
var len = binaryString.length; | |
var bytes = new Uint8Array(len); | |
for (var i = 0; i < len; i++) { | |
bytes[i] = binaryString.charCodeAt(i); | |
} | |
return bytes.buffer; |
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
import '../scss/admin.scss'; |
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 | |
function api_register_user( WP_REST_Request $request ) { | |
$username = sanitize_text_field( trim( $request['username'] ) ); | |
$email = sanitize_email( trim( $request['email'] ) ); | |
$password = sanitize_text_field( trim( $request['password'] ) ); | |
$confirm_password = sanitize_text_field( trim( $request['confirm_password'] ) ); | |
$captcha = $request['captcha']; | |
$errors = []; | |
if( ! $captcha ) { |
OlderNewer