Skip to content

Instantly share code, notes, and snippets.

View jp1017's full-sized avatar
:octocat:
Focusing

妙法莲华经 jp1017

:octocat:
Focusing
View GitHub Profile
@jp1017
jp1017 / current_activity.sh
Created July 27, 2017 06:03 — forked from 109021017/current_activity.sh
A shell script log the current android top activity
oldActvity=""
displayName=""
currentActivity=`adb shell dumpsys window windows | grep -E 'mCurrentFocus'`
while true
do
if [[ $oldActvity != $currentActivity && $currentActivity != *"=null"* ]]; then
displayName=${currentActivity##* }
displayName=${displayName%%\}*}
echo $displayName
oldActvity=$currentActivity
@jp1017
jp1017 / gist:fa929ba6ff0553bdec4bc2a3e5a1c27b
Created May 3, 2017 08:13 — forked from AliMD/gist:3344523
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

@jp1017
jp1017 / main.py
Created March 23, 2017 13:10 — forked from littlecodersh/main.py
Main script behind itchat robot
#coding=utf8
import itchat
# tuling plugin can be get here:
# https://github.com/littlecodersh/EasierLife/tree/master/Plugins/Tuling
from tuling import get_response
@itchat.msg_register('Text')
def text_reply(msg):
if u'作者' in msg['Text'] or u'主人' in msg['Text']:
return u'你可以在这里了解他:https://github.com/littlecodersh'
@jp1017
jp1017 / WechatSmartWish.py
Created March 23, 2017 11:03 — forked from littlecodersh/WechatSmartWish.py
Demo of sending smart wishes through wechat.
#coding=utf8
import itchat, time
SINCERE_WISH = u'祝%s新年快乐!'
REAL_SINCERE_WISH = u'祝%s新年快乐!!'
def send_wishes():
friendList = itchat.get_friends(update=True)[1:]
for friend in friendList:
# 如果不是演示目的,把下面的方法改为itchat.send即可
@jp1017
jp1017 / PCMusicViaWechat.py
Created March 23, 2017 11:03 — forked from littlecodersh/PCMusicViaWechat.py
Demo of controlling music player through wechat.
#coding=utf8
import os
import itchat
from NetEaseMusicApi import interact_select_song
# 第三方包通过该命令安装:pip install itchat, NetEaseMusicApi
HELP_MSG = u'''\
欢迎使用微信网易云音乐
帮助: 显示帮助
@jp1017
jp1017 / EndlessRecyclerOnScrollListener.java
Created March 7, 2017 03:07 — forked from ssinss/EndlessRecyclerOnScrollListener.java
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@jp1017
jp1017 / capture_raw_frames.c
Created March 2, 2017 01:35 — forked from maxlapshin/capture_raw_frames.c
v4l2 capture example
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
@jp1017
jp1017 / selector_button_common.xml
Created August 23, 2016 07:34
通用button背景
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="@color/powderblue"/>
<corners android:radius="@dimen/space_5"/>
</shape>
</item>
package baidumapsdk.demo;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import com.baidu.mapapi.map.*;
import com.baidu.mapapi.model.LatLng;
@jp1017
jp1017 / SnackbarUtils.java
Last active August 4, 2016 03:03
没时间解释了,快使用Snackbar!——Android Snackbar花式使用指南 http://www.jianshu.com/p/cd1e80e64311
/**
* 文 件 名: SnackerBarUtils
* 说 明: from: http://www.jianshu.com/p/cd1e80e64311
*/
import android.graphics.Color;
import android.support.design.widget.Snackbar;
import android.view.Gravity;