Skip to content

Instantly share code, notes, and snippets.

View yongzhihuang's full-sized avatar
🎯
Focusing

Yongzhi Huang yongzhihuang

🎯
Focusing
View GitHub Profile
@yongzhihuang
yongzhihuang / unfollow.js
Created August 14, 2021 18:14 — forked from JamieMason/unfollow.js.md
Unfollow everyone on twitter.com
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 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
//
// See this tweet by @jacknotlittle for a video showing you how to do it;
// https://twitter.com/jacknotlittle/status/1387471283525459969
//
@yongzhihuang
yongzhihuang / gist:9f2797f6c17ee7ddca585a56afc2d724
Created April 25, 2020 22:34
How to get Puppeteer to run on server side Ubuntu
// Step 1, install dependencies
sudo apt-get install ca-certificates fonts-liberation gconf-service libappindicator1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
// Step 2, if you're running puppeteer as root, you need to start Puppeteer with --no-sandbox argument
const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox'] });
// open up chrome console, paste this in
var lastmsg = '';
setInterval(function() {
var newMessage = document.querySelector('.p-message_pane_message__message--last .p-rich_text_section').textContent;
var author = document.querySelector('.p-message_pane_message__message--last .c-message__sender a').text;
console.log(lastmsg !== newMessage, lastmsg, newMessage);
if (lastmsg !== newMessage) {
var msg = new SpeechSynthesisUtterance(`${author} said ${newMessage}`);
<!DOCTYPE html>
<html lang="en">
<head>
<title>TNY Growler</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<style>
@font-face {
font-family: "Graphik Web";
font-stretch: normal;
<!DOCTYPE html>
<html lang="en">
<head>
<title>TNY Growler</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<style>
@font-face {
font-family: 'Graphik Web';
src: url(data:font/truetype;charset=utf-8;base64,AAEAAAASAQAABAAgRkZUTXSgjpcAAWtUAAAAHEdERUYLLwzpAAD46AAAAE5HUE9Tehn/UgABDPAAAF5iR1NVQjOgzrUAAPk4AAATuE9TLzJmWnMgAAABqAAAAGBjbWFwc7fq5wAAClwAAANOY3Z0IBOEBBQAABFYAAAAVGZwZ213+CCrAAANrAAAAbxnYXNwAAgAEwAA+NwAAAAMZ2x5ZnuwDMsAABXYAADN5GhlYWQBsqv1AAABLAAAADZoaGVhBrsFDAAAAWQAAAAkaG10eGO/V/cAAAIIAAAIVGxvY2Hw7SYGAAARrAAABCxtYXhwBDMBoQAAAYgAAAAgbmFtZV7y2oEAAOO8AAAFinBvc3S/5IoHAADpSAAAD5RwcmVweCNqPQAAD2gAAAHuAAEAAAABAADZa8ZoXw889QAfA+gAAAAAy7yV8AAAAADTP9Ge/xX/HwRuBGMAAAAIAAIAAAAAAAAAAQAAAzX/TQAABJD/Ff8ZBG4AAQAAAAAAAAAAAAAAAAAAAhUAAQAAAhUAZAAHAFwABQABAAAAAAAOAAACAADfAAMAAQADAj4B9AAFAAACvAKKAAAAjAK8AooAAAHdADIA+gAAAgsGAwMCAgYCAwAAAAcAAAAAAAAAAAAAAABDT01NAEAAIPsCAzX/TQAAAzUAsyAAAJMAAAAAAgsCywAAACAADAIAAAAAAAAAAPIAAADyAAABNQBIAZ0ANQIYACICfwAlAyUAHgLQAC
<!DOCTYPE html>
<html lang="en">
<head>
<title>TNY Growler</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<style>
@font-face {
font-family: "Graphik Web";
font-stretch: normal;
<!DOCTYPE html>
<html lang="en">
<head>
<title>TNY Growler</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<style>
@font-face {
font-family: 'Graphik Web';
<!DOCTYPE html>
<html lang="en">
<head>
<title>TNY Growler</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<style>
@font-face {
font-family: "Graphik Web";
font-stretch: normal;
<!DOCTYPE html>
<html lang="en">
<head>
<title>TNY Growler</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<style>
@font-face {
font-family: "Graphik Web";
font-stretch: normal;
<!DOCTYPE html>
<html lang="en">
<head>
<title>TNY Growler</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<style>
@font-face {
font-family: "Graphik Web";
font-stretch: normal;