Skip to content

Instantly share code, notes, and snippets.

@hivefans
hivefans / LICENSE.txt
Created April 17, 2023 00:31 — forked from yckart/LICENSE.txt
getElementByXPath | Get DOM-Nodes by its XPath.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 Yannick Albert <http://yckart.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@hivefans
hivefans / BitAPI.py
Created April 13, 2023 02:56
python对接比特
"""
@Author: 小样
@Date: 2022-10-30
@UpdateDate: 2022-12-20
@wechat: mz-cyx
@description: 比特浏览器API接口
@version: 1.0
@AD: 专业定制外网自动化程序,Twitter、Facebook、Tiktok、Instagram、Google等等自动化工具;
所有本人定制软件均使用自改undetected_chromedriver,可过nowsecure.nl
@hivefans
hivefans / .Cloud.md
Created July 10, 2022 04:41 — forked from imba-tjd/.Cloud.md
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@hivefans
hivefans / get_oauth2_token.py
Created December 21, 2021 05:44 — forked from clarketm/get_oauth2_token.py
How to get Google OAuth 2.0 access token in console using the Python API
#!/usr/bin/env python
'''
This script will attempt to open your webbrowser,
perform OAuth 2.0 authentication and print your access token.
To install dependencies from PyPI:
$ pip install oauth2client
Then run this script:
@hivefans
hivefans / mysql_cheat_sheet.md
Created November 12, 2020 07:05 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

%angular
<!-- Include Date Range Picker -->
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css" />
@hivefans
hivefans / SimpleHTTPServerWithUpload.py
Created August 27, 2020 01:05 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@hivefans
hivefans / demo.py
Last active March 17, 2020 02:03 — forked from martinburch/demo.py
Python MySQL upsert|-|{"files":{"requirements.txt":{"env":"plain"},"upsert.py":{"env":"plain"},"demo.py":{"env":"plain"}},"tag":"Uncategorized"}
#!/usr/bin/env python
# encoding: utf-8
import MySQLdb
from upsert import upsert
db = MySQLdb.connect(host="localhost", user="root", passwd="", db="demo", charset="utf8")
c = db.cursor()
import warnings
warnings.filterwarnings("ignore", "Unknown table.*")
@hivefans
hivefans / Spark Dataframe Cheat Sheet.py
Last active October 22, 2020 10:27 — forked from crawles/Spark Dataframe Cheat Sheet.py
Cheat sheet for Spark Dataframes (using Python)|-|{"files":{"Spark Dataframe Cheat Sheet.py":{"env":"plain"}},"tag":"bigdata"}
# A simple cheat sheet of Spark Dataframe syntax
# Current for Spark 1.6.1
# import statements
from pyspark.sql import SQLContext
from pyspark.sql.types import *
from pyspark.sql.functions import *
#creating dataframes
df = sqlContext.createDataFrame([(1, 4), (2, 5), (3, 6)], ["A", "B"]) # from manual data
@hivefans
hivefans / upsert_table.sql
Last active March 17, 2020 02:03 — forked from bembengarifin/upsert_table.sql
mysql bulk insert, with duplicate key update (upsert), and with conditional data update|-|{"files":{"upsert_table.sql":{"env":"plain"}},"tag":"bigdata"}
/*
references:
- https://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html
- https://stackoverflow.com/questions/32777081/bulk-insert-and-update-in-mysql
- https://thewebfellas.com/blog/conditional-duplicate-key-updates-with-mysql
*/
/* create a new database and use it */
drop database if exists test_upsert;
create database test_upsert;