Skip to content

Instantly share code, notes, and snippets.

View devudit's full-sized avatar
🟢
Available

Udit Rawat devudit

🟢
Available
View GitHub Profile
@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
@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 / 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 / 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 / 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 / get-image-by-tag.js
Created July 7, 2016 09:56
Get Instagram image data using javascript/jquery
var token = '<access_token>',
hashtag='<tag>', // hashtag without # symbol
num_photos = 4;
$.ajax({
url: 'https://api.instagram.com/v1/tags/' + hashtag + '/media/recent',
dataType: 'jsonp',
type: 'GET',
data: {access_token: token, count: num_photos},
success: function(data){
@devudit
devudit / wrap-colorbox.js
Created July 7, 2016 12:00
Wrap colorbox main div into another
$.colorbox({
open: true,
height: 500,
width: 500,
onComplete: function() {
$("#colorbox").wrap("<div id='colorbox_wrapper' />")
},
onCleanup: function() {
$("#colorbox").unwrap("<div id='colorbox_wrapper' />")
}