Skip to content

Instantly share code, notes, and snippets.

A poem is never finished, only abandoned.

-- Paul Valery

@korya
korya / Subfolder to git repo.md
Last active December 16, 2023 10:29
Convert subfolder into Git submodule
@korya
korya / Software Architecture Articles.md
Last active August 20, 2023 22:06
Software Architecture Articles
@korya
korya / Login shell vs Subshell.md
Last active May 15, 2023 22:36
.bashrc vs .bash_profile

.profile, .bash_profile, .bashrc. The Long Story.

Traditionally, when you log into a Unix system, the system would start one program for you. That program is a shell, i.e., a program designed to start other programs. It's a command line shell: you start another program by typing its name. The default shell, a Bourne shell, reads commands from ~/.profile when it is invoked as the login shell.

Bash is a Bourne-like shell. It reads commands from ~/.bash_profile when it is invoked as the login shell, and if that file doesn't exist¹, it tries reading ~/.profile instead.

@korya
korya / Mercator Projection.js
Created March 8, 2017 16:01
Mercator Projection for Google Maps JS SDK
// Base tile size used in Google Javascript SDK
const GOOGLE_BASE_TILE_SIZE = 256;
// MercatorProjection implements the Projection interface defined in Google Maps
// Javascript SDK.
//
// Google Maps Javascript SDK docs:
// https://developers.google.com/maps/documentation/javascript/maptypes#WorldCoordinates
//
// For more details about the convertions see

iGUIDE Viewer API

Constructor for the API: new IGuideViewer(iframeElement)

Methods:

  • ready() - Returns a Promise that resolves when the iGUIDE is ready to be used.
  • tour.move(position, camera, transitionType) - Transition to a different pano.
  • tour.moveCamera(camera) - Change the user's camera.
  • addEventListener(event, cb) - Subscribe to an event.
  • removeEventListener(event, cb) - Unsubscribe from an event. The cb must be the same reference to a function passed earlier to addEventListener().
@korya
korya / bug-in-design-zayin-in-debug.md
Created February 11, 2016 17:16
Bug in design, zayin in debug (explanation)

"Bug ba-design, zayin ba-debug" (Hebrew: באג בדיזיין, זין בדיבאג)

I feel sorry for the majority here - non-Israelis who can't get this joke - because it's truly one of the funniest things I've heard in a while. It is a clever play on words, even though it mixes English and Hebrew and isn't all that grammatically correct (it's not even a complete sentence). Remarkably, it is a fact of life as well.

The word zayin (slang for "dick" in Hebrew, pronounced similarly to "sign" in "design") has some of the connotations the word shit has in English. The phrase, therefore, can be translated as "A bug in the design (is) shit in the debugging" or "A bug in the design (is) shit to debug". Another way to interpret this usage of "zayin" is as a shorthand for "lekabel zayin" (lit. "to get dick" - to get screwed; carries very rude connotations), and then a loose translation could be "If there's a bug in the design, you get screwed when you debug".

The original writeup above (which is no longer with us) said this was a com

@korya
korya / Engineering Articles.md
Created March 17, 2020 12:47
Interesting Engineering Articles

sci-hub.io is down. Use the IP address directly:

# echo '31.184.194.81 sci-hub.io' >> /etc/hosts
# echo '31.184.194.81 sci-hub.org' >> /etc/hosts
# echo '31.184.194.81 sci-hub.club' >> /etc/hosts

Alternative option: scihub22266oqcxt.onion