Skip to content

Instantly share code, notes, and snippets.

Nicolas Ramz warpdesign

Block or report user

Report or block warpdesign

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@warpdesign
warpdesign / iOS7_Crash.js
Created Sep 17, 2014
iOS 7.x Safari crash POC
View iOS7_Crash.js
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 Jun 16, 2014
Port redirection using ipfw
View redirect_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 Jun 16, 2014
Passing arguments to nodejs using pm2
View pm2_node_arguments
# will send--debug=7001 --trace-deprecation to nodejs executable
pm2 start myServer.js --node-args="--debug=7001 --trace-deprecation"
@warpdesign
warpdesign / pm2_options
Created Jun 16, 2014
Passing parameters to your script file
View pm2_options
# -p 8080 will be sent to your myServer.js and accessible through process.argv array
pm2 start myServer.js -- -p 8080
View pm2_watch_mode
pm2 start myServer.js --watch
@warpdesign
warpdesign / pm2_monitoring
Created Jun 16, 2014
Monitoring processes using the monit switch
@warpdesign
warpdesign / pm2_launched
Created Jun 16, 2014
Launching PM2 on an 8-core iMac with "-i max" option
View pm2_launched
{ 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 Aug 29, 2015
Enabling cluster mode with pm2
View pm2-clusters
pm2 start myServer.js -i max
View activity2.java
@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);
}
View activity2.java
@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) {
// ...
You can’t perform that action at this time.