Skip to content

Instantly share code, notes, and snippets.

View xingrz's full-sized avatar

XiNGRZ xingrz

View GitHub Profile
@xingrz
xingrz / article.js
Last active August 29, 2015 13:56
XX-Style
var router = require('xx').router
, marked = require('marked')
exports.create = router()
.shouldAuthed()
.shouldNotContains([ 'id', 'creator' ])
exports.show = router()
.visable([ 'title', 'content' ])
.map('content', marked.render)
@xingrz
xingrz / gist:9115622
Last active August 29, 2015 13:56
glass::NativeEyeGestureService::isGestureSupported(int) const
; glass::NativeEyeGestureService::isGestureSupported(int) const
push {r4, r5, r6, lr} ; XREF=0x483c
mov r4, r0
ldr r0, = 0x2bb4
mov r5, r1
add r0, pc
ldr r0, [r0]
blx 0x38ac
ldr r4, [r4, #0xc]
cbz r4, 0x4808
String enabledNotificationListeners = Settings.Secure.getString(context.getContentResolver(), "enabled_notification_listeners");
// check to see if the enabledNotificationListeners String contains our package name
if (enabledNotificationListeners == null || !enabledNotificationListeners.contains(context.getPackageName())) {
// in this situation we know that the user has not granted the app the Notification access permission
throw new Exception();
} else {
doSomethingThatRequiresNotificationAccessPermission();
}
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>出口资讯</title>
<meta charset="utf8">
<style>
body {
margin: 0;
padding: 0 100px;
background: black;
@xingrz
xingrz / td.sh
Last active August 29, 2015 14:00
Teardown Glass
#!/bin/sh
YELLOW="\033[33m"
PINK="\033[36m"
RESET="\033[0m"
echo "$PINK Extracting $1...$RESET"
zip=$1
rom=${zip%.*}
mkdir $rom
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
public abstract class ArrayRecyclerAdapter<E, VH extends RecyclerView.ViewHolder>
$ ./gradlew -q projects
------------------------------------------------------------
Root project
------------------------------------------------------------
Root project 'cnode-android'
\--- Project ':CNode'
To see a list of the tasks of a project, run gradlew <project-path>:tasks
@xingrz
xingrz / gist:7ae8f853519280bfafe7
Created November 19, 2014 04:39
Merge flvs with ffmpeg
ffmpeg -i 画·影1.flv -c copy -bsf:v h264_mp4toannexb -f mpegts 1.ts
ffmpeg -i 画·影2.flv -c copy -bsf:v h264_mp4toannexb -f mpegts 2.ts
ffmpeg -i 画·影3.flv -c copy -bsf:v h264_mp4toannexb -f mpegts 3.ts
ffmpeg -i 画·影4.flv -c copy -bsf:v h264_mp4toannexb -f mpegts 4.ts
ffmpeg -i 画·影5.flv -c copy -bsf:v h264_mp4toannexb -f mpegts 5.ts
ffmpeg -i "concat:1.ts|2.ts|3.ts|4.ts|5.ts" -c copy -bsf:a aac_adtstoasc -movflags +faststart 画·影.mp4
@xingrz
xingrz / ListRecyclerAdapter.java
Created November 23, 2014 03:30
A RecyclerView Adapter that binds on a List<E>
import android.support.v7.widget.RecyclerView;
import java.util.List;
public abstract class ListRecyclerAdapter<E, VH extends RecyclerView.ViewHolder>
extends RecyclerView.Adapter<VH> {
private List<E> list;
public E getItem(int position) {
@xingrz
xingrz / HeaderListRecyclerAdapter.java
Created November 23, 2014 03:33
A ListRecyclerAdapter (1d42afaf6e8e99d16631) with fixed-height header. Useful for that overlays a Toolbar on it for scrolling techniques.
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.netease.photo.R;
public abstract class HeaderListRecyclerAdapter<E, VH extends RecyclerView.ViewHolder>