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
# Python 3 | |
# XKCDDownloader.py | |
######################################################################################################################## | |
# Algorithm | |
# 1) Open the latest page of XKCD | |
# 2) Download the image, title and alternate text from the page and save the images in specified folder | |
# 3) Build a html file which contains the alt, title and src in a html file | |
# 4) If any error in download skip the page | |
# 5) Find the previous page url from current page and repeat steps 2, 3 & 4 | |
# 6) Continue until you find the very 1st comic |
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
var inviter = {} || inviter; | |
inviter.userList = []; | |
inviter.className = 'button-secondary-small'; | |
inviter.refresh = function () { | |
window.scrollTo(0, document.body.scrollHeight); | |
window.scrollTo(document.body.scrollHeight, 0); | |
window.scrollTo(0, document.body.scrollHeight); | |
}; |
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
#!/usr/bin/env python3 | |
from PyQt5 import QtWidgets | |
from PyQt5.QtWidgets import QAction | |
from PyQt5.QtGui import QIcon, QKeySequence | |
class MainWindow(QtWidgets.QMainWindow): | |
def __init__(self, *args, **kwargs): |
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 requests | |
from bs4 import BeautifulSoup | |
search_url_prefix = "https://www.google.com/search?q=" | |
def get_first_result(search_str): | |
search_url = search_url_prefix + search_str | |
r = requests.get(search_url) | |
soup = BeautifulSoup(r.text, "html.parser") | |
return soup.find('cite').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
// BEFORE YOU start | |
// npm init -y | |
// npm install --save node-fetch | |
const fetch = require('node-fetch'); | |
// INTRO | |
// Javascript is single threaded, meaning that two bits of script cannot run at the same time. | |
// Doing something which takes some time (a costly algorithm, a back-end call) causes everything else to halt | |
// until it completes. In browsers, this often means the UI becomes non-responsive, | |
// because the rendering of the screen is blocked. |
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
<?php header( 'Content-type: text/xml' ) ?> | |
<?php echo '<?xml version="1.0"?>' ?> | |
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"> | |
<channel> | |
<title><?php echo bloginfo( 'name' ) ?></title> | |
<link><?php echo home_url() ?></link> | |
<description><?php echo bloginfo( 'description' ) ?></description> | |
<?php | |
$query = new WP_Query( array( |
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
/* To use this example: | |
1. Download this html file | |
2. Replace the form action url with your own from the MailChimp supplied embed code | |
3. Within the action url, replace "subscribe/post" with "subscribe/post-json" | |
4. Be sure the action url starts with http://. If it doesn't, the form will hang when testing the html as a local file in your browser. | |
5. Open this file in a browser on your local machine | |
*/ | |
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
# Usage: ./dns_check.py <list_of_domain_names.txt> | |
import dns.resolver | |
import requests | |
import re | |
import json | |
import sys | |
resolver = dns.resolver.Resolver() | |
resolver.timeout = 5 | |
resolver.lifetime = 5 |
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 os | |
import sys | |
import csv | |
import re | |
import logging | |
import argparse | |
import datetime | |
col_li = ['filename', 'line_number', 'host', 'pid', 'comp', 'id', 'time', 'ms', 'category', 'level', 'logger', 'message'] |
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 random | |
"""Module that handles the like features""" | |
from math import ceil | |
from re import findall | |
from selenium.webdriver.common.keys import Keys | |
from selenium.common.exceptions import WebDriverException | |
from .time_util import sleep |