Skip to content

Instantly share code, notes, and snippets.

View jsakhil's full-sized avatar
🎯
Focusing

Js Akhil jsakhil

🎯
Focusing
View GitHub Profile
@jsakhil
jsakhil / gist:c05ab2113330e464d15bc09530775765
Created December 17, 2019 14:24 — forked from grandmanitou/gist:8863248
Place multiple markers with infowindow on Google Maps API v3, use external links to trigger click and center map on desired location.
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?language=fra&amp;sensor=false"></script>
<script type="text/javascript">
var map;
var Markers = {};
var infowindow;
var locations = [
[
'Samsung Store Madeleine',
'<strong>Samsung Store Madeleine</strong><p>5 Boulevard Malesherbes, 75008 Paris<br>10h – 20h</p>',
48.8701925,
@jsakhil
jsakhil / ie_only_sytles.css
Created January 17, 2020 13:43
Internet Explorer 10 & 11 and Microsoft Edge 12 Only styles
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#myElement {
/* IE10+ CSS styles go here */
}
}
@supports (-ms-accelerator:true) {
#myElement {
/* IE Edge 12+ CSS styles goes here */
@jsakhil
jsakhil / pyrocms_breadcrumb.twig
Created January 27, 2020 06:46
PyroCMS Breadcrumb Template with Product Module
{% if page.slug != 'home' %}
<!-- BREADCRUMB -->
<div class="container-fluid breadcrump wap_{{ page.slug }}">
<div class="container">
<div class="row">
<div class="title_area text-center">
{% if page.title !='' %}
<h2>{{ page.title }}</h2>
{% elseif page.slug =='' and products.name !='' %}
<?php
/**
* @license MIT
* @author Ruben Decleyn mukke@tbs-dev.co.uk>
* @created 12/02/2017
*/
namespace App\TwigExtensions;
@jsakhil
jsakhil / ie.js
Created March 19, 2020 09:55
IE Background Image Fix when scrolling
if(navigator.userAgent.match(/Trident\/7\./)) {
document.body.addEventListener("mousewheel", function() {
event.preventDefault();
var wd = event.wheelDelta;
var csp = window.pageYOffset;
window.scrollTo(0, csp - wd);
});
}
@jsakhil
jsakhil / insta.js
Last active July 26, 2021 14:06
Live Instagram Feed - Instagram API that fetches User Profile, Followers, Following, Images, Posts, Likes , Shares
$(document).ready(function(){
$.ajax({
url:"https://www.instagram.com/{username}/channel/?__a=1",
type:'get',
success:function(response){
posts = response.graphql.user.edge_owner_to_timeline_media.edges;
posts_html = '';
for(var i=0;i<8;i++){
url = posts[i].node.display_url;
post_shortcode = posts[i].node.shortcode;
@jsakhil
jsakhil / .htaccess
Created April 2, 2020 11:48 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@jsakhil
jsakhil / metal-widget.js
Created April 22, 2020 15:53
Gold & Silver Rate Widget
$.ajax({
url: 'https://data-asg.goldprice.org/dbXRates/USD',
dataType: 'text',
success: function(response) {
var prices = JSON.parse(response).items[0];
var goldp = prices.xauPrice;
var goldx = prices.chgXau;
var golds = (prices.xauPrice > prices.xauClose) ? 'up' : 'down';
var silverp = prices.xagPrice;
var silverx = prices.chgXag;
@jsakhil
jsakhil / toggle.js
Last active November 13, 2020 10:01
Simple View More/ View Less Toggle for Content
$('.toggle').on('click', function(e){
e.preventDefault();
// Do Something
$(this).text($(this).text() == 'View More' ? 'View Less' : 'View More');
})
## Add class to body based on the URL – jQuery
var urlPath = window.location.pathname;
@jsakhil
jsakhil / waMessageBlast.js
Last active March 4, 2021 19:11
WhatsApp web message Blast
// 𝔹𝕃𝔸𝕊𝕋
// Run the following code manually through browser console with an opened conversation in WhatsApp (Web Version)
// STEP #1
function sendMessageJs(message, count) {
for(var i = 0; i <= count; i++){
window.InputEvent = window.Event || window.InputEvent;
var event = new InputEvent('input', {
bubbles: true
});