Skip to content

Instantly share code, notes, and snippets.

@niden
niden / signing-vbox-kernel-modules.md
Created October 18, 2023 18:14 — forked from reillysiemens/signing-vbox-kernel-modules.md
Signing VirtualBox Kernel Modules

Signing VirtualBox Kernel Modules

These are the steps I followed enable VirtualBox on my laptop without disabling UEFI Secure Boot. They're nearly identical to the process described on [Øyvind Stegard's blog][blog], save for a few key details. The images here are borrowed from the [Systemtap UEFI Secure Boot Wiki][systemtap].

  1. Install the VirtualBox package (this might be different for your platform).
    src='https://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo'
@niden
niden / phpenv-install.md
Created May 4, 2020 14:11 — forked from sergeyklay/phpenv-install.md
Multiple PHP versions using phpenv and php-build

Multiple PHP versions using phpenv and php-build

Install dependecies

Debian/Ubuntu users

sudo apt install \
  autoconf \
  bison \
@niden
niden / 1_nanobox_cli.sh
Created August 27, 2019 21:55 — forked from LeCoupa/1_nanobox_cli.sh
Nanobox Cheatsheet: CLI commands and Boxfile --> https://github.com/LeCoupa/awesome-cheatsheets
# *****************************************************************************
# UPDATED VERSION AVAILABLE HERE:
# https://github.com/LeCoupa/awesome-cheatsheets/blob/master/tools/nanobox_cli.sh
# *****************************************************************************
# *****************************************************************************
# LOCAL ENVIRONMENT
# *****************************************************************************
@niden
niden / php_evaluation_order.md
Created April 15, 2019 15:10 — forked from nikic/php_evaluation_order.md
Analysis of some weird evaluation order in PHP

Order of evaluation in PHP

Yesterday I found some people on my [favorite reddit][lolphp] wonder about the output of the following code:

<?php

$a = 1;
$c = $a + $a++;
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@niden
niden / CIDR.php
Last active August 29, 2015 14:07 — forked from jonavon/CIDR.php
<?php
/**
* CIDR.php
*
* Utility Functions for IPv4 ip addresses.
* Supports PHP 5.3+ (32 & 64 bit)
* @author Jonavon Wilcox <[email protected]>
* @revision Carlos Guimarães <[email protected]>
* @version Wed Mar 12 13:00:00 EDT 2014
*/

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: