Skip to content

Instantly share code, notes, and snippets.

View maple3142's full-sized avatar

maple maple3142

View GitHub Profile
@maple3142
maple3142 / UIrecipe.js
Created July 21, 2017 02:25
ScriptCraft範例
/*
/jsp addRecipe <recipe name>
/jsp removeRecipe <recipe name>
Minecraft Gson Library *Required
https://www.spigotmc.org/resources/gson-for-1-8-3-or-older.30852/
Installation: put it into "plugins" directory
*/
var ItemStack=org.bukkit.inventory.ItemStack;
@maple3142
maple3142 / coolapk.bat
Created September 2, 2017 15:21
coolapk v8 cli
@node index.js %*
@maple3142
maple3142 / example.js
Created September 8, 2017 12:38
require from unpkg in browser (need jquery)
//require single module
require('vue').then(function(Vue){
//do something
})
//require multiple module
require(['jquery','lodash','lowdb']).then(function([$,_,low]){
//do something
})
#include<iostream>
using namespace std;
int sum(int a,int b){
return (a+b)*(b-a+1)/2;
}
int main(void){
ios::sync_with_stdio(false);
int n;
while(cin>>n){
<script>
if(window.opener){
window.opener.location=location.href.split('#').pop()
}
</script>
@maple3142
maple3142 / ad.json
Created December 16, 2017 02:03
bahamut fake ad api
{ "banner": {}, "native_major": { "Android__": [] }, "native_minor": { "Android__": [], "iOS__": [] } }
@maple3142
maple3142 / cache.py
Created January 21, 2018 05:29
function cache
from functools import wraps
def cached(fn):
name=fn.__name__
mycache={}
if not name in mycache:
mycache[name]={}
@wraps(fn)
def cachefn(*args,**kwargs):
key=(args,frozenset(kwargs))
if key in mycache[name]:
@maple3142
maple3142 / ad.json
Created February 5, 2018 08:18
fake bahamut ads api response
{"banner":{},"native_major":{"Android__":[],"iOS__":[]},"native_minor":{"Android__":[],"iOS__":[]}}
[
{
"id": "1",
"type": "大吉",
"poem": "七寶浮圖塔,高峰頂上安,眾人皆仰望,莫作等閒看",
"explain": "就像出現了用美麗寶石做成的佛塔般地,似乎會有非常好的事情。因為能改用放眼萬事的立場,可以得到周圍的人們的信賴吧。合乎正道的你的行為,能被很多人的認同及鼓勵。不用隨便的態度看事情,用正確的心思會招來更多的好的結果。",
"result": {
"願望": "會充分地實現吧。",
"疾病": "會治癒吧。",
"盼望的人": "會出現吧。",
[
{
"id": "1",
"type": "大吉",
"poem": "七寶浮圖塔,高峰頂上安,眾人皆仰望,莫作等閒看",
"explain": "就像出現了用美麗寶石做成的佛塔般地,似乎會有非常好的事情。因為能改用放眼萬事的立場,可以得到周圍的人們的信賴吧。合乎正道的你的行為,能被很多人的認同及鼓勵。不用隨便的態度看事情,用正確的心思會招來更多的好的結果。",
"result": {
"願望": "會充分地實現吧。",
"疾病": "會治癒吧。",
"盼望的人": "會出現吧。",