Skip to content

Instantly share code, notes, and snippets.

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Random;
public class Buzhash32Chunking {
// If we use a multiple of 32, we get a lot of cancelling out
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Md5Chunking {
private static MessageDigest md;
private static final int BLOCK_SIZE = 63;
@pawitp
pawitp / super_num.patch
Created December 21, 2019 02:25
Patch to bring back Super+<Num> shortcut on Linux Mint 19.3. This is a partial revert of https://github.com/linuxmint/cinnamon/commit/94719c2cf1525f17b38bc7356d46d5b6bb5eab59
diff -ruw [email protected]/appGroup.js [email protected]/appGroup.js
--- [email protected]/appGroup.js 2019-12-12 18:46:55.000000000 +0700
+++ [email protected]/appGroup.js 2019-12-21 09:10:38.809467280 +0700
@@ -780,6 +780,33 @@
return false;
}
+ onAppKeyPress() {
+ if (this.groupState.isFavoriteApp && this.groupState.metaWindows.length === 0) {
+ this.launchNewInstance();
@pawitp
pawitp / gist:666208230ef8cd63d426dd80afbf0cc2
Last active June 22, 2019 14:13
Setup keyboard on Arch. Map <Win>+Left to Home, etc.
# This will map:
# <Win> + Left to Home
# <Win> + Right to End
# <Win> + Up to Page Up
# <Win> + Down to Page Down
# Modify /usr/share/X11/xkb/symbols/pc, replace the definition of <LEFT>, <RGHT>, <UP> and <DOWN>
key <LEFT> {
type[Group1]= "PC_SUPER_LEVEL2",
symbols[Group1]= [ Left, Home ]
@pawitp
pawitp / bitbucket_ci.php
Created March 17, 2016 12:41
Poor man's CI with bitbucket
<?php
error_reporting(E_ALL | ~E_NOTICE);
// Config
$url = "https://bitbucket.org/USERNAME/PROJECT/get/master.zip";
$user = "USERNAME";
$pass = "PASSWORD";
$tempfile = "thinkbox-ci.zip";
$target = "./";
$access_key = "ACCESS_KEY";
@pawitp
pawitp / -
Last active November 8, 2016 22:37
repo forall -cp git log --oneline android-6.0.1_r8..android-6.0.1_r11
project build/
1bd2527 "MMB29Q"
7692803 Update Security String to 2016-02-01
project frameworks/av/
7b461b5 Fix security vulnerability in ICrypto DO NOT MERGE
0681b53 libstagefright: check requested memory size before allocation for SoftMPEG4Encoder and SoftVPXEncoder.
project frameworks/base/
project build/
4f09dc3 MMN29P
e8856b3 "MMB29O"
cfcece8 Update Security String to 2016-01-01 to mnc-dev
a625957 Revert "Change version back to 6.0"
06581f3 Change version back to 6.0
27fdf2c MMB29N
project external/bouncycastle/
project art/
7f57e8c [WIP] ART: Write-protect TLS
54d8f4b Fix in reference type propagation
ddb2a98 Parse runtime compiler options for JIT
f015c2f ART: Add missing GetInterfaceMethodIfProxy
2602aa8 ART: Decrease dex2oat watchdog timeout
22e0ce3 DO NOT MERGE Add locking to prevent races between setting class methods and marking
2a19678 ART: Do not abort on exception in CreatePeer
cc07760 ART: Clean up less in dex2oat
@pawitp
pawitp / memcached-$USER
Created November 28, 2015 06:12
CentOS's memcached init script, modified to support running socket-based user-specific instance
#! /bin/sh
#
# chkconfig: - 55 45
# description: The memcached daemon is a network memory cache service.
# processname: memcached
# pidfile: /var/run/memcached-$USER/memcached.pid
# Standard LSB functions
#. /lib/lsb/init-functions
@pawitp
pawitp / bootable_recovery.patch
Last active February 22, 2016 01:47
Compatibility patches for I9082 on cm-12.1
From be936303368c68a2c6e096c0c56288fdba13779a Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <[email protected]>
Date: Tue, 27 Jan 2015 22:29:39 +0700
Subject: [PATCH] recovery: uncrypt: fix compatibility with CWM
CWM and other older recoveries do not support block map, so avoid
using it when possible
Change-Id: I49a04676ca5193db31c87418a5760727648745f0
---