Skip to content

Instantly share code, notes, and snippets.

Puneeth Chaganti punchagan

Block or report user

Report or block punchagan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@punchagan
punchagan / hello.py
Last active Nov 13, 2019
A simple Flask sockets example
View hello.py
# Copy of http://stackoverflow.com/a/20104705
from flask import Flask, render_template
from flask_sockets import Sockets
app = Flask(__name__)
app.debug = True
sockets = Sockets(app)
@sockets.route('/echo')
@punchagan
punchagan / .gitignore
Last active Oct 17, 2019
Whatsapp Broadcast Export to Zulip
View .gitignore
*.zip
*.jpg
/*.txt
View upai-topscore.py
import requests
import json
# Obtain this from https://upai.usetopscore.com/u/oauth-key
client_id = 'XXX'
client_secret = 'YYY'
data = {
'grant_type': 'client_credentials',
@punchagan
punchagan / scrape_google_groups.py
Last active Jul 2, 2019
A simple script to scrape a google group.
View scrape_google_groups.py
import json
from os.path import exists
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
class GoogleGroupsScraper(object):
""" A simple class to scrape a google group. """
@punchagan
punchagan / nikola-to-hugo.py
Last active Jun 25, 2019
Nikola to Hugo tools
View nikola-to-hugo.py
#!/usr/bin/env python3
""" Script to convert a Nikola blog to Hugo
Requirements:
- toml
Usage:
./nikola-to-hugo.py /path/to/nikola/blog
@punchagan
punchagan / prepare-commit-msg.sh
Last active Apr 23, 2019 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
View prepare-commit-msg.sh
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test release/candidate)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
@punchagan
punchagan / quidditch.clj
Created Mar 30, 2019
Quidditch simulation - ClojureBridge BLR workshop
View quidditch.clj
(ns teaching-clojure.quidditch)
(def game-at-start
{:gryffindor {:score 0
:players 7}
:slytherin {:score 0
:players 7}})
(def opposition {:gryffindor :slytherin
:slytherin :gryffindor})
@punchagan
punchagan / kindle.js
Last active Aug 21, 2018
Readable view & Downloads for Kindle notebook (highlights) page
View kindle.js
// Visit https://read.amazon.com/notebook
(function(){
var highlights_markdown = function(){
var markdown = "";
for (var i=0; i < highlights.length; i++){
markdown += "> " + highlights[i] + "\n\n";
var note = notes[i];
if (note !== "") {
markdown += note + "\n\n";
}
@punchagan
punchagan / gh-ipynb.user.js
Last active Oct 8, 2017
GitHub IPynb rendering
View gh-ipynb.user.js
// ==UserScript==
// @name GitHub IPynb rendering
// @namespace ghipynb
// @version 0.3.1
// @description Renders raw IPython notebooks on GitHub using nbviewer and Frames!
// @license WTFPL
// @match *://*.github.com/*
// @match *://github.com/*
// @match *://gist.github.com/*
// @grant none
View search_github_users.py
""" A simple script to search for GitHub users. """
from __future__ import print_function
import json
from os.path import abspath, dirname, exists, join
import requests
from requests.utils import quote
You can’t perform that action at this time.