Skip to content

Instantly share code, notes, and snippets.

View TamerShlash's full-sized avatar

Tamer Shlash TamerShlash

View GitHub Profile
@Ronin1702
Ronin1702 / AccessingLocalhostfromiPhone.md
Last active December 16, 2025 00:30
Accessing Localhost from iPhone

Accessing Localhost from iPhone

If you are developing a web application and want to test it on your iPhone, you can access your localhost development server directly from your iPhone. Here's how to do it:

Prerequisites

  • Ensure both your development machine and iPhone are connected to the same local network (e.g., the same WiFi).

1. Find Your Local IP Address

@danharper
danharper / 1-sleep-es7.js
Created February 8, 2015 16:55
ES7's async/await syntax.
// ES7, async/await
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
(async () => {
console.log('a');
await sleep(1000);
console.log('b');
})()
@michaelv
michaelv / facebook-mass-delete-group-members.js
Created April 21, 2014 15:00
This javascript removes all users from a facebook group. It works with the new facebook layout. Paste this in the javascript console. Script tested in Firefox. Known issues: 1. when facebook responds slowly, the script might experience hickups.. 2. occasionially, the error 'this user is not a member of the group' pops up.. IMPORTANT: add your ow…
var deleteAllGroupMembers = (function () {
var deleteAllGroupMembers = {};
// the facebook ids of the users that will not be removed.
// IMPORTANT: add your own facebook id here so that the script will not remove yourself!
var excludedFbIds = ['1234','11223344']; // make sure each id is a string!
var usersToDeleteQueue = [];
var scriptEnabled = false;
var processing = false;
deleteAllGroupMembers.start = function() {
@ChengLong
ChengLong / run_long_process_in_background.rb
Last active April 19, 2021 20:59
Run Background Process in Sinatra
require 'sinatra'
get '/long_process' do
child_pid = Process.fork do
# hard work is done here...
sleep 10
Process.exit
end
@dangerbell
dangerbell / express-app.coffee
Created November 1, 2012 20:16
Example code for Node Testing with Mocha, SuperTest, and Nock
express = require 'express'
app = express();
# Configure
require('./config')(app)
# Routes
require('./routes')(app)
module.exports = app
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static