Skip to content

Instantly share code, notes, and snippets.


Mohamed Ahmed mohamed-ahmed

  • Ottawa, Canada
View GitHub Profile
View Custom sublime-text key bindings (Windows)
//ctrl+i to indent lines properly like in eclipse (Windows)
{ "keys": ["ctrl+i"], "command": "reindent" }
//ctrl+i to indent lines properly like in eclipse (Mac OSX)
{ "keys": ["super+i"], "command": "reindent" }
View application.js
var q= function(s){ return document.getElementById(s) }
function send(){
var input = q('text');
input.value = '';
var socket = new io.Socket(null, {
port: 8001,
mohamed-ahmed /
Created Jun 16, 2014
Get ip address of usb0 device (Linux)
ifconfig | grep usb -1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'
mohamed-ahmed / static_server.js
Last active Aug 29, 2015
Small block of code to serve static files using node (useful for debugging when "XMLHttpRequest cannot load file..")
View static_server.js
var express = require('express');
var app = express();
var path = require('path');
app.get('/', function(req, res) {
app.use(express.static(path.join(__dirname, '/')));
You can’t perform that action at this time.