在讲解命名规范前,先初略介绍下当前主要的标识符命名法和英文缩写规则。
标识符命名法最要有四种:
- 驼峰(Camel)命名法:又称小驼峰命名法,除首单词外,其余所有单词的第一个字母大写。
- 帕斯卡(pascal)命名法:又称大驼峰命名法,所有单词的第一个字母大写
- 下划线命名法:单词与单词间用下划线做间隔。
- 匈牙利命名法:广泛应用于微软编程环境中,在以Pascal命名法的变量前附加小写序列说明该变量的类型。 量的取名方式为:<scope_> + <prefix_> + 范围前缀,类型前缀,限定词。
#!/bin/bash | |
ADB_PATH="/Users/lee/Library/Android/sdk/platform-tools" | |
PACKAGE_NAME="com.yourcompany.app" | |
DB_NAME="default.realm" | |
DESTINATION_PATH="/Users/lee/Downloads/${DB_NAME}" | |
NOT_PRESENT="List of devices attached" | |
ADB_FOUND=`${ADB_PATH}/adb devices | tail -2 | head -1 | cut -f 1 | sed 's/ *$//g'` | |
if [[ ${ADB_FOUND} == ${NOT_PRESENT} ]]; then | |
echo "Make sure a device is connected" | |
else |
I recently switched over to neovim (see my screenshots at the bottom). Below is my updated config file.
It's currently synchronized with my .vimrc
config except for a block of neovim-specific terminal key mappings.
This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer.
These days I primarily develop in Go. I'm super thrilled and grateful for fatih/vim-go,
struct StackFrame { | |
let symbol: String | |
let file: String | |
let address: UInt64 | |
let symbolAddress: UInt64 | |
var demangledSymbol: String { | |
return _stdlib_demangleName(symbol) | |
} | |
} |
protocol ScopeFunc {} | |
extension ScopeFunc { | |
@inline(__always) func apply(block: (Self) -> ()) -> Self { | |
block(self) | |
return self | |
} | |
@inline(__always) func letIt<R>(block: (Self) -> R) -> R { | |
return block(self) | |
} | |
} |
oldActvity="" | |
displayName="" | |
currentActivity=`adb shell dumpsys window windows | grep -E 'mCurrentFocus'` | |
while true | |
do | |
if [[ $oldActvity != $currentActivity && $currentActivity != *"=null"* ]]; then | |
displayName=${currentActivity##* } | |
displayName=${displayName%%\}*} | |
echo $displayName | |
oldActvity=$currentActivity |
import Darwin | |
enum Signal: Int32 { | |
case HUP = 1 | |
case INT = 2 | |
case QUIT = 3 | |
case ABRT = 6 | |
case KILL = 9 | |
case ALRM = 14 | |
case TERM = 15 |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.os.Looper; | |
import rx.Observable; | |
import rx.Scheduler; |
package net.twisterrob.android.view; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.widget.FrameLayout; | |
public class SquareFrameLayout extends FrameLayout { | |
public SquareFrameLayout(Context context) { | |
super(context); | |
} |