Skip to content

Instantly share code, notes, and snippets.

View sujeet's full-sized avatar

Sujeet Kausallya Gholap sujeet

View GitHub Profile
@sujeet
sujeet / ijq.py
Created February 23, 2024 02:59
Interactive JQ query builder with live preview
# needs jq installed
# needs pip packages prompt-toolkit and pygments
# example: cat data.json | python ijq.py
import json
import subprocess
import sys
from prompt_toolkit.application import Application
from prompt_toolkit.input.defaults import create_input

1

You meet two inhabitants: Zoey and Mel. Zoey tells you that Mel is a knave. Mel says, 'Neither Zoey nor I are knaves.'

2

You meet two inhabitants: Peggy and Zippy. Peggy tells you that 'of Zippy and I, exactly one is a knight'. Zippy tells you that only a knave would say that Peggy is a knave.

3

You meet two inhabitants: Sue and Zippy. Sue says that Zippy is a knave. Zippy says, 'I and Sue are knights.'

4

@sujeet
sujeet / fb-comment-notification-google-app.js
Last active December 18, 2015 07:09
Source code for a Google Script App which. 1) Creates a Google form. 2) Sets triggers on that form. 3) Spits out the code to be used on websites on which you have installed Facebook comments social plugin. 4) Once the thus generated code is placed on the blog/site, the admin will get email whenever a facebook comment is made. App: https://script…
function sendCommentEmail (event)
{
var profile_link;
var name_value;
var reply_link;
var page_url;
var page_title;
var time;
var text;
@sujeet
sujeet / blogger-fb-likes-comments.user.js
Last active December 17, 2015 18:28
UserScript for adding Facebook like and comment counts in Blogger Dashboard.
// ==UserScript==
// @name Facebook like and comment counts in Blogger Dashboard
// @author Sujeet Gholap
// @description This userscript adds two columns for Facebook like and comment counts on Blogger dashboard.
// @match http://*.blogger.com/blogger.g*
// @match https://*.blogger.com/blogger.g*
// ==/UserScript==
function main () {
(function() {
@sujeet
sujeet / blogger-fb-likes.user.js
Last active December 17, 2015 18:19
UserScript to add Facebook like count in Blogger Dashboard.
// ==UserScript==
// @name Facebook Likes in Blogger Dashboard
// @author Sujeet Gholap
// @description This userscript adds another column for Facebook likes on Blogger dashboard.
// @match http://*.blogger.com/blogger.g*
// @match https://*.blogger.com/blogger.g*
// ==/UserScript==
function main () {
(function() {
@sujeet
sujeet / blogger-fb-comments.user.js
Last active December 17, 2015 18:19
UserScript for adding Facebook Comment Count in Blogger Dashboard.
// ==UserScript==
// @name Facebook Comment Count in Blogger Dashboard
// @author Sujeet Gholap
// @description This userscript adds another column for Facebook Comment count on Blogger dashboard.
// @match http://*.blogger.com/blogger.g*
// @match https://*.blogger.com/blogger.g*
// ==/UserScript==
function main () {
(function() {
var disqus_url = disqus_blogger_current_url;
(function(){
var get_comment_block = function() {
var block = document.getElementById('comments');
if (!block) {
block = document.getElementById('disqus-blogger-comment-block');
}
return block;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; This is a hacked up version of htmlize.el in which all "htmlize" was ;;
;; replaced by "blog-htmlize" and some minor changes were made in order to ;;
;; get an output with stripped html header and no body tag, as the purpose ;;
;; was to get divs of code snippets ready to be inserted into a blog post. ;;
;; inline style is used so that global css for the blog does not meddle w- ;;
;; -ith the css of the code. ;;
;; ;;
;; New functions have been added which produce the styled div with line ;;