This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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); | |
} |