Skip to content

Instantly share code, notes, and snippets.

View mikhy888's full-sized avatar
💭
I may be slow to respond.

Mikhil Jose mikhy888

💭
I may be slow to respond.
  • Bangalore, India
View GitHub Profile
@mikhy888
mikhy888 / Single side scroll reveal animation
Created January 29, 2019 11:57
Single side scroll reveal animation
//scroll direction and anim
var scrollDirection = function (elem) {
$(window).on('DOMMouseScroll mousewheel', function (event) {
if (event.originalEvent.detail > 0 || event.originalEvent.wheelDelta < 0) {
if (elem.parent().isOnScreen()) {
console.log("malar");
elem.each(function () {
var $this = $(this);
var delay = $this.attr("data-delay");
setTimeout(function () {
@mikhy888
mikhy888 / svg.js
Created September 12, 2018 06:51 — forked from schmidt1024/svg.js
Replace all SVG images with inline SVG using jQuery
/*
* Replace all SVG images with inline SVG
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
@mikhy888
mikhy888 / sendgrid.php
Created June 12, 2018 06:27 — forked from keithweaver/sendgrid.php
Send an email with PHP using Sendgrid (Mail Server)
<?php
// You need to install the sendgrid client library so run: composer require sendgrid/sendgrid
require '/vendor/autoload.php';
// contains a variable called: $API_KEY that is the API Key.
// You need this API_KEY created on the Sendgrid website.
include_once('./credentials.php');
$FROM_EMAIL = 'YOUR_EMAIL';
// they dont like when it comes from @gmail, prefers business emails
@mikhy888
mikhy888 / tooltip
Last active June 7, 2018 09:29
Simple tooltip scripts
<style>
body {
margin: 50px;
font-family: sans-serif;
}
.tooltip {
color:#fff;http://jsfiddle.net/user/login/
width: auto;
padding:10px;
$("#dropDownMenu li").each(function(i) {
$(this).delay(100 * i).fadeIn(500);
});
.sub-menu {
position: absolute;
z-index: 1000;
/* color: #fff;
right: 5px; */
}
$("#dropDownMenu li").each(function(i) {
$(this).delay(100 * i).fadeIn(500);
});
.sub-menu {
position: absolute;
z-index: 1000;
/* color: #fff;
right: 5px; */
}
@mikhy888
mikhy888 / Custom CSS
Created August 26, 2017 06:49
Custom CSS
/* custom normal styles starts here */
#pp-nav.right { right: 2px; }
* { margin: 0px; padding: 0px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; letter-spacing: initial; -webkit-overflow-scrolling: touch; }
ul { padding: 0px; margin: 0px; }
.pull-right { float: right !important; }
.pull-left { float: left !important; }
<?php
$firstname = $secondname = $phone = $email = $message = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$firstname = test_input($_POST["firstname"]);
$secondname = test_input($_POST["secondname"]);
$phone = test_input($_POST["phone"]);
$email = test_input($_POST["email"]);
$detail = test_input($_POST["message"]);
<!--here is the html-->
<input id="txt" type = "text" value = "Choose File" onclick ="javascript:document.getElementById('file').click();">
<input id = "file" class="upload-opt" type="file" style='display: none;' name="upload"/>
<!--here is the script-->
$('#file').on( 'change', function() {
var myfile= $( this ).val();
var ext = myfile.split('.').pop();
//alert(ext);
var path_tick = "http://192.168.1.9/optifast-me_com/sites/all/themes/optifast/assets//images/common/right.png";
var tick_mark = "<img src='"+path_tick+"'>";
var path_cross = "http://192.168.1.9/optifast-me_com/sites/all/themes/optifast/assets//images/common/cross.png";
var cross_mark = "<img src='"+path_cross+"'>";
/*check yes or no - replacing*/
$('a, h1, h2, h3, h4, h5, p, span, .heading, div, li').html(function(index,html){
return html.replace(/#yes/g , tick_mark);
});