In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
| Your name and email address were configured automatically based | |
| on your username and hostname. Please check that they are accurate. | |
| You can suppress this message by setting them explicitly: | |
| git config --global user.name "Your Name" | |
| git config --global user.email you@example.com | |
| After doing this, you may fix the identity used for this commit with: | |
| git commit --amend --reset-author |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- google's material design colours from | |
| http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
| <!--reds--> | |
| <color name="md_red_50">#FFEBEE</color> | |
| <color name="md_red_100">#FFCDD2</color> | |
| <color name="md_red_200">#EF9A9A</color> |
| // app module build.gradle | |
| apply plugin: 'com.android.application' | |
| android { | |
| compileSdkVersion rootProject.compileSdkVersion | |
| buildToolsVersion rootProject.buildToolsVersion | |
| defaultConfig { | |
| applicationId "com.segunfamisa.gradleextraproperties" | |
| minSdkVersion rootProject.minSdkVersion | |
| targetSdkVersion rootProject.targetSdkVersion |
| private boolean isServiceRunning() { | |
| ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); | |
| for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)){ | |
| if("com.example.MyNeatoIntentService".equals(service.service.getClassName())) { | |
| return true; | |
| } | |
| } | |
| return false; | |
| } |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.| export class SyncPath { | |
| constructor(rootRef, path) { | |
| this._rootRef = rootRef; | |
| this.user = this._rootRef.getAuth(); | |
| this._userDataRef = this._rootRef.child(path).child(this.user.uid); | |
| this.data = {}; | |
| this._userDataRef.on('value', (snap) => this.data = snap.val() || {}); | |
| } | |
| keys() { | |
| return Object.keys(this.data); |