Skip to content

Instantly share code, notes, and snippets.

View fupslot's full-sized avatar
💭
I may be slow to respond.

Eugene Brodsky fupslot

💭
I may be slow to respond.
View GitHub Profile
@gabonator
gabonator / tunnelclient.js
Created November 18, 2017 15:43
simple IP tunneling using public server in nodejs
var net = require('net');
var tunnel = null;
var target = null;
// tunnel server
var serverInfo = {port:8811, host:"public.server.com"};
// target device we want to access on network where this script is running
var targetInfo = {port:1001, host:"ip.local.network"};
function listen()
@fupslot
fupslot / createBoundingBox
Last active February 2, 2016 16:03
Draws a bounding box for a given element on the page
/*
Before run the example copy and paste this function into a browser console.
Example:
createBoundingBox($0);
createBoundingBox(document.getElementById('element-id'));
*/
function createBoundingBox(parentEl) {
var body = document.body;
var pRect = parentEl.getBoundingClientRect();
var box = document.createElement('div');
@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@Unitech
Unitech / bootstrap
Last active February 9, 2018 15:22
PM2 / Keymetrics for Heroku/Rackspace/Joyent/Amazon Elasticbeanstalk/Azure...
http://pm2.keymetrics.io/docs/usage/use-pm2-with-cloud-providers/
@blackymetal
blackymetal / Measure response time with curl
Last active June 22, 2021 09:19
How to measure request/response time with curl
curl -w "@curl-format.txt" -o /dev/null -s http://www.aduanacol.com
@kgorman
kgorman / gist:134896c7414fde8e090b
Last active November 1, 2022 10:58
MongoDB Profiler Cheat Sheet
// a list of useful queries for profiler analysis. Starting with the most basic.
// 2.4 compatible
//
// output explained:
//
{
"ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred
"op" : "query", // the operation type
"ns" : "game.players", // the db and collection
@ogrrd
ogrrd / dnsmasq OS X.md
Last active April 16, 2024 20:28
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: