Skip to content

Instantly share code, notes, and snippets.

View dakshhmehta's full-sized avatar
💭
Enjoy the Coding!

Daksh Mehta dakshhmehta

💭
Enjoy the Coding!
View GitHub Profile
@dakshhmehta
dakshhmehta / actionable-select.js
Created September 1, 2020 06:44
Actionable Select
$(".actionable-select").change(function (e) {
e.preventDefault();
var href = $(this).data('url');
var method = $(this).data('method') || 'GET';
var isClickable = $(e.target).is(":disabled");
var _data = {};
if (method == 'PUT' || method == 'POST') {
function __clean_js($tag, $handle) {
$__files = [
'async' => [
// 'recaptcha', // Plugin breaks
],
'defer' => [
'easy-testimonial',
'contact-form-7',
'themepunch',
],
/**
* CCAvenue Encrypt Function
*
* @param $plainText
* @param $key
* @return string
*/
protected function encrypt($plainText, $key)
{
$key = $this->hextobin(md5($key));
@dakshhmehta
dakshhmehta / same-height.js
Created July 1, 2017 09:56
Fixes the heights of all children to same one.
/**
Usage:
<div class="row same-height" data-class="col-md-4">
<div class="col-md-4"><p></p></div>
<div class="col-md-4"><p></p><p></p></div>
<div class="col-md-4"><p></p></div>
<div class="col-md-4"><p></p></div>
</div>
All columns will have height similar to second column as It has highest height amount all of them.
@dakshhmehta
dakshhmehta / states and counties - key by state code
Last active August 19, 2020 20:44 — forked from aghouseh/states and counties
PHP nested array of states and counties
$counties = array(
"AL" => array(
"Autauga",
"Baldwin",
"Barbour",
"Bibb",
"Blount",
"Bullock",
"Butler",
"Calhoun",
@dakshhmehta
dakshhmehta / ceditor_macro.php
Created May 2, 2015 15:40
CKEditor Macro for Laravel
Form::macro('editor', function($name, $value){
// Requires "dakshhmehta/helpers" in composer.json for Template
Template::addJS(asset('assets/js/ckeditor/ckeditor.js'));
Template::addJS(asset('assets/js/ckeditor/adapters/jquery.js'));
$html = '<textarea class="form-control ckeditor" name="'.$name.'" id="'.$name.'">'.$value.'</textarea>';
return $html;
});
@dakshhmehta
dakshhmehta / Template.php
Last active August 29, 2015 13:56
Laravel Basic Template Library
<?php
class Template {
protected static $rawData = array();
protected static $files = array();
public function __construct()
{
self::$rawData['js'] = array();
self::$rawData['css'] = array();
@dakshhmehta
dakshhmehta / laravel-jQuery-validation-rule.php
Last active May 27, 2018 19:13
Convert Laravel validation rules to jQuery validation rules to enable client-side validation. See more information about jQuery validation at http://jqueryvalidation.org/
<?php
use LaravelBook\Ardent\Ardent;
// You can extend Eloquent
// Example: http://laravel.io/bin/89V7
class JsModel extends Ardent {
/**
* Mapping in an array of Laravel Validator class rules
* and jQuery validator rules in format as