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 / pi.eme_utills.php
Created July 6, 2016 11:29
Truncate text without truncating html
<?php
/* Plugin for expression engine 2 */
if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
========================================================
Plugin Eme Utills
--------------------------------------------------------
Copyright: Udit Rawat
License: Freeware
--------------------------------------------------------
@devudit
devudit / click-to-expand.css
Created July 6, 2016 07:12
Click-To-Expand Paragraph Text with jQuery
.host-description{
overflow:hidden;
}
.read-more{
color:red;
}
@devudit
devudit / ot_handling_charges.php
Created July 6, 2016 02:01
Zencart order total module example
<?php
/* Write this code on order.php */
$customer_whole_obj = $db->Execute('select `customers_whole` from `'.TABLE_CUSTOMERS.'` where `customers_id` ='.$_SESSION['customer_id']);
$customer_whole = $customer_whole_obj->fields['customers_whole'];
if($customer_whole == 4){
if($_SESSION['payment'] == 'paypal' || $_SESSION['payment'] =='authorizenet'){
$this->info['charges'] = 2.5;
$this->info['total_without_charges'] = $this->info['total'];
$this->info['charges_amt'] = ($this->info['total'] * $this->info['charges'])/100;
$this->info['total'] = $this->info['total'] + $this->info['charges_amt'];
@devudit
devudit / acc_emerico.php
Created July 6, 2016 01:47
How to run custom JavaScript in Expression engine admin
<?php
/*
I hope you all know how expression engine works. This article shows you
how to develop an accessory module for expression engine to run custom
javascript in expression engine admin.
Here are steps to go:-
Stop direct access to your module by writing
*/
@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
@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 / 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 / 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 / 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 / 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