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
object DelegatesExt { | |
fun <T : Any> preference(context: Context, name: String, default: T) | |
= Preference(context, name, default) | |
} | |
class Preference<T>(val context: Context, val name: String, | |
val default: T) : ReadWriteProperty<Any?, T> { | |
companion object { | |
val PREF_NAME: String = "chameleon" |
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 butterknife | |
import android.app.Activity | |
import android.app.Dialog | |
import android.app.Fragment | |
import android.support.v7.widget.RecyclerView.ViewHolder | |
import android.view.View | |
import kotlin.properties.ReadOnlyProperty | |
import kotlin.reflect.KProperty | |
import android.support.v4.app.Fragment as SupportFragment |
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
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<gradient | |
android:angle="90" | |
android:endColor="#40000000" | |
android:startColor="@android:color/transparent" /> | |
</shape> |
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
/****************************************************************************** | |
* Copyright (c) 2011 GitHub Inc. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* Kevin Sawicki (GitHub Inc.) - initial API and implementation | |
*****************************************************************************/ |
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
#!/bin/bash | |
#FileName get-android.sh | |
PATH=./bin:$PATH | |
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-5.1.1_r38 | |
repo sync | |
while [ $? = 1 ]; do | |
echo "============ sync failed, re-sync again ===============" | |
sleep 3 | |
repo sync | |
done |
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.zhgqthomas.rxjava.util; | |
import android.content.Context; | |
import android.content.pm.ApplicationInfo; | |
import android.util.Log; | |
public class LogUtils { | |
private static String LOG_PREFIX = "github_"; |
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
const https = require('https'); | |
AV.Cloud.define('stencils', function (request, response) { | |
const options = { | |
hostname: 'www.autodraw.com', | |
path: '/assets/stencils.json', | |
port: 443, | |
method: 'GET', | |
headers: { |
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
<?xml version="1.0"?> | |
<root> | |
<devicevendordef> | |
<vendorname>Microsoft</vendorname> | |
<vendorid>0x045e</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>SurfaceErgonomic</productname> | |
<productid>0x0817</productid> |
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
/** | |
* Copyright (c) 2015-present, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
*/ | |
package com.facebook.react.common; |
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
function htmlDecode(str) { | |
// 有 x 则表示是16进制,$1 就是匹配是否有 x,$2 就是匹配出的第二个括号捕获到的内容,将 $2 以对应进制表示转换 | |
str = str.replace(/&#(x)?(\w+);/g, function($, $1, $2) { | |
return String.fromCharCode(parseInt($2, $1? 16: 10)); | |
}); | |
return str; | |
} |
OlderNewer