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
@warpdesign
warpdesign / iOS7_Crash.js
Created September 17, 2014 14:49
iOS 7.x Safari crash POC
var tilesSrc = 'img/gods.png',
tilesCanvas = null,
tilesImg = null;
function getCanvasFromImage(image) {
var canvas = document.createElement('canvas');
canvas.width = image.naturalWidth;
canvas.height = image.naturalHeight;
@warpdesign
warpdesign / redirect_ipfw
Created June 16, 2014 08:58
Port redirection using ipfw
# this will redirect any incoming requests on port 80 to port 8080
ipfw add 1443 fwd 127.0.0.1,8080 tcp from any to me 80 in
@warpdesign
warpdesign / pm2_node_arguments
Created June 16, 2014 08:52
Passing arguments to nodejs using pm2
# will send--debug=7001 --trace-deprecation to nodejs executable
pm2 start myServer.js --node-args="--debug=7001 --trace-deprecation"
@warpdesign
warpdesign / pm2_options
Created June 16, 2014 08:47
Passing parameters to your script file
# -p 8080 will be sent to your myServer.js and accessible through process.argv array
pm2 start myServer.js -- -p 8080
@warpdesign
warpdesign / pm2_watch_mode
Created June 16, 2014 08:44
Using watch mode
pm2 start myServer.js --watch
@warpdesign
warpdesign / pm2_monitoring
Created June 16, 2014 07:37
Monitoring processes using the monit switch
pm2 monit
@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 β”‚
@warpdesign
warpdesign / pm2-clusters
Last active August 29, 2015 14:02
Enabling cluster mode with pm2
pm2 start myServer.js -i max
@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);
}
@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) {
// ...