Skip to content

Instantly share code, notes, and snippets.

View mingtsay's full-sized avatar
🇹🇼

Ming Tsay mingtsay

🇹🇼
View GitHub Profile
@mingtsay
mingtsay / boorkmarklet.md
Last active June 7, 2022 06:40 — forked from 71/boorkmarklet.md
Lists all participants in a Google Meet meeting.

The following bookmarket shows a popup with the name of the participants separated by comma(,) .

javascript:((n=2e3)=>{try{function h(a,b=0){if(b>7||"object"!=typeof a||null===a||a===window)return;let c=Object.getOwnPropertyDescriptors(a);for(let d in c){if(d.startsWith('["spaces/'))return Object.values(a);let e=h(c[d].value,b+1);if(void 0!==e)return e}}let i=Object.entries(window).find(a=>a[0].startsWith("closure_lm_"))[1],e=h(i),a=[];function j(b){for(let c in b){let a=b[c];if("object"==typeof a&&null!==a&&"string"==typeof a[1])return a[1]}}for(let c=0;c<e.length;c++){let f=j(e[c]);-1===a.indexOf(f)&&a.push(f)}if(0===a.length)throw new Error("Could not find any name.");a.sort((a,b)=>a.localeCompare(b));let g=a.slice(1).reduce((a,b)=>(a[0].length+b.length+1>=n?a.unshift(b):a[0]+=", "+b,a),[a[0]]).reverse();for(let b=0,{length:d}=g;b<d;b++){let k=1===d?"":" ("+(b+1)+"/"+d+")",l="Please find the list of participants below"+k+".";if(null===prompt(l,g[b]))break}}catch(m){alert("Unexpected error when runni
@mingtsay
mingtsay / npm_chpwd_hook.sh
Created November 9, 2020 02:09 — forked from nunofgs/npm_chpwd_hook.sh
Adds node_modules/.bin to the PATH (zsh)
if ((!$+commands[npm])); then
return 1
fi
# Adds node_modules/.bin to the PATH
npm_bin_hook() {
if [ -n "${OLDPATH+x}" ]; then
PATH=$OLDPATH
unset OLDPATH
fi
<?php
$conn = new PDO("mysql:host=127.0.0.1;dbname=rfid;", "root", "");
$cursor = $conn->prepare("select * from :table ;");
//$cursor->execute(array(":table"=>"contrast"));
$cursor->bindValue(":table", "contrast");
$cursor->execute();
var_dump($cursor->fetch());
// var_dump($cursor);
@mingtsay
mingtsay / oppose_cheat.js
Last active August 29, 2015 13:58 — forked from anonymous/oppose_cheat.js
Cheat script for www.oppose.tw
(function() {
$btnYes = $('.btn-yes')[0];
$btnNo = $('.btn-no' )[0];
$content = $('.show-content')[0];
function cheat() {
if (l = $content.innerHTML.length) {
l % 2 ? $btnNo.click() : $btnYes.click();
}
setTimeout(cheat);
<html>
<center>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>註冊 - 網址方盒 - 為縮短網址而誕生的網站!!</title>
<script src="/js/jquery.js" type="text/javascript"></script>
<script src="/js/jquery.validate.js" type="text/javascript"></script>
<script src="/js/cmxforms.js" type="text/javascript"></script>
<script src="/js/load.js" type="text/javascript"></script>
<link rel="shortcut icon" href="/favicon.ico">