Skip to content

Instantly share code, notes, and snippets.

View chengyuhui's full-sized avatar
🏳️‍⚧️
long long ago;

Midori Kochiya chengyuhui

🏳️‍⚧️
long long ago;
View GitHub Profile
package com.htdocscat.disablehw;
import android.os.IBinder;
import android.os.Parcel;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
private long getTotalRxBytes() {
String line;
String[] segs;
long received = 0;
int i;
long tmp = 0;
boolean isNum;
try {
FileReader fr = new FileReader("/proc/net/dev");
BufferedReader in = new BufferedReader(fr);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Generated by CoffeeScript 1.7.1
(function() {
var app, fs, gate, genBgList, genFgList, okay, _;
app = angular.module('MyApp', ['ui.router', 'ngProgress']);
fs = require('fs-extra');
_ = require('lodash');
i=582326
while :
do
wget --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36" -e robots=off --content-disposition --referer="http://www.nyaa.se/" --restrict-file-name=nocontrol "http://www.nyaa.se/?page=download&tid=$i"
i=$((i-1))
done
@chengyuhui
chengyuhui / a.js
Last active August 29, 2015 14:04
// Generated by CoffeeScript 1.7.1
(function() {
var async, fs, i, q, request, start, wait, _fn, _i;
wait = require('wait.for');
request = require('request');
async = require('async');
fs = require 'fs'
_ = require 'lodash'
hl = require 'highland'
async = require 'async'
readline = require 'readline'
BSON = require("bson").BSONPure.BSON
tz = require 'timezone'
zlib = require 'zlib'
import os, math
import numpy as np
#from matplotlib import pyplot as plt
import cv2
img = cv2.resize(cv2.imread('img.jpg',1), (0,0), fx=0.5, fy=0.5)
def sort_cw(points):
points = sorted(points,key=lambda cnt: cnt[0][0])
// Create a random ID for this session.
var sessionId = String.fromCharCode(Date.now() % 25 + 97) +
Math.random().toString(36).slice(2); // From uBlock
var port = chrome.runtime.connect({name: sessionId}),
channels = [],
// For receiving responses.
resp = new require('events').EventEmitter();
class Channel {
async getPages(){
// 由于API权限不足,无法获取R-18作品数据(即使已经登录且设置允许R-18)
// 暂时不使用API方式,改用DOM + AJAX
var pages = [];
if ($('._illust_modal').length !== 0) {
// 对于单张图片,可以直接在页面上的._illust_modal当中找到URL
let url = $('.original-image').data('src');
pages.push(url);
} else if ($('._ugoku-illust-player-container').length !== 0) {
// Ugoira(动图)