Skip to content

Instantly share code, notes, and snippets.


巴掌 JeasonWong

  • Bytedance
  • Shanghai
View GitHub Profile
Haldir65 / 闹钟实现
Created Mar 1, 2016
View 闹钟实现
public final static String ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
public static final String EXTRA_HOUR = "android.intent.extra.alarm.HOUR";
public static final String EXTRA_MESSAGE = "android.intent.extra.alarm.MESSAGE";
public static final String EXTRA_MINUTES = "android.intent.extra.alarm.MINUTES";
public static final String EXTRA_SKIP_UI = "android.intent.extra.alarm.SKIP_U";
Intent i = new Intent(ACTION_SET_ALARM);
i.putExtra(EXTRA_HOUR, 9);
i.putExtra(EXTRA_MESSAGE, "Good");
View huawei_CheckStyle
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "">
<!-- Generated by RHY @will_awoke -->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
jcdom /
Last active Jan 10, 2017
An interpolator where the rate of change starts out quickly, decelerates and then bounces at the end.
import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.Interpolator;
* An interpolator where the rate of change starts out quickly,
* decelerates and then bounces at the end.
* Created by jcdom on 02/04/15.
js1972 / write_file.groovy
Created May 16, 2014
How to write content to a new file (overwrite if already existing) in Groovy.
View write_file.groovy
// Write the mock request payload to a file for checking later...
// newWrite() is the important it to ensure you get a *new* file each time.
def filename = "C:\\MyScratchFolder\\soapUI projects\\Testing\\procon\\mock_po_activity_request.xml"
def file = new File(filename)
def w = file.newWriter()
w << mockRequest.requestContent
zilongshanren / send-pr-by-command-line
Created Mar 26, 2014
使用命令行发pull request
View send-pr-by-command-line
# while on a topic branch called "feature":
$ git pull-request
[ opens text editor to edit title & body for the request ]
[ opened pull request on GitHub for "YOUR_USER:feature" ]
# explicit title, pull base & head:
$ git pull-request -m "Implemented feature X" -b defunkt:master -h mislav:feature
alanland / 文件操作
Last active Jun 23, 2017
Groovy 文件操作
View 文件操作
// 创建文件夹
wasCreated = new File('mydir').mkdir()
wasCreated = new File('mydir/subdir').mkdirs()
// 写文件
f = new File('myfile.txt')
f.write('hello world!')
// 写文件2
f = new File(‘myfile.txt’)
granoeste /
Last active Nov 16, 2021
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories