Skip to content

Instantly share code, notes, and snippets.

View mashirozx's full-sized avatar
🐕
Just for fun

Mashiro mashirozx

🐕
Just for fun
View GitHub Profile
server {
listen 443 ssl;
listen [::]:443;
server_name cdn.xxx.xxx;
ssl on;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
@mashirozx
mashirozx / upload.py
Created December 3, 2017 16:32 — forked from FormatFish/upload.py
针对sm.ms的图床
#coding=utf-8
import requests
import json
import mimetypes
from PIL import ImageGrab
import datetime
def upload(files):
APIKey = "YOUR API KEY"
format = "json"
@mashirozx
mashirozx / ajax.php
Created October 21, 2017 03:51
comment
<!--蜜汁Ajax-->
<div class="commentshow" id="commentshow">
<div id="loading-comments"><span>Loading...</span></div>
<ol class="comments-list">
<?php wp_list_comments('type=comment&callback=weisay_comment&reverse_top_level=1'); ?>
</ol>
<div class="commentnav">
<?php paginate_comments_links(); ?>
<script>
//Ajax评论,待优化。。
@mashirozx
mashirozx / calculator.js
Last active October 20, 2017 04:15
一个计算器
// 定义数字0:
var zero = function (f) {
return function (x) {
return x;
}
};
// 定义数字1:
var one = function (f) {
return function (x) {
@mashirozx
mashirozx / vultr-bandwidth-monitor-index.php
Last active March 20, 2022 00:25
A php page shows Vultr's VPS bandwidth usage.
<?php
error_reporting(E_ERROR);
ini_set("display_errors","Off");
$request = "https://api.vultr.com/v1/server/bandwidth?SUBID=YOUR_SUBID&api_key=YOUR_API_KEY";
$serviceInfo = json_decode(file_get_contents($request));
$income = $serviceInfo->incoming_bytes;
$outgo = $serviceInfo->outgoing_bytes;
$sumin = 0;
$sumout = 0;
foreach ($income as $invalue) {
<script src="https://storage.mashiro.space/assets/js/hitokoto.min.js"></script>
<div>
<p class="hitokoto"></p>
<p class="from"></p>
</div>