Skip to content

Instantly share code, notes, and snippets.

fabianuribe / A-twitter-search-box-hack.js
Last active November 23, 2022 11:03
George's Twitter Search Box Hack Challenge
const fetchHeaders = {
accept: "*/*",
"accept-language": "en-US,en;q=0.9",
"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA", // This will expire, you can get a new one by inspecting the network requests on
"cache-control": "no-cache",
pragma: "no-cache",
'"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',
"sec-ch-ua-mobile": "?0",
fabianuribe / MIT License
Created November 23, 2022 08:43
Twitter Search Box Hack
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
fabianuribe / heap.js
Last active April 17, 2020 22:31
The Heap Data Structure in Javascript
* heap.js
* A module that implements a Doubly Linked List data Structure
* @module LinkedList
module.exports = Heap;
var TYPE_MIN = 'min';
var TYPE_MAX = 'max';
fabianuribe / gist:5878911
Created June 27, 2013 18:15
Flatten an Array Recursively
# Flatten an Array Recursively
# Imagine we have an array that potentially contains other arrays, e.g.,
# ["bananas", [1,2,3], ["apple", "cheese", [100, 20]], [true], [4.0, 7, 32]]
# Write a recursive method flatten that takes as its input an array and returns a fully flattened array.
# For example, using the above array flatten should work thus:
# array = ["bananas", [1,2,3], ["apple", "cheese", [100, 20]], [true], [4.0, 7, 32]]
fabianuribe / linked-list.js
Last active April 10, 2016 18:16
The Doubly Linked List Data Structure in Javascript
* linked-list.js
* A module that implements a Doubly Linked List data Structure
* @module LinkedList
module.exports = LinkedList;
* Represents a Linked List Node.
* @param {Object} data
fabianuribe / .vimrc
Created April 1, 2016 03:23
Development environment
execute pathogen#infect()
" don't bother with vi compatibility
set nocompatible
" enable syntax highlighting
syntax enable
" configure Vundle
filetype on " without this vim emits a zero exit status, later, because of :ft off
filetype off
fabianuribe / scrapper_test.rb
Created July 24, 2013 22:31
Scrapper Incomplete
require 'nokogiri'
doc = Nokogiri::HTML('post.html'))
def extract_usernames(doc)'.comhead > a:first-child').map do |element|
p element.inner_text
class Vehicle
attr_reader :status, :wheels
def initialize(args)
@color = args[:color]
@wheels = args[:wheels]
@status = :stopped
# Create an RPNCalculator class which can evaluate expressions written in Reverse Polish notation.
# It should have an evaluate instance method which takes as its input a valid RPN expression and returns its evaluation. Your calculator only needs to handle addition, multiplication, and subtraction (not division).
# Operators and numbers should be separated by a single space.
# For example,
# calc =