Skip to content

Instantly share code, notes, and snippets.

Avatar
‼️
15

巴掌 JeasonWong

‼️
15
  • Bytedance
  • Shanghai
View GitHub Profile
@Haldir65
Haldir65 / 闹钟实现
Created Mar 1, 2016
可以去调用系统闹钟,记得manifest里面加权限
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_MINUTES,41);
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" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!-- Generated by RHY @will_awoke -->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
@jcdom
jcdom / ReboundInterpolator.java
Last active Jan 10, 2017
An interpolator where the rate of change starts out quickly, decelerates and then bounces at the end.
View ReboundInterpolator.java
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
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
w.close()
@zilongshanren
zilongshanren / send-pr-by-command-line
Created Mar 26, 2014
使用命令行发pull request
View send-pr-by-command-line
http://hub.github.com/
# 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
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
granoeste / EachDirectoryPath.md
Last active Nov 16, 2021
[Android] How to get the each directory path.
View EachDirectoryPath.md

System directories

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

External storage directories