(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
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; | |
} |
// in invite.js module: | |
exports.inviteUser = function(creatingUser,email,tempPass,response) | |
{ | |
"use strict"; | |
if (!tempPass) { | |
tempPass = genRandomPass(); | |
} | |
var user = new Parse.User(); | |
user.set ("username", email); |
private static final int NOTIFICATION_ID = 1; | |
private void showForegroundNotification(String contentText) { | |
// Create intent that will bring our app to the front, as if it was tapped in the app | |
// launcher | |
Intent showTaskIntent = new Intent(getApplicationContext(), MyMainActivity.class); | |
showTaskIntent.setAction(Intent.ACTION_MAIN); | |
showTaskIntent.addCategory(Intent.CATEGORY_LAUNCHER); | |
showTaskIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
# Create your superuser | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
# Alias for convenience (optional and at your own risk) | |
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
import tweepy | |
import os | |
# Consumer keys and access tokens, used for OAuth | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' | |
access_token_secret = '' | |
# OAuth process, using the keys and tokens |
String apiKey = BuildConfig.API_KEY |
public class FusedLocationTrackerService extends InjectingService { | |
private static final String TAG = FusedLocationTrackerService.class.getSimpleName(); | |
public FusedLocationTrackerService() { | |
} | |
public static void start(Context context) { | |
Log.e(TAG, "startGPSTrackerService"); |
public class ParsePushBroadcasReceiver extends ParsePushBroadcastReceiver{ | |
/** | |
* Provide resource identifier of the small icon for each | |
* push notification in the notification bar. | |
* @param context application context | |
* @param intent intent | |
* @return the icon resource id. | |
*/ | |
@Override |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Path; | |
import android.support.annotation.NonNull; | |
import android.util.AttributeSet; | |
import android.widget.FrameLayout; | |
/** | |
* Frame layout that has rounded corners (it clips content too). |