Skip to content

Instantly share code, notes, and snippets.

View mariotaku's full-sized avatar
📺
Hacking my TV now

Mariotaku mariotaku

📺
Hacking my TV now
View GitHub Profile
@mariotaku
mariotaku / wps_checksum.c
Created February 1, 2014 04:35
wps checksum tool
#include <stdio.h>
unsigned int wps_pin_checksum(unsigned int pin);
int main(int argc, char *argv[])
{
int pin;
if ((argc == 2 && sscanf(argv[1], "%i", &pin)) || fscanf(stdin, "%i", &pin))
{
if (pin > 9999999)
@mariotaku
mariotaku / ListScrollDistanceCalculator.java
Created October 26, 2014 05:37
Calculate list scroll distance without any modification to ListView and ListAdapter. great for QuickReturn pattern
package org.mariotaku.twidere.util;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
/**
* Created by mariotaku on 14/10/22.
*/
public class ListScrollDistanceCalculator implements OnScrollListener {
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<ImageView
@mariotaku
mariotaku / .travis.yml
Last active August 8, 2018 13:10
Sign and upload compiled apk to Github releases automatically using Travis CI
language: android
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
- platform-tools
- tools
# The BuildTools version used by your project
- build-tools-22.0.0
@mariotaku
mariotaku / MouseScrollDirectionDecider.java
Last active August 29, 2015 14:19
An evil snippet to guess mouse scrolling direction for Android
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.v4.view.MotionEventCompat;
import android.view.InputDevice;
import android.view.MotionEvent;
import android.view.View;
import android.widget.HorizontalScrollView;
import android.widget.ScrollView;
/**
@mariotaku
mariotaku / README.md
Last active July 3, 2022 03:55
删除当前屏幕所有微博

删除所有微博

在Chrome Dev Tools中粘贴代码到Console,就可以删除当前屏幕所有微博。经过测试一万条微博大约需要10小时的半人工操作。

每批删除大概一分钟,最多50条。

如果遇到微博的Rate limit(提示操作过快),稍等三五分钟再试即可。

@mariotaku
mariotaku / README.txt
Last active March 2, 2024 10:18
Twitter reverse proxy configuration for Nginx
Settings on Twidere:
API URL Format: https://your-host/[DOMAIN.]twitter.com/
Uncheck "Same OAuth signing URL"
Uncheck "No verion suffix"
Password login recommended.
/*
* Twidere - Twitter client for Android
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@mariotaku
mariotaku / Erya nopause.user.js
Created April 23, 2017 15:03
Erya nopause UserScript
// ==UserScript==
// @name Erya nopause
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Fuck erya!
// @author Mariotaku Lee
// @match http://mooc1.zut.edu.cn/*
// @grant none
// @run-at document-end
// ==/UserScript==
@mariotaku
mariotaku / README.md
Last active December 18, 2020 05:01
Followers Cleaner Script

Usage

  1. Execute pip3 install -r requirements.txt to install dependencies
  2. Execute followers_clear.py and follow instructions.

Notes

Consumer keys can be found here. Use these keys instead of applying yourself can get rid of rate limit.