Skip to content

Instantly share code, notes, and snippets.

View sumimakito's full-sized avatar

Makito sumimakito

View GitHub Profile
@sumimakito
sumimakito / cloudflare.sh
Created May 8, 2022 10:38
Cloudflare DDNS Provider for Synology
#!/bin/sh
_exit() {
echo $1
exit
}
if [[ "$#" -ne 4 ]]; then
_exit "badparam"
fi
@sumimakito
sumimakito / xiaomi_service_login.py
Last active October 14, 2019 08:15
Run with Python 3
#!/usr/bin/env python
import hashlib
import json
from getpass import getpass
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
@sumimakito
sumimakito / p1ngj1a0.js
Last active December 21, 2017 04:06
解决一些评教难题。
(function () {
var i;
var j;
var groupA = [];
var groupB = [];
var groupC = [];
var scoreTable = [];
// input a mess to get a Pure Array
function copyArray(src) {
@sumimakito
sumimakito / Better_NSLog.m
Last active December 17, 2017 09:19
Gracefully output Arrays/Dictionaries that contain Unicode encoded strings. (may not work very well)
//
// Better_NSLog.m
//
// Created by Makito on 2017/12/17.
// Copyright © 2017年 Makito. All rights reserved.
//
#import <Foundation/Foundation.h>
#define INDENT @" "
@sumimakito
sumimakito / loop.sh
Created October 30, 2017 07:40
loop.sh [--expected EXIT_CODE] COMMANDS...
expected=0
command=$@
re='^[0-9]+$'
if [[ $1 == '--expected' ]] ; then
if ! [[ $2 =~ $re ]] ; then
echo "Error: expected exit code '$2' is invalid."
exit 1
else
expected=$2
command=${@:3}
@sumimakito
sumimakito / pn.sh
Last active September 20, 2017 07:03
A bloody simple script for lazy cats.
#!/bin/bash
#
# Written by Makito <[email protected]>
#
# A bloody simple script for lazy cats.
# I'm too lazy to give it a name more than two words.
# Just regard it as the abbreviation of ping, please.
#
# You : Can I ping a URL?
# Ping: NO WAY! Cannot resolve *****: Unknown host!!

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

//
// GPUImageHighlightShadowTintFilter.m
//
// Created by github.com/r3mus on 8/14/15.
//
//
#import "GPUImageHighlightShadowTintFilter.h"
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE