Skip to content

Instantly share code, notes, and snippets.

@pfn
pfn / javap.txt
Created April 3, 2018 17:00
databinding 2.3.0 has broken classes
com.android.databinding $ javap -classpath ./compilerCommon/jars/compilerCommon-2.3.0.jar 'android/databinding/parser/BindingExpressionParser$IdentifierContext'
Compiled from "BindingExpressionParser.java"
public class android.databinding.parser.BindingExpressionParser$IdentifierContext extends org.antlr.v4.runtime.ParserRuleContext {
public org.antlr.v4.runtime.tree.TerminalNode Identifier();
public android.databinding.parser.BindingExpressionParser$IdentifierContext(org.antlr.v4.runtime.ParserRuleContext, int);
public int getRuleIndex();
public void enterRule(org.antlr.v4.runtime.tree.ParseTreeListener);
public void exitRule(org.antlr.v4.runtime.tree.ParseTreeListener);
public <T> T accept(org.antlr.v4.runtime.tree.ParseTreeVisitor<? extends T>);
}
@pfn
pfn / c.vimrc
Last active December 31, 2017 00:14
cVimrc
imap <C-p> backwardLine
imap <C-n> forwardLine
imap <C-k> deleteToEnd
site '*://discordapp.com/*' {
unmap <C-k>
iunmap <C-k>
}
@pfn
pfn / splitframes.js
Created April 21, 2017 17:10
usage is now splitFrames(framedata, casttime, dwdelay, firsthit, numoffsets, showindividualwields, enabledualwieldcast, showdrops)
function splitFrames(frames, cast, dwdelay, fst, offsets, showwields, enabledw, enabledrops) {
var out = [];
var firsthits = [];
for (var i = 0; i <= offsets; i++) {
var newhits = splitFramesOffset(frames, cast, dwdelay, fst, i, firsthits, showwields, enabledw, enabledrops);
if (firsthits.length == 0)
firsthits = newhits[0];
out = out.concat(newhits);
}
return out;
@pfn
pfn / gist:34c1a34f6008c02c50f519ac7622b5e3
Created January 19, 2017 17:56
google play-services screwed up .sha1 checksums, broken since October
$ find . -name '*.sha1' | xargs -n 1 xxd
00000000: da39 a3ee 5e6b 4b0d 3255 bfef 9560 1890 .9..^kK.2U...`..
00000010: afd8 0709 ....
00000000: da39 a3ee 5e6b 4b0d 3255 bfef 9560 1890 .9..^kK.2U...`..
00000010: afd8 0709 ....
00000000: da39 a3ee 5e6b 4b0d 3255 bfef 9560 1890 .9..^kK.2U...`..
00000010: afd8 0709 ....
00000000: da39 a3ee 5e6b 4b0d 3255 bfef 9560 1890 .9..^kK.2U...`..
00000010: afd8 0709 ....
00000000: 3366 3831 6265 3437 3531 6337 3366 6234 3f81be4751c73fb4
@pfn
pfn / main.rs
Last active June 19, 2020 15:21
rust experiment, porting hide-app.c
extern crate winapi;
extern crate user32;
extern crate gdi32;
extern crate comctl32;
extern crate kernel32;
use std::ptr::null_mut;
use std::mem::size_of;
use std::mem::zeroed;
use std::os::raw::c_int;
object Foo {
import Listeners.IotaExtensionMaterializers._
val view = new View(null)
val text = new TextView(null)
text.onClick { () }
text.onClickEx { view => "" }
text.onTextChange { () }
text.onTouchEx { (a, b) => true }
text.onTouch { true }
@pfn
pfn / 01 - iota dsl sample.scala
Last active September 1, 2016 22:25
sample of a strongly typed layout dsl for android results in http://i.imgur.com/KS7KLR6.png
package iota.sample
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.graphics.drawable.Animatable
import android.widget._
import android.view.ViewGroup.LayoutParams._
import iota._
class MainActivity extends AppCompatActivity { self =>
@pfn
pfn / viewHolders.scala
Last active July 12, 2016 21:02
generated viewholders for android layouts
package com.hanhuy.android.keepshare
import android.app.Activity
import android.view.{LayoutInflater, View, ViewGroup}
trait TypedViewHolder[T <: View] {
val rootViewId: Int
val rootView: T
}
@pfn
pfn / client.py
Last active April 11, 2016 21:48
sbtsimpleserver
#!/bin/env python
import socket
import sys
from sys import argv
from os import getcwd
if len(argv) < 2:
print "Usage: client <command>"
sys.exit(-1)
@pfn
pfn / facepreview.java
Created April 7, 2016 16:05
messing around with opencv
package com.hanhuy.android.vision;
import android.app.Activity;
import android.graphics.*;
import android.media.Image;
import android.os.Bundle;
import android.view.*;
import android.widget.FrameLayout;
import java.io.File;