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
void main() { | |
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) | |
.then((_) { | |
runApp(new MyApp()); | |
}); | |
} |
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
# Twitter core rules | |
-keepattributes *Annotation* #GSON | |
-dontwarn java.nio.file.** #Okio | |
-dontwarn org.codehaus.mojo.animal_sniffer.** #Okio | |
-dontwarn javax.annotation.* #Okio | |
-dontwarn javax.annotation.concurrent.* #Okio | |
-dontnote retrofit2.Platform #Retrofit 2 | |
-dontnote retrofit2.Platform$IOS$MainThreadExecutor #Retrofit 2 | |
-dontwarn retrofit2.Platform$Java8 #Retrofit 2 | |
-keepattributes Signature #Retrofit 2 |
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
override fun success(result: Result<Tweet>?) { | |
val tweet = result!!.data | |
componentInstance.addView(TweetView(componentInstance.context, tweet, R.style.CustomTwitterStyle)) | |
invalidate() | |
} |
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
/** | |
* Reformat Twitter date to a new pattern | |
*/ | |
fun TweetView.reformatDate(newDatePattern: String) { | |
val twitterDatePattern = "EEE MMM dd HH:mm:ss Z yyyy" // Mon Apr 21 04:08:37 +0000 2018 | |
val dateTextView = findViewById<AppCompatTextView>(R.id.tw__tweet_timestamp) | |
dateTextView.text = parseDate(tweet.createdAt, twitterDatePattern).format(newDatePattern) | |
} | |
/** |
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"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<data> | |
<variable | |
name="tweetId" | |
type="com.bk.sample.android.util.databinding.ObservableString" /> | |
</data> |
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.bk.sample.android.component | |
[...] | |
import com.bk.sample.android.util.databinding.ObservableString | |
import com.twitter.sdk.android.core.Callback | |
import com.twitter.sdk.android.core.Result | |
import com.twitter.sdk.android.core.TwitterException | |
import com.twitter.sdk.android.core.models.Tweet | |
import com.twitter.sdk.android.tweetui.TweetUtils | |
import com.twitter.sdk.android.tweetui.TweetView |
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
from http.server import BaseHTTPRequestHandler, HTTPServer | |
from urllib.parse import urlparse | |
import subprocess | |
class GetHandler(BaseHTTPRequestHandler): | |
ls_l_cmd = ['ls','-l'] | |
def do_GET(self): | |
parsed_path = urlparse(self.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
apply plugin: 'com.android.application' | |
apply from: 'nonnull.gradle' | |
android { | |
compileSdkVersion 24 | |
buildToolsVersion "24.0.2" | |
[...] | |
} |
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
/** | |
* File: nonnull.gradle | |
* | |
* Generates package-info.java for appropriate packages | |
* inside src/main/java folder. | |
* | |
* This is a workaround to define @ParametersAreNonnullByDefault for all Java classes in a package | |
* i.e. including all subpackages (note: edit line no. 19). | |
*/ | |
task generateNonNullJavaFiles(dependsOn: "assembleDebug", type: Copy) { |
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
#save this file under: ~/.karabiner.d/configuration/karabiner.json | |
{ | |
"profiles": [ | |
{ | |
"name": "Default profile", | |
"selected": true, | |
"simple_modifications": { | |
"right_command": "right_option", | |
"right_option": "right_command" |
NewerOlder