(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:
| 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 |
| # 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 |
| 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); |
| // 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 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; | |
| } |