Skip to content

Instantly share code, notes, and snippets.

View pankajpatel's full-sized avatar
🎯
Focusing

Pankaj Patel pankajpatel

🎯
Focusing
View GitHub Profile
@pankajpatel
pankajpatel / StickierDiv.jsx
Created May 23, 2016 22:09 — forked from z5h/StickierDiv.jsx
sticky header div react js
/** @jsx React.DOM */
"use strict";
var util = {
// findPos() by quirksmode.org
// Finds the absolute position of an element on a page
findPos: function (obj) {
var curleft = 0,
curtop = 0;
@pankajpatel
pankajpatel / functions.php
Created March 14, 2016 23:38 — forked from mgibbs189/functions.php
FacetWP - sort by average rating using the WP Job Manager Reviews plugin
<?php
/**
* Add a "Rating" sort option
*
* @author David Nash <[email protected]>
*/
function custom_wpjmr_after_save_comment_review( $comment_id ) {
$wpjmr = WP_Job_Manager_Reviews::instance();
$wpjmr->review->save_rating_average_post_meta( $comment_id );
}
@pankajpatel
pankajpatel / code-1.htm
Created February 21, 2016 12:14 — forked from bennadel/code-1.htm
Decoding Morse Code With JavaScript
<!DOCTYPE html>
<html>
<head>
<title>Decoding Morse Code With JavaScript</title>
<style type="text/css">
div.output {}
div.output p.message {
@pankajpatel
pankajpatel / countCSSRules.js
Last active September 15, 2017 13:36 — forked from krisbulman/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE. — This snippet has been modified to count more than just the first level of CSSStyleRule objects within CSSMediaRule.
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
# Author = Nikhil Venkat Sonti
# email = [email protected]
# github ID = shadowfax92
import sys
from xml.dom.minidom import _get_StringIO
from lxml import html
import requests
import os
import re
import time
@pankajpatel
pankajpatel / stuns
Created February 14, 2014 19:15 — forked from yetithefoot/stuns
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},