This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = 3; | |
var y = 10; | |
var z = 100; | |
if (x != 3) | |
y = 30; | |
z = 50; | |
console.log(x); // 3 | |
console.log(y); // 10 (not changed) | |
console.log(z); // 50 (changed!!!) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ninenine | |
sealed class NineNine { | |
abstract fun print99(formatter: String) | |
} | |
class Table(internal val width: Int, internal val height: Int, private val sections: Int = if (width >= 6) 2 else 1) : NineNine() { | |
private val lists = IntRange(1, width).map { Sheet(it, height) }.toList() | |
override fun print99(formatter: String) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ninenine | |
interface NineNine { | |
fun print99(formatter: String) | |
} | |
class Table(internal val width: Int, internal val height: Int, private val sections: Int = if (width >= 6) 2 else 1) : NineNine { | |
private val lists = IntRange(1, width).map { Sheet(it, height) }.toList() | |
override fun print99(formatter: String) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g default-shell /bin/zsh | |
set-option -g history-limit 30000 | |
set -g mouse on | |
unbind-key % | |
unbind-key '"' | |
unbind-key c | |
bind-key - split-window -v -c "#{pane_current_path}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
String a = "Charlie123"; | |
StringBuilder sb = new StringBuilder(); | |
for (char c : a.toCharArray()) { | |
if ('a' <= c && c <= 'z') { | |
sb.append(String.valueOf(c).toUpperCase()); | |
} else if ('A' <= c && c <= 'Z') { | |
sb.append(String.valueOf(c).toLowerCase()); | |
} else { | |
sb.append(c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic Shell cmd: | |
ctrl + r | |
ctrl + a / ctrl + e | |
ctrl + c | |
ctrl + w | |
ctrl + p / ctrl + n | |
tab-tab | |
# Useful tool | |
grep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package idv.chatea.calendar; | |
import android.Manifest; | |
import android.content.ContentResolver; | |
import android.content.pm.PackageManager; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.provider.CalendarContract.Calendars; | |
import android.provider.CalendarContract.Events; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyComparator implement Comparator<String> { | |
@Override | |
public int compare(String left, String right) { | |
return left.length() - right.length(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.datstudio.testproject; | |
import android.app.ActionBar; | |
import android.app.Activity; | |
import android.app.Fragment; | |
import android.app.FragmentManager; | |
import android.app.FragmentTransaction; | |
import android.os.Bundle; | |
import android.support.v13.app.FragmentPagerAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
String name = "Charlie"; | |
int money = 100; | |
int[] coordinate = {0, 0}; | |
UserData data = new UserData(); | |
data.name = name; | |
data.money = money; |
NewerOlder