Skip to content

Instantly share code, notes, and snippets.

@vbuterin2
vbuterin2 / xpath_soup.py
Created June 12, 2021 07:01 — forked from ergoithz/xpath_soup.py
Generate unique XPATH for BeautifulSoup element
#!/usr/bin/python
# -*- coding: utf-8 -*-
def xpath_soup(element):
# type: (typing.Union[bs4.element.Tag, bs4.element.NavigableString]) -> str
"""
Generate xpath from BeautifulSoup4 element.
:param element: BeautifulSoup4 element.
:type element: bs4.element.Tag or bs4.element.NavigableString
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active May 3, 2024 11:24
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active May 4, 2024 13:39 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@SpeedMe
SpeedMe / tcp_speed.sh
Created January 20, 2018 06:42
tcp_speed
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================
# System Required: CentOS 6+,Debian7+,Ubuntu12+
# Description: BBR+BBR魔改版+Lotserver
# Version: 1.0.6
# Author: 千影
# Blog: https://www.94ish.me/
@tinkerware
tinkerware / macos-jdk-install.md
Last active October 19, 2023 08:22
Maintaining Java Installs on macOS Using Homebrew Cask

Maintaining Java Installs on macOS Using Homebrew Cask

Recently, I upgraded my MacBook Pro from a old, trusty Yosemite to Sierra, and reluctantly had to clean out the old JDK versions I had accumulated over a few years. I also wanted to have a Java 9 JDK to play around with the new module system and API’s.

Good news is that, for a while now, you have been able to install and upgrade multiple versions of JDK using only your shell, without having to deal with Oracle’s graphical installers.

To install Java from scratch, install Homebrew Cask cask-update (you need to have Homebrew already installed) first, then install Java using Cask:

brew tap buo/cask-upgrade & brew tap caskroom/versions
brew cask install java8
@joseluisq
joseluisq / README.md
Last active March 7, 2024 05:43
Install PHP 7 Xdebug in Arch Linux

Install PHP 7 Xdebug in Arch Linux

"Normally", these instructions should be also valid (in similar way) for other Linux distros.

1.- Install Xdebug using pacman:

sudo pacman -Sy xdebug
@SilverBut
SilverBut / haproxy.cfg
Last active May 19, 2023 20:45
[Haproxy cfg checking Socks5] Haproxy cfg to check the Socks5 connection #tags: GFW, network, haproxy, config
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
@ergoithz
ergoithz / xpath_soup.py
Last active March 18, 2024 16:11
Generate unique XPATH for BeautifulSoup element
#!/usr/bin/python
# -*- coding: utf-8 -*-
import bs4
def xpath_soup(element):
# type: (typing.Union[bs4.element.Tag, bs4.element.NavigableString]) -> str
"""
Generate xpath from BeautifulSoup4 element.
@JamieMason
JamieMason / unfollow.js.md
Last active April 26, 2024 19:31
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//

How not to rm yourself

Copied from https://github.com/sindresorhus/guides/blob/master/how-not-to-rm-yourself.md

The rm command is inherently dangerous and should not be used directly. It can at worst let you accidentally remove everything. Here's how you can protect you from yourself.

Use trash

The trash command-line tool will move stuff to the trash instead of permanently deleting it. You should not alias rm to trash as it will break external scripts relaying on the behavior of rm. Instead use it directly: trash image.jpg.