This file contains hidden or 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 contextlib | |
import threading | |
from typing import Generator | |
# Author : github.com/Eboubaker | |
# Fixed by: github.com/icezyclon | |
class ReentrantRWLock: | |
"""This class implements reentrant read-write lock objects. | |
A read-write lock can be aquired in read mode or in write mode or both. | |
Many different readers are allowed while no thread holds the write lock. |
This file contains hidden or 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 re | |
import fitz | |
def validate_resume(filename): | |
# Open the PDF file and read its contents | |
with fitz.open(filename) as pdf: | |
resume_text = '' | |
for page in pdf: | |
resume_text += page.get_text() | |
# Check for certain keywords or phrases in the resume text |
This file contains hidden or 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
//js | |
$('.j-spoiler').each(function(){ | |
new Spoiler(this); | |
}); | |
Spoiler = function(container) { | |
this.container = $(container); | |
this.head = this.container.find('.j-spoiler-head'); | |
this.body = this.container.find('.j-spoiler-body'); | |
this.close = this.container.find('.j-spoiler-close'); | |
this.init(); |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" rwlock.py | |
A class to implement read-write locks on top of the standard threading | |
library. | |
This is implemented with two mutexes (threading.Lock instances) as per this | |
wikipedia pseudocode: | |
https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Using_two_mutexes |
This file contains hidden or 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
// Instead of unrendered content (Ctrl+U, Ctrl+A, Ctrl+C) | |
// See also https://gist.github.com/telecran-telecrit/4a392087d5cc241404c83bb32009a25f (imageToUri) | |
/////////////////////////////////////////////////////////////////// | |
function isScriptExternal (scriptElement, oldSrc) { | |
if (!oldSrc) { | |
oldSrc = scriptElement.src; | |
} | |
return (!!oldSrc && (oldSrc[0] != '#' || oldSrc.startsWith('#external/'))); | |
} |
This file contains hidden or 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
function imageToUri (url, callback) { | |
const canvas = document.createElement('canvas'); | |
const ctx = canvas.getContext('2d'); | |
var base_image = new Image(); | |
base_image.crossOrigin="anonymous"; | |
base_image.src = url; | |
base_image.onload = function() { | |
canvas.width = base_image.width; | |
canvas.height = base_image.height; | |
ctx.drawImage(base_image, 0, 0); |
This file contains hidden or 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
pip2 install numpy==1.15.0 pypng==0.0.20 pyparsing==1.5.6 cycler==0.10.0 lxml==3.2.3 matplotlib==1.5.1 pandas==0.23.1 SciPy==1.8.1 Seaborn # pip3 install numpy pypng pyparsing cycler lxml matplotlib matplotlib==3.2.2 pandas SciPy==1.8.1 Seaborn |