Skip to content

Instantly share code, notes, and snippets.

View siayi's full-sized avatar
💭
I may be slow to respond.

Ayi Sumarna siayi

💭
I may be slow to respond.
View GitHub Profile
@siayi
siayi / get-all-class-id-css-file.md
Last active October 28, 2021 06:53
Getting the names of all classes / ids contained within a css file
  1. Include your css file into any html file.
  2. In console execute the following code:

Array.prototype.forEach.call(document.styleSheets[0].cssRules,function(a){console.log(a.selectorText)})

  1. In the console will be the listing of all css tags used in your stylesheet.
/**
* Google Maps Tile Carver for Photoshop
*
* @description Tiles a photoshop image to create a Custom Map Type for Google Maps API, tested with CS4 and CS5
* @since 2010-09-01
* @author Will James, http://onNYTurf.com (creator)
* @author Curtis Wyatt, http://gocalipso.com/
* @author Nate Bundy, http://www.lemonrage.com/
* @author Uli Schöberl, http://aplusplus.org
*/
import json
import random
import time
import logging
import requests
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
# https://github.com/SeleniumHQ/selenium/blob/trunk/py/selenium/webdriver/support/relative_locator.py
# https://github.com/SeleniumHQ/selenium/blob/4c5b92bac07b17e223917c31caddf7035c120ea7/py/selenium/webdriver/remote/webdriver.py
from selenium import webdriver
import sys
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from time import sleep
import urllib3
import warnings
from selenium.webdriver.support.relative_locator import with_tag_name
@siayi
siayi / AbstractBasePage.py
Created October 28, 2021 05:44 — forked from Asad-Khan-Aasanjobs/AbstractBasePage.py
Get element logic for selenium script
"""
__________________________________________________
Base Page that provides basic page functionality
Positional arguments:
Selenium webdriver instance.
__________________________________________________
"""
from bs4 import BeautifulSoup
from random import randint
# Copyright (c) 2021. THIS SOURCE CODE BELONGS TO WB&C/SMARTEEZ INC. ANY OUTSIDER REPLICATION OF IT IS LEGALLY PERSECUTED.
# _______ ________ ________ _______ ________ ________
# |\ ___ \ |\ ___ \|\ ___ \|\ ___ \ |\ ____\|\ __ \
# \ \ __/|\ \ \\ \ \ \ \_|\ \ \ __/|\ \ \___|\ \ \|\ \
# \ \ \_|/_\ \ \\ \ \ \ \ \\ \ \ \_|/_\ \_____ \ \ __ \
# \ \ \_|\ \ \ \\ \ \ \ \_\\ \ \ \_|\ \|____|\ \ \ \ \ \
# \ \_______\ \__\\ \__\ \_______\ \_______\____\_\ \ \__\ \__\
# \|_______|\|__| \|__|\|_______|\|_______|\_________\|__|\|__|
# \|_________|
#
@siayi
siayi / getSongFromYoutube.py
Created October 28, 2021 05:38 — forked from beantowel/getSongFromYoutube.py
script for downloading MTG-QBH dataset collection
import os
import click
import re
import csv
import numpy as np
from selenium import webdriver
from bs4 import BeautifulSoup
from urllib.parse import quote_plus
YOUTUBE_QUERY = 'https://www.youtube.com/results?search_query='
@siayi
siayi / wordpress_export_to_json.php
Created October 27, 2021 18:41 — forked from jsnelders/wordpress_export_to_json.php
Export all core WordPress data (posts, pages, attachments, comments, tags, categories and users) to a JSON formatted file.
<?php
/**
* Plugin Name: WordPress Export to JSON
* Plugin URI: https://jsnelders.com/
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file.
* Author: Jason Snelders
* Author URI: http://jsnelders.com
* Version: 2020-01-30.1
**/
@siayi
siayi / wordpress_export-post-data.php
Created October 27, 2021 18:40 — forked from robinnorth/wordpress_export-post-data.php
WordPress: Simple, configurable script to export post data to a CSV file
<?php
/**
* Export WordPress post data to CSV
* Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/>
*/
/**
*********************************************************************
* Configuration
*********************************************************************
@siayi
siayi / wordpress_export-post-data.php
Created October 27, 2021 18:40 — forked from robinnorth/wordpress_export-post-data.php
WordPress: Simple, configurable script to export post data to a CSV file
<?php
/**
* Export WordPress post data to CSV
* Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/>
*/
/**
*********************************************************************
* Configuration
*********************************************************************