Skip to content

Instantly share code, notes, and snippets.

@cezaraugusto
cezaraugusto / introrx.md
Created February 18, 2016 12:55 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

Keybase proof

I hereby claim:

  • I am cezaraugusto on github.
  • I am cezaraugusto (https://keybase.io/cezaraugusto) on keybase.
  • I have a public key whose fingerprint is 684F C83A 5EDD 5FD2 3741 A4D0 6104 DCBB 0892 716B

To claim this, I am signing this object:

@cezaraugusto
cezaraugusto / .profile
Created December 28, 2016 17:58 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@cezaraugusto
cezaraugusto / what-forces-layout.md
Created June 16, 2017 01:19 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@cezaraugusto
cezaraugusto / gpg_fix.txt
Last active November 7, 2024 16:39
fixing `gpg failed to sign data` error on macOS
For troubleshooting, two things to first try:
run `git config --global gpg.program gpg2`, to make sure git uses gpg2 and not gpg
run `echo "test" | gpg2 --clearsign`, to make sure gpg2 itself is working
If that all looks all right, one next thing to try:
run `brew install pinentry` to ensure you have a good tool installed for passphrase entry
If after that install and you re-try git commit and still get the "failed to sign the data" error:
run `gpgconf --kill gpg-agent` to kill any running agent that might be hung
@cezaraugusto
cezaraugusto / darkmode.css
Created August 25, 2017 13:52
dark mode for webviews
/** That's it. Thank you. */
filter: sepia(0.9) brightness(0.8);
@cezaraugusto
cezaraugusto / broken_topsites.js
Created February 1, 2018 02:58
top sites bad profile
{"cache":{"ledgerVideos":{}},"settings":{"general.is-default-browser":true,"security.flash.installed":true},"windows":[],"perWindowState":[],"migrations":{"batMercuryTimestamp":1517426623687,"btc2BatTimestamp":1517426623687,"btc2BatNotifiedTimestamp":1517426623687,"btc2BatTransitionPending":false},"visits":[],"notifications":[],"ledger":{"about":{"synopsis":[],"synopsisOptions":{"_a":7000,"_b":1000,"scorekeeper":"concave","_d":0.000033333333333333335,"numFrames":30,"frameSize":86400000,"emptyScores":{"concave":0,"visits":0},"_b2":1000000,"scorekeepers":["concave","visits"],"_a2":14000,"_a4":28000,"minPublisherVisits":1,"minPublisherDuration":8000}},"info":{"hasBitcoinHandler":false},"promotion":{},"synopsis":{"options":{"_a":7000,"_b":1000,"scorekeeper":"concave","_d":0.000033333333333333335,"numFrames":30,"frameSize":86400000,"emptyScores":{"concave":0,"visits":0},"_b2":1000000,"scorekeepers":["concave","visits"],"_a2":14000,"_a4":28000,"minPublisherVisits":1,"minPublisherDuration":8000},"publishers":{}}},"s
@cezaraugusto
cezaraugusto / tsconfig.json
Created September 22, 2019 21:59
JSON schema for the TypeScript compiler's configuration file
{
"title": "JSON schema for the TypeScript compiler's configuration file",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"filesDefinition": {
"properties": {
"files": {
"description": "If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.",
"type": "array",
@cezaraugusto
cezaraugusto / playlist_error.sh
Created November 27, 2019 13:01
error log executing videos in an extension
[52100:775:1126/182106.918056:WARNING:ca_layer_tree_coordinator.mm(55)] Blank frame: No overlays or CALayers
[52106:85763:1126/182111.970259:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Could not parse slice header"}
[52106:85763:1126/182111.970929:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 3"}
[52106:85763:1126/182111.971157:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"video decode error"}
[52106:775:1126/182112.019032:ERROR:batching_media_log.cc(26)] MediaEvent: PIPELINE_ERROR PIPELINE_ERROR_DECODE
[52106:85763:1126/182115.427723:ERROR:ffmpeg_decoding_loop.cc(28)] Failed to send packet for decoding: -1094995529
[52106:85763:1126/182115.427854:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Failed to send audio packet for decoding: timestamp=3900952 duration=23220 size=375 side_data_size=0 is_key_frame=1 encrypted=0 discard_padding (us)=(0, 0)"}
[52106:85763:1126/182115.428
@cezaraugusto
cezaraugusto / install_chrome_extension.sh
Created June 10, 2024 14:16
Install a Chrome extension from the command line (macOS)
#!/bin/bash
# https://developer.chrome.com/docs/extensions/mv3/external_extensions/#preferences
install_chrome_extension() {
chrome_extensions_folder="/Library/Application Support/Google/Chrome/External Extensions"
chrome_extensions_preferences_file="$chrome_extensions_folder/$1.json"
# This URL is used by Chrome to check for updates to external extensions
update_services_url="https://clients2.google.com/service/update2/crx"