Skip to content

Instantly share code, notes, and snippets.

View dezull's full-sized avatar
🏠
Working from home

Dzul Nizam dezull

🏠
Working from home
View GitHub Profile
@matti
matti / pty_spawn_stderr_stdout.rb
Created June 23, 2017 08:14
Separates Ruby PTY spawn stderr from stdout
require "pty"
stderr_reader, stderr_writer = IO.pipe
args = ["-c", "read a; echo was: $a; echo err:$a >&2"]
stdout,stdin,pid = PTY.spawn("/bin/bash", *args, err: stderr_writer.fileno)
stderr_writer.close
stdin.puts "hello"
@paulirish
paulirish / what-forces-layout.md
Last active July 27, 2024 23:38
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.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@lizkrznarich
lizkrznarich / after_jackson_v2upgrade.json
Last active April 12, 2016 12:14
ORCID JSON Pre/Post 2015-05-05 Jackson Upgrade
{
"message-version" : "1.2",
"orcid-profile" : {
"orcid" : null,
"orcid-id" : null,
"orcid-identifier" : {
"value" : null,
"uri" : "http://localhost:8080/orcid-web/0000-0001-8451-0064",
"path" : "0000-0001-8451-0064",
"host" : "localhost"
@rmondello
rmondello / gist:b933231b1fcc83a7db0b
Last active April 5, 2024 07:10
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

Update (October 2021)

Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.

Original, Obsolete Content (2014)

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.