Skip to content

Instantly share code, notes, and snippets.

@alan-andrade
alan-andrade / next.js
Last active March 31, 2021 22:01
Jump to next hotkey
javascript:(() => {
const contains = (text) => `contains(text(),'${text}')`;
const conditions = (textOrArray) => textOrArray instanceof Array ? textOrArray.map(contains) : [contains(textOrArray)];
const btnXpath = (text) => `//button[${conditions(text).join(" or ")}]`;
const divXpath = (text) => `//div[${contains(text)}]`;
const findEl = (xpath) => document.evaluate(
xpath,
document,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
@alan-andrade
alan-andrade / config.md
Created September 7, 2018 19:19 — forked from 0XDE57/config.md
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@alan-andrade
alan-andrade / Ohhh noes.txt
Created October 12, 2017 21:11 — forked from unixcharles/Ohhh noes.txt
OSX libxml2 error fix
Look like brew libxml2 and the one bundled with osx are fighting
/Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle: dlsym(0x7ffb44ee7880, Init_libxml_ruby): symbol not found - /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle (LoadError)
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml.rb:9
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `require'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.1
@alan-andrade
alan-andrade / Ioc.md
Last active July 25, 2017 23:55
Inversion Of Control

The term Inversion of control started to be used when programming started to do UI applications.

print "What's your name?"
var name = READLINE()

The control relies on the user for the program to continue.

On UI, the code has to be always running and be ready to react when the user taps the screen.

@alan-andrade
alan-andrade / checklist.md
Last active June 1, 2016 23:20
MIssing stuff
  • Aggregate total gameplays with new endpoint.
  • Empty look on lpi screen if nothing renders.
  • Last update label on calendar.
  • Position arrow under current day.
  • View layout fixes such as margin at the bottom of the page.
Elevation Bike Company (make sure they have bike)
Saturday Morning - :
module Migrator
@plan_names = %w(
com.lumosity.mobile.onemonth
com.lumosity.mobileipad.onemonth
com.lumosity.mobile.oneyear
com.lumosity.mobile.recurring.oneyear.20_off
com.lumosity.mobile.recurring.oneyear.25_off
com.lumosity.mobile.recurring.oneyear.35_off
com.lumosity.mobile.recurring.oneyear.40_off
com.lumosity.mobileipad.oneyear

Red Axes - The Watkins (as background, melodies, cheerful) Red Axes - Queen Spade (minimal, transitioner) Red Axes - Red River (melancholic melody, long notes) Red Axes - Kicks Out of you (Rough vocals, dry beat, groovy) Red Axes - Too Late To Samba (Techno ish, groove) Red Axes - Pil Sagol (deep light melodic)

Margot - Magico Disco (disco groove, good on its own, deep , nice beat drop)

Moscoman - Devoue (Manfredas Remix) (Strange melody, trippy)

Hey Folks !

Since we switched to Crashalytics, we're getting interesting emails of some failures that are happening on our application. None of them are urgent, however, it'd be awesome to consolidate our naming strategy to identify faster the point of failure.

With the refactor, there was a big effort on restructuring the system and split it into subsystems. The project ended up in a great spot and it's now easier to rationalize. In order to move this effort further, I'd like to

@alan-andrade
alan-andrade / latency.txt
Created October 26, 2015 06:31 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms