Skip to content

Instantly share code, notes, and snippets.

View Sanusihassan's full-sized avatar

Sanusi Hassan Sanusihassan

View GitHub Profile
@Sanusihassan
Sanusihassan / gist:503da1c9567eb14d83e39ccf8e1743f1
Last active November 13, 2023 16:58
fb-add-friend script
function findElementsWithText(text) {
let elements = [];
let iterator = document.evaluate('//*[contains(text(), "' + text + '")]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
let thisNode = iterator.iterateNext();
while (thisNode) {
elements.push(thisNode);
thisNode = iterator.iterateNext();
}
@Sanusihassan
Sanusihassan / .c
Last active September 1, 2022 13:16
Binary Tree implementation in c
#include <stdio.h>
#include <stdlib.h>
typedef struct tree
{
int data;
struct tree *left;
struct tree *right;
} tree_node;
tree_node *create(int data, tree_node *left, tree_node *right)
{