Skip to content

Instantly share code, notes, and snippets.

@fabianuribe
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",
authorization:
"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA", // This will expire, you can get a new one by inspecting the network requests on twitter.com
"cache-control": "no-cache",
pragma: "no-cache",
"sec-ch-ua":
'"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',
"sec-ch-ua-mobile": "?0",
@fabianuribe
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
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
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
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
fabianuribe / scrapper_test.rb
Created July 24, 2013 22:31
Scrapper Incomplete
require 'nokogiri'
doc = Nokogiri::HTML(File.open('post.html'))
def extract_usernames(doc)
doc.search('.comhead > a:first-child').map do |element|
p element.inner_text
end
class Vehicle
attr_reader :status, :wheels
def initialize(args)
@color = args[:color]
@wheels = args[:wheels]
@status = :stopped
end
# 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 = RPNCalculator.new
@fabianuribe
fabianuribe / sudoku.rb
Last active December 20, 2015 00:59
Sudoku solver version 1
sudoku_string = "003020600900305001001806400008102900700000008006708200002609500800203009005010300"
sudoku_array = sudoku_string.split('')
rows_array = Array.new(9){ sudoku_array.shift(9) }
rows_array.each{|row| p row}
box_rows_array = []
# p rows_array