Skip to content

Instantly share code, notes, and snippets.

View tvytlx's full-sized avatar
👾
#positive

Xiao Tan tvytlx

👾
#positive
View GitHub Profile
@tvytlx
tvytlx / README.md
Created April 20, 2019 11:05
SCRIPT-8
@tvytlx
tvytlx / README.md
Last active February 2, 2019 07:02
SCRIPT-8
@tvytlx
tvytlx / clone.js
Last active December 9, 2017 04:43
Simple Way To Clone All Your Personal Github Repositories
// First, open your github profile, then jump to repositories page.
// Second, copy this line to your browser's console.
r=[];$x('//a[@itemprop="name codeRepository"]/@href').forEach((x)=>{r.push(`git clone git@github.com:${x.value.slice(1)}.git`)});r.join('&&');
// Third, copy the output which contains all the clone sentences to your terminal, then enter.
@tvytlx
tvytlx / mi-notes.py
Created December 1, 2017 13:50
把mi-note-export.js导出的data.json文件转换成能导入到mac便签的文件夹
#!/usr/bin/python
#-*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import sys
import json
import os
import shutil
import re
import subprocess
import platform
@tvytlx
tvytlx / gist:6cb7b3974731841e8f1ac1246fd6fb75
Last active November 12, 2017 04:58
【转】oh my zsh git plugin

The git Plugin

The git plugin provides many aliases and a few useful functions.

Enable it by adding git to the plugins array before sourcing OMZ (see [[Plugins]]).

Aliases

Alias Command
@tvytlx
tvytlx / gist:a78d7f8efe3d5212fc818e68549bcfed
Created November 5, 2017 09:12
长城宽带下面貌似只有163的源能有一个正常的速度。。。
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

Keybase proof

I hereby claim:

  • I am tvytlx on github.
  • I am xiaotan (https://keybase.io/xiaotan) on keybase.
  • I have a public key ASA7djdcbTYFzHHl4PnDKt9ZOFyf98HVNTcpTInbKEX5fgo

To claim this, I am signing this object:

@tvytlx
tvytlx / mi-note-export.js
Last active May 3, 2024 13:35
小米便签导出, artoo.js 浏览器脚本
// 便签元素在 frame 里,不能直接用 artoo 处理,得先得到内部的 dom 元素,然后传给 artoo。
const iframe = 'iframe#js_note_mod_ctn.js_sandbox.business-mod-ctn.note-mod-ctn';
let get_container = (str)=>{return $(iframe)[0].contentDocument.body.querySelector(str)};
let notes_container = get_container('.home-bd .briefs-ctn.js_home_briefs_ctn');
// 开始抓取
let is_in_box = (this_)=>{
return (this_.attr('class')=='js_folder_brief folder-brief js_normal_folder js_lock') ||
(this_.attr('class')=='js_folder_brief folder-brief js_normal_folder')
};
@tvytlx
tvytlx / property.py
Created April 19, 2017 09:46
pure python sample implementation of the property() type
class Property(object):
"Emulate PyProperty_Type() in Objects/descrobject.c"
def __init__(self, fget=None, fset=None, fdel=None, doc=None):
self.fget = fget
self.fset = fset
self.fdel = fdel
if doc is None and fget is not None:
doc = fget.__doc__
self.__doc__ = doc
@tvytlx
tvytlx / sample.txt
Last active April 19, 2017 09:47
ES6 TDZ
规范里用来声明 var/let 变量的内部方法是 CreateMutableBinding(),初始化变量用 InitializeBinding(),为变量赋值用 SetMutableBinding(),
引用一个变量用 GetBindingValue()。在执行完 CreateMutableBinding() 后没有执行 InitializeBinding() 就执行 SetMutableBinding() 或者
GetBindingValue() 是会报错的,这种表现有个专门的术语(非规范术语)叫 TDZ(Temporal Dead Zone)。
标准说用let和const初始化失败的变量将会永久的不能初始化了。
let/const v = xx // xx is not defined
let/const v = 1 // v has already been declared
v = 1; let c = v // v is not defined