Skip to content

Instantly share code, notes, and snippets.

Avatar
🐠
绝赞摸鱼中

Rikumi rikumi

🐠
绝赞摸鱼中
View GitHub Profile
View jest-moebius.js
/**
* 生成莫比乌斯对象
* - 生成的对象支持调用,支持属性存取,支持数学运算,支持 await
* - 生成的对象是一个 jest.fn(),可以正常取 mock,可以正常 expect
* - 可以通过传入对象,自定义一些属性的值/实现
* - 从莫比乌斯对象中取出和返回的值默认都是新的莫比乌斯对象,重复取出的同名对象相等
* @param {any} extensions
* @return {any}
*/
const createMoebius = (extensions = {}) => {
@rikumi
rikumi / iconsur.sh
Last active Nov 25, 2020
My personal iconsur setup
View iconsur.sh
# See https://github.com/rikumi/iconsur
yarn global add iconsur
sudo iconsur set /Applications/Android\ File\ Transfer.app -k Airdroid
sudo iconsur set /Applications/Android\ Studio.app/ -l -c 7a5 -s 0.8
sudo iconsur set /Applications/DaisyDisk.app/ -l
sudo iconsur set /Applications/Decompressor.app/ -l
sudo iconsur set /Applications/Discord.app/
sudo iconsur set /Applications/Google\ Chrome.app/
sudo iconsur set /Applications/IINA.app/ -l -c 161d22
@rikumi
rikumi / Wallpaper.html
Last active Jul 15, 2018
iOS11 简易桌面歌词 / 请先安装 XenHTML、XenInfo / 文件路径 /var/mobile/Library/SBHTML/Rikumi/Wallpaper.html
View Wallpaper.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=375, height=667, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<style>
:root {
font-family: 'PingFang SC';
color: #fff;
text-shadow: 0 1px 5px rgba(0, 0, 0, .2);
@rikumi
rikumi / scraper.js
Last active Jan 10, 2018
微机原理与接口技术 答案抓取器
View scraper.js
/*
微机原理与接口技术 答案抓取器
用法:
1. 使用 Chrome 浏览器;
2. 登录进入作业列表页面,要求所有作业都为已完成、且可查看答案的状态;
3. 地址栏输入地址进入框架内部:223.3.65.249/student/Home_Management/Show_All_Homework_CN.aspx;
4. 打开 F12 控制台,复制粘贴执行下列代码,待显示结果后,保存页面为 PDF。
*/
@rikumi
rikumi / herald-monitor.coffee
Created Jan 3, 2018
Slacklet for Monitoring Herald API
View herald-monitor.coffee
monitoring = true
main = ->
send '监控程序已上线'
loop
if not monitoring
send '监控程序已退出'
break
downCount = 0
@rikumi
rikumi / seulogin.js
Created Sep 14, 2017
seu-wlan 自动登录/轮询登录脚本
View seulogin.js
const axios = require('axios');
const read = require('readline-sync');
const program = require('commander');
program
.version('1.0.0')
.option('-u, --username [username]', '设置用户名')
.option('-p, --password [password]', '设置密码')
.option('-d, --daemon [seconds]', '每隔数秒轮询网络状态,一旦退出自动重新登录', '0')
.parse(process.argv);
@rikumi
rikumi / flexy.css
Created Sep 9, 2017
A DSL for CSS3 flexbox
View flexy.css
/*
32 Combinations of CSS3 flexbox
Usage Example: <div flex="↖-↗~"/> (row, wrap, align=flex-start + justify=space-between)
<div flex="|·"> (column, center + center)
<p flex="!"/> (flex-grow: 1)
</div>
1. row: - (ALIGN JUSTIFY)
View temp.py
import json, urllib
import tornado.web
import tornado.gen
from datetime import date, timedelta
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
class NewNewHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
@rikumi
rikumi / SnapKitExtension.swift
Last active Jul 13, 2017
SnapKit 扩展插件
View SnapKitExtension.swift
//
// Created by Vhyme on 2017/7/13.
//
/* Usage Example:
func layoutCourseData() {
coursePage.removeAllSubviews()
// 遍历课程数据
@rikumi
rikumi / fab.css
Last active Aug 7, 2018
微信小程序仿 Material Design 风格的浮动动作按钮
View fab.css
/*
Material Design 风格的浮动动作按钮(Floating Action Button)
用法:
<fab catchtap="someAction"/>
<fab class="close" catchtap="someAction"/>
<fab class="confirm" catchtap="someAction"/>
<fab class="{{ canPublish ? '' : 'hidden' }}" catchtap="someAction"/>
在上述几个class做动态切换时,会有动画效果。
*/
fab {
You can’t perform that action at this time.