This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <utility> | |
#include <tuple> | |
#include <vector> | |
#include <deque> | |
#include <type_traits> | |
using std::cout; | |
using std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function *range(x, y) { | |
for (let i = x; i <= y; i++) | |
yield i; | |
} | |
function *map(generator, f) { | |
for (let x of generator) { | |
yield f(x); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].reduce.call(document.body.querySelectorAll(".wht_total"), (acc, x) => {let yyy = x.textContent.trim().replace(/[¥\s资金总计]/g,''); console.log(yyy); return acc + parseFloat(yyy||0)}, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tokenize(program) { | |
// this function can help you tokenize program | |
// you can use this function in attempt | |
const regex = /\s*(->|[-+*/\(\)\[\]\{\};,]|[A-Za-z]+|[0-9]+)\s*/g; | |
return program.replace(regex, ":$1").substring(1).split(':'); | |
}; | |
let parser; | |
let isNumeric = n => !isNaN(parseFloat(n)) && isFinite(n); | |
let isChar = char => char.length === 1 && char.match(/[a-z]/i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In https://store.steampowered.com/cart/ | |
// Get array | |
Array.from(document.getElementsByClassName("cart_item_desc")).map(x=>x.innerText); | |
// Get title text | |
Array.from(document.getElementsByClassName("cart_item_desc")).map(x=>x.innerText).join(""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 0. Press F12, open network panel, select img filter | |
// 1. Open media page in Twitter(https://twitter.com/user_name/media) | |
// 2. Hold page down to get a loooots of images, you can see that in network panel | |
// 3. Right click a filename and select 'Copy=>Copy all as HAR' | |
// 4. Using JavaScript to extract image URLs. | |
let har = [ /*paste*/ ]; | |
function getURL(harsObj, mimeArray) { | |
let results = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(document.getElementById("editor").getElementsByTagName("div")).map(x=>x.innerText).join("\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// Copy and paste [base] part into F12-Console at your Steam wishlist page(https://store.steampowered.com/wishlist/id/username) | |
// Copy and paste [price] part into F12-Console to show your wishlist total price | |
// Copy and paste [names] part into F12-Console to show your wishlist game names | |
// ======================= [BASE] ============================ | |
let items = this.top.g_Wishlist.rgElements; | |
let appIds = Object.keys(items); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://android.stackexchange.com/questions/56635/how-can-i-export-the-list-of-open-chrome-tabs | |
tabs = Array.from(document.querySelectorAll('div /deep/ div /deep/ div /deep/ div /deep/ div /deep/ .device-page-list .vbox'), s => ({name: s.querySelector('.device-page-title').textContent, url: s.querySelector('.device-page-url .devtools-link').href})) | |
str = ''; | |
for (i=0;i<tabs.length;i++){ | |
str += '['+tabs[i]['name']+']('+tabs[i]['url']+')\n' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use this in PC-Chrome history page (ctrl+H) | |
var itemList = Array.from(document. | |
getElementById('history-app').shadowRoot.getElementById('synced-devices').shadowRoot. | |
getElementById('synced-device-list').getElementsByTagName('history-synced-device-card')). | |
map(x=>x.shadowRoot.getElementById('tab-item-list')).map(x=>x.getElementsByClassName('website-link')); | |
// if you want to backup only one device, enter a index number here (start from 0) | |
// I suggest you use extension OneTab to manage tabs, so I export OneTab's url format | |
// <url> | <title> |
OlderNewer