Skip to content

Instantly share code, notes, and snippets.

View shouldsee's full-sized avatar
👀

shouldsee

👀
View GitHub Profile
@lorey
lorey / selenium_xhr_requests_via_performance_logging.py
Last active August 4, 2025 16:16
Access Chrome's network tab (e.g. XHR requests) with Selenium
#
# This small example shows you how to access JS-based requests via Selenium
# Like this, one can access raw data for scraping,
# for example on many JS-intensive/React-based websites
#
from time import sleep
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
@glowinthedark
glowinthedark / generate_directory_index.py
Last active February 7, 2022 11:00
Generate directory index (Python 2) Python 3 version is here: https://gist.github.com/glowinthedark/174df43f469c7ef05f6358f53afe05c6
#!/usr/bin/env python
# requires Python 2
# (Python 3 version: https://gist.github.com/glowinthedark/174df43f469c7ef05f6358f53afe05c6)
# Recursively generate index.html files for
# all subdirectories in a directory tree
##########################################################################
## ❗️❗️❗️ WARNING: This version is outdated and unmaintained!
@idreamsi
idreamsi / ESP8266-SoftAP-WebServer.ino
Created February 7, 2019 07:46
ESP8266 example: Wi-Fi Access point, static IP, web-server and remote GPIO control
/* Create a WiFi access point and provide a web server on it. */
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
IPAddress apIP(42, 42, 42, 42); // Defining a static IP address: local & gateway
// Default IP in AP mode is 192.168.4.1
/* This are the WiFi access point settings. Update them to your likin */
const char *ssid = "ESP8266";
@islishude
islishude / k8s-install.md
Last active October 16, 2025 07:07
k8s-国内源安装

MOVE TO HERE

注意以下命令,需要切换到 root 后运行

安装 docker

首先确定已经安装完成 docker,如果没有安装可以使用以下脚本快速安装并配置:

@krassowski
krassowski / ucsc_download.sh
Last active April 2, 2022 05:37
UCSC table download
# The script is intended to demonstrate how to fetch data from UCSC easily
# (without mysql) in a way which will enable reproducibility of the download.
# It is NOT INTENDED as a generic tool for programmatic access to UCSC;
# Please respect UCSC request of avoiding issuing heavy queries as described in mysql usage manual;
# for more information on conditions of use, see: http://genome.ucsc.edu/goldenPath/help/mysql.html
# For advanced programmatic access you may be interested in setting you own local copy of UCSC database
# and using other, existing tools like: PyUCSC (see: https://pyucsc.readthedocs.io/en/latest)
@superjax
superjax / Makefile
Last active July 20, 2025 15:23
Makefile Template for compiling C/C++ for use with STM32 Microcontrollers
# Copyright (c) 2016, James Jackson
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@skokenes
skokenes / d3-lasso.min.js
Last active November 5, 2020 07:44
d3.lasso example - scatterplot
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-drag")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-drag"],n):n(t.d3=t.d3||{},t.d3,t.d3)}(this,function(t,n,r){"use strict";function e(t,n){return n={exports:{}},t(n,n.exports),n.exports}function o(){function t(t){function u(){p=[],h="",_.attr("d",null),m.attr("d",null),r.nodes().forEach(function(t){t.__lasso.possible=!1,t.__lasso.selected=!1,t.__lasso.hoverSelect=!1,t.__lasso.loopSelect=!1;var n=t.getBoundingClientRect();t.__lasso.lassoPoint=[Math.round(n.left+n.width/2),Math.round(n.top+n.height/2)]}),s&&r.on("mouseover.lasso",function(){this.__lasso.hoverSelect=!0}),i.start()}function l(){var t,n;"touchmove"===d3.event.sourceEvent.type?(t=d3.event.sourceEvent.touches[0].clientX,n=d3.event.sourceEvent.touches[0].clientY):(t=d3.event.sourceEvent.clientX,n=d3.event.sourceEvent.clientY);var s=d3.mouse(this)[0],u=d3.mouse(this)[1];""===h?(h=h+"M "+s+" "+u,v=[t,n],d=[s,
@wdullaer
wdullaer / install.sh
Last active October 4, 2025 11:31
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@non117
non117 / inotify_daemon.py
Created December 18, 2013 03:12
python inotify daemon
import multiprocessing
import os
import time
from functools import partial
import pyinotify
def is_alive(pid):
try:
os.kill(pid, 0)
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}