Skip to content

Instantly share code, notes, and snippets.

View tyxla's full-sized avatar
🌴
On vacation

Marin Atanasov tyxla

🌴
On vacation
View GitHub Profile
@jsnajdr
jsnajdr / calypso-performance-antipatterns.md
Last active February 7, 2018 12:01
Common Performance Anti-Patterns in Calypso

Anti-Patterns

  • too many rerenders, mostly because of inefficient selectors
  • computing something just to throw it away
  • initializing everything during Calypso boot

Be aware how Redux update cycle works

  • action dispatch calls reducer
  • reducer produces a new state (almost always)
@tyxla
tyxla / gist:1685d1a60595ab6bd717abbafa3368e4
Created October 4, 2017 07:14
Remove empty lines between ES6 imports recursively in a directory (using multiline regex find and replace with perl)
find . -type f -exec perl -0777 -i -p -e 's/(import[^\n\r]+)[\n\r]{2,}(import[^\n\r]+)/\1\n\2/igs' {} +
@tyxla
tyxla / gist:fe296c9c7de428d43114dfd3d2086462
Last active September 23, 2026 11:52
Excel формула за транслитерация на кирилица към латиница - Excel formula for transliteration of Bulgarian Cyrillic to Latin
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(D2,"я", "ya"),"ю", "yu"),"ъ", "y"),"щ", "sht"),"ш", "sh"),"ч", "ch"),"ц", "c"),"х", "h"),"ф", "f"),"у", "u"),"т", "t"),"с", "s"),"р", "r"),"п", "p"),"о", "o"),"н", "n"),"м", "m"),"л", "l"),"к", "k"),"й", "y"),"и", "i"),"з", "z"),"ж", "j"),"е", "e"),"д", "d"),"г", "g"),"в", "v"),"б", "b"),"а", "a"),"Я", "Ya"),"Ю", "Yu"),"ь", "Y"),"Ъ", "Y"),"Щ", "Sht"),"Ш", "Sh"),"Ч", "Ch")
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active July 12, 2026 14:01
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount ✓ Constructor equivalent for createClass
render Create and return element(s)
componentDidMount ✓ ✓ DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps ✓ Update state based on changed props
@ericelliott
ericelliott / essential-javascript-links.md
Last active September 21, 2026 15:29
Essential JavaScript Links
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 9, 2026 03:36
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: