Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View warpdesign's full-sized avatar
🏠
Working from home

Nicolas Ramz warpdesign

🏠
Working from home
View GitHub Profile
public void overridePendingTransition (int enterAnim, int exitAnim)
@warpdesign
warpdesign / activity_in.xml
Last active August 29, 2015 14:01
In transition of activity 2
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="100%"
android:toXDelta="0"
android:duration="200" />
</set>
@warpdesign
warpdesign / activity_out.xml
Last active August 29, 2015 14:01
Out activity of activity 1
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="-100%"
android:duration="200" />
</set>
@warpdesign
warpdesign / activity_back_in.xml
Created May 15, 2014 09:51
In activity of activity 1
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="-100%"
android:toXDelta="0"
android:duration="200" />
</set>
@warpdesign
warpdesign / activity_back_out.xml
Created May 15, 2014 09:51
Out activity of activity 2
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="100%"
android:duration="200" />
</set>
public void onShouldStartActivity() {
// creation of intent to start activity2
Intent intent = new Intent(this, Activity2.class);
startActivity(intent);
// Following the documentation, right after starting the activity
// we override the transition
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
switch(id) {
// ...
@Override
public void onBackPressed() {
// finish() is called in super: we only override this method to be able to override the transition
super.onBackPressed();
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
}
@warpdesign
warpdesign / pm2-clusters
Last active August 29, 2015 14:02
Enabling cluster mode with pm2
pm2 start myServer.js -i max
@warpdesign
warpdesign / pm2_launched
Created June 16, 2014 07:29
Launching PM2 on an 8-core iMac with "-i max" option
{ online: true, success: true, pid: 1113, pm2_version: '0.8.13' }
PM2 Process launched
┌──────────┬────┬─────────┬──────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼──────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ server │ 0 │ cluster │ 1114 │ online │ 0 │ 0s │ 29.738 MB │ unactivated │
│ server │ 1 │ cluster │ 1115 │ online │ 0 │ 0s │ 29.934 MB │ unactivated │
│ server │ 2 │ cluster │ 1116 │ online │ 0 │ 0s │ 30.063 MB │ unactivated │
│ server │ 3 │ cluster │ 1117 │ online │ 0 │ 0s │ 29.703 MB │ unactivated │
│ server │ 4 │ cluster │ 1118 │ online │ 0 │ 0s │ 30.293 MB │ unactivated │