i'm not using gist as pastebin anyway
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
package com.mycompany.myapp.kill; | |
import android.app.*; | |
import android.os.*; | |
import android.content.*; | |
import java.util.*; | |
public class MainActivity extends Activity | |
{ | |
@Override |
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
/** | |
* 42.js - quickjs bytebeat isolated loader stub, named after the famous 42 melody | |
* code: @Dobby233Liu | |
* WTFPL | |
* fill up the code(t) section, build using qjsc https://bellard.org/quickjs/ then pipe to anything eg. aplay | |
* i recommend use node.js more than quickjs, its better, and quickjs is in beta. | |
* example program using node.js: bytebeat.jsV2.0 https://pastebin.com/xwtRgcfV | |
* gist: https://gist.github.com/Dobby233Liu/157e2438dcfb7a31209616404b301759 | |
**/ | |
import * as std from 'std' |
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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
var BASE_URL = "https://lab.isaaclin.cn/nCoV"; | |
var HOST_URL = "https://github.com/Dobby233Liu"; | |
var HOST_NNM = "Dobby233Liu"; | |
var CREDITS_HTML | |
= ` | |
由<a href="${HOST_URL}">${HOST_NNM}</a>镜像。此镜像根目录直通原api目录,无需添加/nCoV在目录名前(虽然会自动处理)。原api:<a href="${BASE_URL}">${BASE_URL}</a>。<hr />` | |
var CREDITS_INSERT_AFTER_FIRST_ENTRY_OF = `body > div > p`; |
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
index = [ | |
{ | |
obj: window.getListByCountryTypeService1, | |
data: { | |
creationDate: "createTime", | |
modifiedDate: "modifyTime", | |
op: "operator" | |
} | |
}, | |
{ |
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
fosshub.com##.ad-alt | |
msfn.org##.ipsMessage.ipsMessage_error.ipsfocus-globalMessage.displayGlobalMessage | |
imooc.com##.modal-backdrop.in | |
imooc.com###signin | |
imooc.com##.rl-modal.in | |
thememypc.net##.k*-container.k*-2.k*-hide | |
zhihu.com##.AdblockBanner | |
jsp.d2l.workers.dev##.jquery-modal.blocker.current | |
jsp.d2l.workers.dev###oyahpzunevwwuoc-overlay | |
2heng.xin##.ad-container |
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
// random strangires based on Math.random [1, inefficine, unstable and wastes time] | |
Math_random1_part1=()=>Math.sinh(Math.cos(Math.atan(Math.tan(Math.random()*0.124231332135)))*0.252346/Math.LOG2E)%(+(new Date)/Math.LN2%Math.SQRT1_2*Math.E)/(Math.random()*0.043446566)*(Math.random()*0.0011124514%Math.random()+0.0011222) | |
Math_random1=()=>{ | |
var m = Number(Math_random1_part1()).toString().split(""); | |
var m2 = m.slice(2); | |
for (let i = m2.length - 1; i > 0; i--) { | |
const j = Math.floor(Math_random1_part1() * (i + 1)); | |
[m2[i], m2[j]] = [m2[j], m2[i]]; | |
} | |
var r=parseFloat(m[0]+m[1]+m2.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
function isPrime(num) // https://blog.csdn.net/huang_miao_xin/article/details/51331710 | |
{ | |
if(num == 2 || num == 3) return true; | |
if(num % 6 != 1 && num % 6 != 5) return false; // 不在6的倍数两侧的一定不是质数 | |
var tmp = Math.sqrt(num); | |
for(var i = 5; i <= tmp; i += 6) if(num % i == 0 || num % (i + 2) == 0) return false; // 在6的倍数两侧的也可能不是质数 | |
return true; // 排除所有,剩余的是质数 | |
} | |
function sortNumbers(data = [27, 37, 41, 58, 61, 73, 83, 95, 11, 14, 33, 47, 57, 62, 87, 99]){ | |
var output = {primes: [], composites: [], odds: [], evens: []}; |
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
-- deduplicate value-only table | |
function dedupTable(origtable) | |
function tableContainsV(tablee, value) | |
local fr = false | |
for i = 1, #tablee do | |
if tablee[i] == value then | |
fr = true | |
break -- i had breakfast today | |
end | |
end |
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 generateStringByTemplate(arr){ | |
// FIXME: This is a temporary solution. It may cause overflows. | |
// If you have an excellent way to do this, tell me. | |
main = "" | |
for (i of arr) { | |
z = "" | |
if (typeof i != "string") { // is i not a string? | |
if (Array.isArray(i)) | |
z = i // assign a placeholder | |
else |
OlderNewer