Skip to content

Instantly share code, notes, and snippets.

View devudit's full-sized avatar
🎓
Focusing

Udit Rawat devudit

🎓
Focusing
View GitHub Profile
@devudit
devudit / CacheJsController.php
Last active May 6, 2016 10:37
Cache js files in laravel
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
class CacheJsController extends Controller
{
@devudit
devudit / create-field.php
Last active May 6, 2016 10:38
Creating custom field to user profile
<?php
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
<h3>Extra profile information</h3>
<table class="form-table">
@devudit
devudit / class-master-slider-override.php
Last active May 6, 2016 13:24
Add custom tag on post slider of Master Slider
<?php
/**
*
* @wordpress-plugin
* Plugin Name: Custom Tags For Master Slider
* Plugin URI: http://uditrawat.com
* Description: Custom Tags For Master Slider
* Version: 1.3
* Author: Udit Rawat
@devudit
devudit / change_sortorder.php
Created May 9, 2016 05:58
How to change sort order of post page navigation
<?php
// get_posts in same custom taxonomy
$postlist_args = array(
'posts_per_page' => -1,
'orderby' => 'menu_order title',
'order' => 'ASC',
'post_type' => 'your_custom_post_type',
'your_custom_taxonomy' => 'your_custom_taxonomy_term'
);
$postlist = get_posts( $postlist_args );
@devudit
devudit / class-custom-post-filter.php
Created May 24, 2016 13:19
Custom Filter On Post Listing
<?php
/**
*
* @wordpress-plugin
* Plugin Name: Custom Post Filter
* Plugin URI: http://uditrawat.com
* Description: Custom Post Filter For Posts
* Version: 1.3
* Author: Udit Rawat
* Author URI: http://uditrawat.com
@devudit
devudit / responsive-table.html
Created May 27, 2016 06:57
Make html table responsive using css only
<html>
<head>
<style type="text/css">
body {
font-family: arial;
}
table {
border: 1px solid #ccc;
@devudit
devudit / multi-column-dropdown-v-2.x.html
Created July 5, 2016 07:22
Twitter Bootstrap - Multi Column Dropdown
<ul id="multicol-menu" class="nav pull-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">MultiCol Menu <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<div class="row-fluid" style="width: 400px;">
<ul class="unstyled span4">
<li><a href="#">test1-1</a></li>
<li><a href="#">test1-2</a></li>
<li><a href="#">test1-3</a></li>
@devudit
devudit / between.js
Last active July 5, 2016 12:11
Check if a number is in between of two number in javascript / jquery
Number.prototype.between = function (a, b) {
var min = Math.min.apply(Math, [a,b]),
max = Math.max.apply(Math, [a,b]);
return this > min && this < max;
};
var windowSize = 550;
console.log(windowSize.between(500, 600));
@devudit
devudit / element.html
Last active July 5, 2016 12:50
Move a html element in circular path using jQuery
<style type="text/css">
#emerico {
position: fixed
}
</style>
<div id="emerico">emerico</div>
@devudit
devudit / lumen-smtp.php
Created July 5, 2016 15:14
Sending mail in Lumen via SMTP
<?php
/*
I believe you already install lumen, Now we need ‘illuminate\mail’ for sending
mail through lumen so here is how i configure smtp mail with lumen.
1:- Install illuminate\mail to your lumen setup by entering following command
*/
composer require illuminate\mail
/*
2:- Edited the bootstrap/app.php uncommenting the following lines