Skip to content

Instantly share code, notes, and snippets.

View darkmfj's full-sized avatar

DarkMFJ darkmfj

  • Taipei City, Taiwan
View GitHub Profile
<code_scheme name="AndroidStyle">
<option name="JAVA_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="8" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
@darkmfj
darkmfj / NLog.config
Created May 8, 2019 09:01
NLog.config for console
<?xml version="1.0" encoding="utf-8" ?>
<!--
This file needs to be put in the application directory. Make sure to set
'Copy to Output Directory' option in Visual Studio.
-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets async="true">
<target name="ColoredConsole" xsi:type="ColoredConsole" useDefaultRowHighlightingRules="true"
layout="${longdate}|${level:uppercase=true}|${message}|${exception:format=Message,Type,ShortType,ToString,Method,StackTrace}" >
<?xml version="1.0" encoding="utf-8" ?>
<!--
This file needs to be put in the application directory. Make sure to set
'Copy to Output Directory' option in Visual Studio.
-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true">
<targets>
<target name="file" xsi:type="File" fileName="${basedir}/App_Data/Logs/${shortdate}/${logger}.log" />
@darkmfj
darkmfj / countdown.kt
Created April 9, 2019 09:49
countdown rxjava2
// countdown 10
val observer = object : DisposableObserver<Long>() {
override fun onComplete() {
Timber.d("onComplete")
isLoading.value = false
}
override fun onNext(t: Long) {
Timber.d("onNext:$t")
@darkmfj
darkmfj / KotlinComparisonClass.java
Created April 9, 2019 09:48 — forked from wispborne/KotlinComparisonClass.java
Comparison of Java to Kotlin for various simple methods.
/** Example of a {@link Class} declaration */
public final class MyClass {
private boolean someBool;
public MyClass() {
}
public MyClass(boolean someBool) {
this.someBool = someBool;
}
// caculate data's page
var pageSize = 200;
int pages = (int)Math.Ceiling((double)src_list.Count / (double)pageSize);
var currentPage = 1;
for (int i = 0; i < pages; i++)
{
var currentPageData = src_list
.Skip(pageSize * (currentPage - 1))
@darkmfj
darkmfj / web.config
Created December 14, 2018 01:11 — forked from maxan/web.config
IIS Config to React Router App
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
@darkmfj
darkmfj / tmux-cheatsheet.markdown
Created March 16, 2017 16:04 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname