Skip to content

Instantly share code, notes, and snippets.

View lljxx1's full-sized avatar
🙂

fun lljxx1

🙂
View GitHub Profile
@lljxx1
lljxx1 / convert-to-typeorm-migration.js
Last active October 19, 2023 07:15
Convert node-pg-migrate migrations file to TypeORM style migration
const fs = require("fs");
const camelcase = require("camelcase");
const baseDir = "src/migrations";
const outputDir = "src/migration";
const allFiles = fs.readdirSync(baseDir);
for (let index = 0; index < allFiles.length; index++) {
const filename = allFiles[index];
const [timestamp, migrationFileName] = filename.split("_");
@lljxx1
lljxx1 / weibo_backup.js
Last active May 15, 2022 17:11
炸号微博备份,F12打开浏览器控制台,执行代码
// ==UserScript==
// @name 微博备份
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 炸号微博备份
// @author fun
// @match https://weibo.com
// @icon https://www.google.com/s2/favicons?sz=64&domain=weibo.com
// @grant none
// ==/UserScript==
const ethers = require("ethers");
const readline = require("readline");
const fs = require("fs");
const { Multicall } = require("ethereum-multicall");
let provider = new ethers.providers.StaticJsonRpcProvider(
"https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
);
const multicall = new Multicall({
@lljxx1
lljxx1 / tranform-rem-width-ratio.js
Last active January 20, 2021 06:06
根据font size比率,批量转换css中的rem单位
var css = require('css');
var fs = require('fs');
var sourceFile = 'style.css';
var content = fs.readFileSync('./' + sourceFile, 'utf-8');
var obj = css.parse(content);
var rawFontSize = 50;
var toFontSize = 20;
@lljxx1
lljxx1 / collect.js
Created October 15, 2020 00:49
last.fm love
;(async () => {
for (let index = 0; index < temp1.length; index++) {
const line = temp1[index];
try {
await fetch("https://www.last.fm/user/fun00/loved", {
headers: {
accept: "*/*",
"accept-language": "zh-CN,zh;q=0.9,en-IN;q=0.8,en;q=0.7,ar;q=0.6",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
@lljxx1
lljxx1 / xiami.js
Last active September 25, 2020 09:12
虾米音乐收藏歌单导出
var uid = _xiamiuser.split('"')[0];
if(!uid) alert('uid');
localStorage.clear();
var iframe = document.createElement('iframe');
iframe.src="https://emumo.xiami.com/space/lib-song/u/"+uid;
document.body.appendChild(iframe);
iframe.onload = function(){
console.log("loaded")
getSongs();
const typeReturn = {
498: 80,
320: 60,
245: 40
}
// var Combinatorics = require('js-combinatorics');
// Combinatorics.permutation([498, 320, 245]).toArray();
const allChoices = [
[{"title":"西安国际医学中心医院接受捐赠有关事宜的公告","desc":"现对医院接受捐赠事宜公告如下:一、成立接受捐赠小组成立以医院财务总监为组长,财务部、医工部、运维部负责人为组员的接受捐...","account":"西安国际医学中心医院","thumb":"//img01.sogoucdn.com/net/a/04/link?appid=100520033&url=http://mmbiz.qpic.cn/mmbiz_jpg/0jaBrz3b1xZLO3kvatmmsqoGu0GHkJXZ50H8VJNUqDYDzk4KUG4bLFaJJ0OaHicq1gVqnzmXrEIwqRHcNVYBU1A/0?wx_fmt=jpeg","accountLink":"/link?url=dn9a_-gY295K0Rci_xozVXfdMkSQTLW6EzDJysI4ql5MPrOUp16838dGRMI7NnPqkZ2SsKZJElZsvg4Skk4qHgwvDqyjOWdzRJr6A7b1a6bAOIlk6GNt3keVrk5sOg7qvrXukGA7nAfz_r0XCWQr4guNAUkRAcCAW2fm5vBgrFqre9sGwF0Xtnd-pHBgN2vn3WDvIDtHLatfhR-kBw66O24OZCnxixtX&type=2&query=%E5%8C%BB%E9%99%A2 %E6%8E%A5%E5%8F%97%E6%8D%90%E8%B5%A0 %E5%85%AC%E5%91%8A&token=A7FA787252FDCF65474DD59E89263509480D37185E3AF36B","link":"/link?url=dn9a_-gY295K0Rci_xozVXfdMkSQTLW6cwJThYulHEtVjXrGTiVgSwds5vkaZ8yyO6qJpMeVtW86ec7YOa5eZFqXa8Fplpd9968GSMlyJs8jS1PTXEc296pQUT1-WDSW6Ne8S1YKFO9MbzPx_JNPVbDt1kjkK7UMIMRFwx62I1rIpq36vG8wLsDoa-6JelujO4UTRV0-TaGu-sc53vtTHC_6eABCas8Bmur_z-OABXvuUcSZ-CdsQFLMR-ptHfUnVG61OU9LdxZQL0Hr9Gyd3Q..&type