Skip to content

Instantly share code, notes, and snippets.

View vishnukumarpv's full-sized avatar

VISHNUKUMAR P V vishnukumarpv

View GitHub Profile
@vishnukumarpv
vishnukumarpv / CURLphpLinkedIn.php
Last active February 20, 2023 09:33
CURL php Auth get data LinkedIn
<?php
function post_curl($url,$param="")
{
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
if($param!="")
curl_setopt($ch,CURLOPT_POSTFIELDS,$param);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
//scroll to section with "data-anchor"
var $ = jQuery.noConflict();
$(' ul.mega-sub-menu li a.mega-menu-link').click(function(event){
event.preventDefault();
var url=$(this).attr('href');
var i= url.split('#')[1];
if($('[data-anchor="#'+i+'"]').length){ //*****using data-anchor******
jQuery('html, body').animate({
scrollTop: jQuery( '#'+i ).offset().top- 180
}, 500);
@vishnukumarpv
vishnukumarpv / bootstrap.grid.min.css
Created August 23, 2016 12:38
Bootstrap v3. Grid Only css minified file
.container,.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.row{margin-left:-15px;margin-right:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{widt
@vishnukumarpv
vishnukumarpv / content.ts
Created August 27, 2016 09:28
Typo3 frontend login logout link typoscript
10 = TEXT
10 {
value = Login
typolink.parameter = 25
}
[loginUser = *]
10.value = Logout
10.typolink.additionalParams = &logintype=logout
[end]
@vishnukumarpv
vishnukumarpv / class.database.php
Last active August 29, 2016 09:56 — forked from jonashansen229/class.database.php
PHP OOP Database class using MySQLI and Singleton pattern. Only one instance of the class will be made, this requires less memory.
<?php
/*
* Mysql database class - only one connection alowed
*/
class Database {
private $_connection;
private static $_instance; //The single instance
private $_host = "HOSTt";
private $_username = "USERNAME";
private $_password = "PASSWORd";
@vishnukumarpv
vishnukumarpv / Alertifi.js_css
Created August 30, 2016 13:19
Alertifi modified
//CSS min no bouncing animation
.alertify .ajs-dimmer,.alertify .ajs-modal{position: fixed;padding: 0;z-index: 1981;top: 0;right: 0;bottom: 0;left: 0}.alertify .ajs-dimmer{margin: 0;background-color: #252525;opacity: .5}.alertify .ajs-modal{overflow-y: auto}.alertify .ajs-dialog{position: relative;margin: 5% auto;min-height: 110px;max-width: 500px;padding: 24px 24px 0;outline: 0;background-color: #fff}.alertify .ajs-dialog.ajs-capture:before{content: '';position: absolute;top: 0;right: 0;bottom: 0;left: 0;display: block;z-index: 1}.alertify .ajs-reset{position: absolute!important;display: inline!important;width: 0!important;height: 0!important;opacity: 0!important}.alertify .ajs-commands{position: absolute;right: 4px;margin: -14px 24px 0 0;z-index: 2}.alertify .ajs-commands button{display: none;width: 10px;height: 10px;margin-left: 10px;padding: 10px;border: 0;background-color: transparent;background-repeat: no-repeat;background-position: center;cursor: pointer}.alertify .ajs-commands button.ajs-close{backgr
@vishnukumarpv
vishnukumarpv / numbersToWords.js
Last active August 31, 2016 12:15
Numbers to words
//<input type"..." value="1265">
//1265
//one thousand two hundred sixty five
var names = [{"0":"zero","1":"one","2":"two","3":"three","4":"four","5":"five","6":"six","7":"seven","8":"eight","9":"nine" },{"0":"ten","1":"eleven","2":"twelve","3":"thirteen","4":"fourteen","5":"fifteen","6":"sixteen","7":"seventeen","8":"eighteen","9":"nineteen"},{"2":"twenty","3":"thirty","4":"forty","5":"fifty","6":"sixty","7":"seventy","8":"eighty","9":"ninety"},["","thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","decillion","undecillion","duodecillion","tredecillion","quattuordecillion", "quindecillion","sexdecillion","septdecillion","octdecillion","novemdecillion","vigintillion"]];
var to_words = function(s, n){
var ns = s.slice(0,3);
return (ns.length < 1)?"":to_words(s.slice(3,s.length),n+1)+((ns.length>1)?((ns.length==3&&ns[2]!="0")?names[0][ns[2]]+" hundred "+((ns[1]=="1")?names[1][ns[0]]+" ":(ns[1]!="0")?names[2][ns[1]]+" "+((ns[0]!="0")?n
@vishnukumarpv
vishnukumarpv / htmlEscape.js
Created September 5, 2016 11:19
html entities removeing javascript
function htmlEscape(s) {
return (s + '').replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/'/g, '&#039;')
.replace(/"/g, '&quot;')
.replace(/\n/g, '<br />');
}
@vishnukumarpv
vishnukumarpv / randomNumber.js
Created September 8, 2016 11:45
Random number with javascript
console.log(Math.floor((Math.random() * 255) + 1));
@vishnukumarpv
vishnukumarpv / fullCalendar_events_to_JSON.js
Last active September 9, 2016 12:18
Full calendar get all events as JSON string for ajax
var allVideosInGrid = function(){return calenderID.fullCalendar('clientEvents') };
console.log(allVideosInGrid());//[Object, Object, Object, Object, Object, Object] => JSONstring
var vidOBJ=allVideosInGrid();
var json = JSON.stringify(vidOBJ.map(function(e) {
return {
videoId:e.videoId,
title: e.title,
start: e.start,
end: e.end,