Skip to content

Instantly share code, notes, and snippets.

View xfoxfu's full-sized avatar

Yuze Fu xfoxfu

View GitHub Profile

Keybase proof

I hereby claim:

  • I am xfoxfu on github.
  • I am xfoxfu (https://keybase.io/xfoxfu) on keybase.
  • I have a public key ASCYajxov61OTm66LN0sMfp5TKhzfSg51EZgxW8Z6bP99wo

To claim this, I am signing this object:

@xfoxfu
xfoxfu / main.ts
Created March 4, 2021 11:43
SYSU Classtable to ics 中山大学教务系统课程表导出ics
const ics = require("ics");
import * as moment from "moment";
// response of https://jwxt.sysu.edu.cn/jwxt/schedule/agg/stuTimeTabPrint/studentQuery
// export const data = {}; // data;
import { data } from "./data";
export const weekday = {
"1": "MO",
"2": "TU",
@xfoxfu
xfoxfu / cf-ddns-sh
Created May 7, 2019 04:45
CloudFlare DDNS by local network address
#!/bin/bash
# CHANGE THESE
auth_email="USER_EMAIL"
auth_key="AUTH_KEY" # found in cloudflare account settings
zone_name="example.com"
record_name="home.example.com"
# MAYBE CHANGE THESE
ip=`hostname -I | cut -d ' ' -f1`
@xfoxfu
xfoxfu / pbkdf2.js
Created September 24, 2018 07:51
ASP.NET Core PBKDF2 Password Validation in Node.js
var crypto = require("crypto");
var hashedPassword = Buffer.from(
"AQAAAAEAACcQAAAAEPSiQdZVf3bivGCbaXPnuhozdt8k4cCphxfuc25NBGIioJV9deDyFK9awIow1HfR2A==",
"base64",
);
var password = Buffer.from("Admin888`");
const getPBKDF2Algorithm = prf => {
switch (prf) {
@xfoxfu
xfoxfu / labels.json
Created April 13, 2018 01:41
GitHub standard labels for Sandra
[{
"name": "CLA: Signed",
"color": "#CCFF90"
},
{
"name": "CLA: Unsigned",
"color": "#CCFF90"
},
{
"name": "duplicate",
import * as React from 'react';
import { Form, Input } from 'antd';
const FormItem = Form.Item;
import { FormComponentProps } from 'antd/lib/form/Form';
class LoginForm extends React.Component<FormComponentProps, any> {
render() {
const { getFieldDecorator } = this.props.form;
return (
<Form layout="inline">
{
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:59.0) Gecko/20100101 Firefox/59.0",
"yawf": "Yet Another Weibo Filter",
"ver": "3.7.473",
"gm": "Tampermonkey4.5.5660",
"conf": {
"weibo.tool.load_weibo_by_group.group": {},
"weibo.tool.load_weibo_by_group": false,
"weibo.tool.load_weibo_by_multi_group.count": 50,
"weibo.tool.load_weibo_by_multi_group.enabled": false,
source /usr/local/share/antigen/antigen.zsh
export ZSH=/Users/coderfox/.oh-my-zsh
antigen use oh-my-zsh
antigen bundle git
antigen bundle ssh-agent
antigen bundle docker
antigen bundle docker-compose
@xfoxfu
xfoxfu / matrix.cpp
Last active September 28, 2017 00:38
A row reduction algorithm implement in C++
#include <iostream>
#include <vector>
#include <fstream>
#define DATA_TYPE float
using namespace std;
class Position
{
import * as request from "request-promise";
import ServerChan = require("serverchan");
import * as fs from "fs";
const sc = new ServerChan();
const delay = (t: number) => new Promise(
(res, rej) => setTimeout(res, t)
);
(async () => {