Skip to content

Instantly share code, notes, and snippets.

View hsribei's full-sized avatar

Helder S Ribeiro hsribei

View GitHub Profile
@hsribei
hsribei / gist:1318423
Created October 27, 2011 00:19
A Recorder/Code generator for FireWatir
Abstract
========
This project aims at allowing users to record normal usage on a
website and then have a script generated that can reproduce such
actions.
This script is generated in Ruby and can be changed and mixed with
existing Ruby code to extend its behaviour, using regular Ruby
variables, loop constructs, etc.
@hsribei
hsribei / findPropertyValue.js
Created November 25, 2012 13:02
Find a property that has a certain value and return its object path starting at the root object parameter
// FIXME: this can very rapidly hit the call stack size limit
function findPropertyValue(obj, value) {
if (typeof obj.seenBefore === "undefined") {
// treat for object graph circularity
obj.seenBefore = true;
for (var key in obj) {
if (obj[key] == value) {
return key;
@hsribei
hsribei / parse-url-params.js
Created November 25, 2012 15:06
Parse url parameters from any string given or from current URL otherwise
// Adapted from http://stackoverflow.com/a/901144/105132
function parseUrlParams(queryString) {
var params = {},
match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = queryString || window.location.search.substring(1);
@hsribei
hsribei / can-nat-traversal-be-tor-s-killer-feature.md
Last active July 12, 2018 19:15
Can NAT traversal be Tor's killer feature?

Can NAT traversal be Tor's killer feature?

tl;dr: how about a virtual global flat LAN that maps static IPs to onion addresses?

[We all know the story][1]. Random feature gets unintentionally picked up as the main reason for buying/using a certain product, despite the creator's intention being different or more general. (PC: spreadsheets; Internet: porn; smartphones: messaging.)

@hsribei
hsribei / putting-the-tor-back-in-torrent.md
Last active January 18, 2017 22:08
Putting the "Tor" back in Torrent

Putting the "Tor" back in Torrent

How a Popcorn Time fork patch could incentivize people to run thousands of new Tor relays

This is a follow-up to this discussion: Can NAT traversal be Tor's killer feature?

If torrents are P2P's killer application, and NAT traversal/"static IP" are Tor's (via hidden services), putting them together could prove to be the best incentivization scheme for growing the Tor network other than cold crypto cash.

You're stupid

Everybody knows you're not supposed to use torrents with tor, right?

@hsribei
hsribei / read-later-plus-spaced-repetition-for-language-learners.md
Last active August 29, 2015 14:04
Wish: "Read it later" plus "spaced repetition" app for language learners

Update: found something close enough: http://readlang.com/.

Wish: "Read it later" plus "spaced repetition" app for language learners

  • All the usual ways of sending articles to this "Pocket" app: email, browser extensions, the app itself.
  • While reading, select word of phrase, have it translated and added to app as a flashcard. Front: word/phrase highlighted in context; Back: translation + optional notes.
  • Batch mode: toggle batch mode, select multiple words/phrases, have their definitions/translations all added as flashcards.
  • Optionally, go through those new cards right away (as opposed to studying them only in the random-ish order of the whole set's spaced repetition) and, when finished, go back to text. This way you can quickly go through a paragraph in batch mode, mark everything you don't understand, study it, then go back to read it with the necessary vocabulary.
  • When not reading, user can go through flashcards with a spaced repetition algorithm and interface similar to Brainscape's. From
@hsribei
hsribei / catarse_pendentes.js
Last active August 29, 2015 14:05
Somar contribuições pendentes no Catarse
// Clica no botão de rádio dos pendentes, rola a página até o fim para carregar todas as contribuições,
// abre o console, digita isso e dá Enter:
_.chain($('.value')).map(function(el){ return parseFloat($(el).text()); }).reduce(function(sum, el){ return sum + el; }, 0).value();
@hsribei
hsribei / npm-yarn-global-without-sudo.md
Created May 4, 2017 23:12
Remove need for sudo for npm install -g and yarn global add

Keybase proof

I hereby claim:

  • I am hsribei on github.
  • I am hsribei (https://keybase.io/hsribei) on keybase.
  • I have a public key whose fingerprint is CE60 7647 EE99 E678 D4BB 509A BDEE B41F 5ACF CF91

To claim this, I am signing this object:

@hsribei
hsribei / offline-emoji.md
Created November 26, 2017 11:21
Offline / no signal / lost connection emoji sequence

📶🚫