Skip to content

Instantly share code, notes, and snippets.

View rvvvt's full-sized avatar
💭
hail, traveler.

rvvvt rvvvt

💭
hail, traveler.
View GitHub Profile
@vinovator
vinovator / XKCDDownloader.py
Last active June 10, 2018 06:19
Download all XKCD comics - incomplete
# 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
@maksii
maksii / linkedin auto-inviter
Last active December 19, 2020 16:54
Script to automatically add connections from "People You May Know" page
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);
};
@Kf4btg
Kf4btg / pyqt5_app_template.py
Last active February 10, 2019 04:42
Decent starting point for pretty much any simple PyQt5 application
#!/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):
@yxlao
yxlao / google_search_bs.py
Last active January 18, 2019 15:54
Google search with BeautifulSoup
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
@jberndsen
jberndsen / promise.js
Last active August 7, 2019 04:56
exercises to learn promises
// 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.
@marcosnakamine
marcosnakamine / index.php
Created March 22, 2017 20:44
WooCommerce - Google Merchant xml feed generator
<?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(
@DmitriyRF
DmitriyRF / change.js
Last active July 22, 2024 18:24
Remove or don't redirect “thank you” page Mailchimp
/* 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
*/
# 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
@dixsonhuie
dixsonhuie / app-log.py
Last active November 7, 2024 20:06
python examples
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']
@uluQulu
uluQulu / like_util.py
Last active February 5, 2019 00:11
Like util for fellowes
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