Skip to content

Instantly share code, notes, and snippets.

View JeasonWong's full-sized avatar
‼️
15

巴掌 JeasonWong

‼️
15
  • Bytedance
  • Shanghai
View GitHub Profile
@zilongshanren
zilongshanren / send-pr-by-command-line
Created March 26, 2014 06:08
使用命令行发pull request
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
@jcdom
jcdom / ReboundInterpolator.java
Last active January 10, 2017 05:00
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.
*/
@Haldir65
Haldir65 / 闹钟实现
Created March 1, 2016 10:36
可以去调用系统闹钟,记得manifest里面加权限
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");
@alanland
alanland / 文件操作
Last active August 6, 2023 04:59
Groovy 文件操作
// 创建文件夹
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’)
<?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"/>
@js1972
js1972 / write_file.groovy
Created May 16, 2014 07:42
How to write content to a new file (overwrite if already existing) in 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()
@granoeste
granoeste / EachDirectoryPath.md
Last active April 4, 2024 22:32
[Android] How to get the each directory path.

System directories

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

External storage directories