Skip to content

Instantly share code, notes, and snippets.

@naderchehab
naderchehab / debounced-scroll.js
Created August 10, 2020 03:34 — forked from victorouse/debounced-scroll.js
Interview questions
// Write debounce, then debounce a scroll event
function onScrollFunction(arg) {
console.log('scrolling ' + arg);
}
function debounce(fn, wait) {
let timeout;
return function(...args) {
@naderchehab
naderchehab / dom.html
Created August 10, 2020 03:25 — forked from victorouse/dom.html
Facebook Interview: Given two identical DOM tree structures, A and B, and a node from A, find the corresponding node in B
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Facebook DOM Traversal</title>
</head>
<body>
<div id="rootA">
<div>

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@naderchehab
naderchehab / editable-table.js
Created May 31, 2014 11:55
Editable table in React
/** @jsx React.DOM */
var EditableCell = React.createClass({
getInitialState: function () {
return {
isEditMode: false,
data: ""
};
},
componentWillMount: function () {
// object type function prototype
var HelloWorld = function () {
// private function
function sayHelloWorld(workParam) {
return "Hello World " + workParam.userName;
};
// function that matches the unit of work defined work function
this.getHelloWorld = function (workParam) {