Skip to content

Instantly share code, notes, and snippets.

View YuanLiou's full-sized avatar
:octocat:
a museum enthusiast.

Jui Yuan Liu (Ray) YuanLiou

:octocat:
a museum enthusiast.
View GitHub Profile
@YuanLiou
YuanLiou / vimrc.txt
Last active June 7, 2018 11:25
Ray's VIM setting
set clipboard=unnamed,unnamedplus
" 自動縮排:啟用自動縮排以後,在貼上剪貼簿的資料時排版可能會亂掉,這時可以手動切換至貼上模式 :set paste 再進行貼上。
set ai
" 啟用暗色背景模式。
set background=dark
" 啟用行游標提示。
" set cursorline
@YuanLiou
YuanLiou / AddToPlaylistTaskOperatorTests.java
Created April 6, 2017 10:05
Stan's addToPlaylistTest Sample
public class AddToPlaylistTaskOperatorTests {
+ private AddToPlaylistTaskOperator addToPlaylistTaskOperator;
+
+ private APIManager mockAPIManager;
+ private Playlist mockPlaylist;
+
+ @Before
+ public void setup() {
+ mockAPIManager = mock(APIManager.class);
+ mockPlaylist = mock(Playlist.class);
@YuanLiou
YuanLiou / Vim setting
Last active February 2, 2023 08:07
Ray's VIM Setting 3.1.6
let mapleader = "\<space>"
set clipboard+=unnamed,unnamedplus
" 自動縮排:啟用自動縮排以後,在貼上剪貼簿的資料時排版可能會亂掉,這時可以手動切換至貼上模式 :set paste 再進行貼上。
set ai
" 啟用暗色背景模式。
set background=dark
" 啟用行游標提示。
@YuanLiou
YuanLiou / Ray's Git Config
Last active July 4, 2024 08:36
Ray's Git Config 2.0
[user]
name = Ray-Yuan Liu
email = [email protected]
[color]
diff = auto
status = auto
branch = auto
log = auto
[alias]
st = status
@YuanLiou
YuanLiou / Custom AndroidStudio VM options.txt
Created June 5, 2017 03:22
Custom AndroidStudio VM options
# custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html
-Xms1024m
-Xmx3072m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=440m
-XX:+UseCompressedOops
-XX:+HeapDumpOnOutOfMemoryError
-Dfile.encoding=UTF-8
@YuanLiou
YuanLiou / CameraQuestion.cs
Last active June 7, 2017 15:16
CameraMovingQuestion
public void SomeClass : MonoBehavior {
private CameraControllerClass cameraControllerClass; // 其他的 C# Script
public Start() {
cameraControllerClass = new CameraControllerClass();
}
public Update() {
int x = newBlock.transform.position.x;
int y = newBlock.transform.position.y;
public Observable<Response<Page<GenericItem>>> fetchFeed(int offset, int limit) {
return endpoint.getFeed(offset, limit)
.compose(SchedulerProvider.NETWORK.<Response<Page<GenericItem>>>applySchedulers())
.compose(new Observable.Transformer<Response<Page<GenericItem>>, Response<Page<GenericItem>>>() {
@Override
public Observable<Response<Page<GenericItem>>> call(Observable<Response<Page<GenericItem>>> responseObservable) {
return responseObservable.observeOn(Schedulers.newThread())
.subscribeOn(AndroidSchedulers.mainThread())
.map(new Func1<Response<Page<GenericItem>>, Response<Page<GenericItem>>>() {
@Override
@YuanLiou
YuanLiou / test.css
Created September 14, 2017 16:24
profile_css_test
/* screen split size follow Bootsraps. */
/*
** small screen
*/
@media screen and (max-width: 576px) {
.main_content {
width: 100%;
bottom: 0;
position: relative;
@YuanLiou
YuanLiou / Node.kt
Created December 1, 2017 14:37
Stack in Kotlin
class Node {
internal var text: String = ""
internal var nextNode: Node? = null
}
@YuanLiou
YuanLiou / Node.kt
Created December 5, 2017 03:28
Queue in Kotlin
class Node {
internal var text: String = ""
internal var nextNode: Node? = null
}