This file contains hidden or 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
const str2sec = str => str.split(':').reduce((acc, val)=>Number(acc)*60 + Number(val)); | |
const sec2str = t => t/60|0 > 0 ? sec2str(t/60|0) + ':' + t%60 : t + ''; | |
//demo below | |
var timeStr = '3:44:45.466'; // 3 hour, 44 min, 45 sec, 466 ms | |
var timeSec = str2sec(timeStr); // 13485.466 sec | |
sec2str(timeSec); // "3:44:45.46600000000035" |
This file contains hidden or 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
version: 1.0.{build} | |
install: | |
- ps: >- | |
$gitData = ConvertFrom-StringData (git log -1 --format=format:"commitId=%H%nmessage=%s%ncommitted=%aD" | out-string) | |
if ($gitData['message'] -eq "") { $gitData['message'] = "No commit message available for $($gitData['commitid'])" } | |
# View the data with Write-Output @gitData | |
Update-AppveyorBuild @gitData |
This file contains hidden or 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
#!/bin/bash | |
#REPO=genlocationdata | |
#REPO_URL=https://github.com/MoKee/android_frameworks_base.git | |
#REPO_PATH=mokee/tools/genlocationdata/* | |
#REPO_BRANCH=mkn-mr1 | |
#rm -rf $REPO | |
#git init $REPO | |
#cd $REPO | |
#git remote add origin $REPO_URL | |
#git config core.sparsecheckout true |
This file contains hidden or 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
const repeat = (str, times) => { | |
let result = ''; | |
while (times-- > 0) result += str; | |
return result; | |
}; |
This file contains hidden or 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
let arr = `112.80.248.52 | |
27.221.40.46 | |
119.75.219.40 | |
111.13.12.44 | |
111.13.12.22 | |
111.13.100.27 | |
117.185.16.83 | |
117.185.16.84 | |
117.185.16.13`.split('\n'); | |
arr = arr.map(url=>'http://'+url); |
This file contains hidden or 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
Element.prototype.find=Element.prototype.querySelector; | |
Element.prototype.attr=Element.prototype.getAttribute; | |
Element.prototype.on=Element.prototype.addEventListener; | |
Element.prototype.off=Element.prototype.removeEventListener; | |
// arrow functions binds no this nor arguments | |
Element.prototype.data=function(str){return this.dataset[str];}; | |
Element.prototype.text=function(str){return str ? (this.innerText = str) && this : this.innerText;}; | |
Element.prototype.html=function(str){return str ? (this.innerHTML = str) && this : this.innerHTML;}; | |
Element.prototype.hide=function(){this.style.display = 'none';}; | |
Element.prototype.show=function(){this.style.display = '';}; |
This file contains hidden or 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
// ==UserScript== | |
// @name 百度网盘直接下载助手 | |
// @namespace undefined | |
// @version 0.9.24 | |
// @description 直接下载百度网盘和百度网盘分享的文件,避免下载文件时调用百度网盘客户端,获取网盘文件的直接下载地址 | |
// @author ivesjay | |
// @downloadURL https://gist.github.com/myfreeer/1106826093c401d5276bd35247a1465b/raw/baidu-pan.user.js | |
// @match *://pan.baidu.com/disk/home* | |
// @match *://yun.baidu.com/disk/home* | |
// @match *://pan.baidu.com/s/* |
This file contains hidden or 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
javascript:void(Array.prototype.slice.call(document.getElementsByTagName('video')).map(function(a){return!(a.src&&a.src.match('blob'))&&fetch(a.currentSrc||a.src).then(function(b){return b.blob()}).then(function(b){return a.src=URL.createObjectURL(b)})})) |
This file contains hidden or 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
var myEvents = ["contextmenu", "select", "selectstart", "copy", "cut", "paste", "drag", "dragend", "dragenter", "dragleave", "dragover", "dragstart", "drop"]; | |
if (window.restrictIsFucked) myEvents.push("wheel", "select", "focus", "scroll", "keydown", "keypress", "keyup", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "mousewheel", "pointercancel", "pointerdown", "pointerenter", "pointerleave", "pointermove", "pointerout", "pointerover"); | |
[...document.getElementsByTagName('*'), document, window] | |
.map(element => getEventListeners(element)) | |
.map(eventListeners => myEvents | |
.map(eventName => eventListeners[eventName]) | |
.filter(e => e === 0 || e) | |
.map(events => [...events].forEach(event => event.remove()))); | |
window.restrictIsFucked = 1; |