Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
package org.cnii.layoutloader.ui; | |
import android.content.Context; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.View; | |
/** | |
* Special thanks to Daniel López Lacalle for his response | |
* (http://stackoverflow.com/questions/8394681/android-i-am-unable-to-have-viewpager-wrap-content/20784791#20784791) |
# Terminal Cheat Sheet | |
pwd # print working directory | |
ls # list files in directory | |
cd # change directory | |
~ # home directory | |
.. # up one directory | |
- # previous working directory | |
help # get help | |
-h # get help |
package eu.f3rog.ui.custom; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Parcelable; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
/** |
@Override | |
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); | |
callbackManager.onActivityResult(requestCode, resultCode, data); | |
GraphRequest request = GraphRequest.newMeRequest( | |
accessToken, | |
new GraphRequest.GraphJSONObjectCallback() { | |
@Override | |
public void onCompleted( |
class CreditCardNumberFormattingTextWatcher : TextWatcher { | |
private var current = "" | |
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { | |
} | |
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { | |
} | |
override fun afterTextChanged(s: Editable) { |
// See also: http://stackoverflow.com/questions/22490057/android-okhttp-with-basic-authentication | |
// Uses authenticator | |
fun login(val id: String, val password: String) { | |
var client = OkHttpClient() | |
client.authenticator = object:Authenticator() { | |
@Throws(IOException::class) | |
fun authenticate(route: Route, response: Response): Request { | |
var credential = Credentials.basic(id, password) | |
var request = response.request | |
.newBuilder() |