Skip to content

Instantly share code, notes, and snippets.

View mesilov's full-sized avatar
🚀
burnout

Maxim Mesilov mesilov

🚀
burnout
  • null
View GitHub Profile
@ekazakov
ekazakov / js-metaobjects.md
Last active August 29, 2015 14:16
JS Metaobjects

Пишем свою объектную модель на JavaScript

Введение

Эта статья является вольным изложением идей из этой замечательной книги JavaScript Spressore (обязательно к прочтению).

@slavcodev
slavcodev / вопросы-для-IT-собеседования
Created June 5, 2014 08:14
Нормальные вопросы для IT-собеседования
Вы ранее привлекались за хранение данных в глобальных переменных?
Вы когда-нибудь делали .Net за деньги?
Сформулируйте зависимость времени исправления критического бага от seniority присутствующего менеджера
В своём резюме вы указали знание php. вам не стыдно?
Перед вами кисть, холст и мольберт. напишите компилятор
@nalgeon
nalgeon / README.md
Last active September 10, 2020 21:24
Пример работы с DaData API на PHP
@chrismccoy
chrismccoy / gitcheats.txt
Last active April 20, 2024 08:50
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# edit all commit messages
git rebase -i --root
# clone all your repos with gh cli tool
gh repo list --json name -q '.[].name' | xargs -n1 gh repo clone
@nikic
nikic / objects_arrays.md
Last active April 12, 2024 17:05
Post explaining why objects often use less memory than arrays (in PHP)

Why objects (usually) use less memory than arrays in PHP

This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)

The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?

The key here is that objects usually have a predefined set of keys, whereas arrays don't:

@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.