Skip to content

Instantly share code, notes, and snippets.

View tushalien's full-sized avatar
🤔

Tushar Agrawal tushalien

🤔
View GitHub Profile
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
#!/bin/sh
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
import pyqrcode
from qrtools import qrtools
import uuid
from qrcode import QRCode
from mimetypes import types_map
from io import BytesIO
# """These methods can be used in a flask setup to create a cacheable response."""
def convert_srt(raw_text):
h = HTMLParser.HTMLParser()
cnt=0
flag=0
s = raw_text.split("text")
str_name = "k.srt"
srt_string = ""
for i in s:
def fetch_srt(song_name,video_id):
#preparing the first parameter
res = 'A'.join(str(ord(c)+13) for c in video_id)
res = res+"A"
#fake request to get the current cookie
opener = urllib2.build_opener()
session = requests.session()
url="https://extension.musixmatch.com"
@tushalien
tushalien / final4-js
Created November 8, 2015 11:51 — forked from jeffyuhaoliu/final4-js
MongoDB & Node.js Final 4 - Enhancing the Blog to support viewers liking certain comments In this problem, you will be enhancing the blog project to support users liking certain comments and the like counts showing up the in the permalink page. Start by downloading the code in Final4.zip and loading up the blog dataset posts.json. The user inter…
/* The PostsDAO must be constructed with a connected database object */
function PostsDAO(db) {
"use strict";
/* If this constructor is called without the "new" operator, "this" points
* to the global object. Log a warning and call it correctly. */
if (false === (this instanceof PostsDAO)) {
console.log('Warning: PostsDAO constructor called without "new" operator');
return new PostsDAO(db);
}