Skip to content

Instantly share code, notes, and snippets.

function each(array, callback) {
var i, length = array.length;
for (i = 0; i < length; i += 1) {
callback(array[i]);
}
}
function map(array, callback) {
var newArray = [];
each(array, function (item) {
module MyModule
end
class MyClass
include MyModule
end
puts MyClass.is_a? MyModule # => false
puts MyClass.new.is_a? MyModule # => true
@violarium
violarium / doctrine_annotations.php
Created December 15, 2021 13:05
doctrine_annotations_to_attributes.php
<?php
declare(strict_types=1);
$dirPath = __DIR__ . '/app/Entities';
$directory = new RecursiveDirectoryIterator($dirPath, FilesystemIterator::SKIP_DOTS);
$iterator = new RecursiveIteratorIterator($directory);
/** @var SplFileInfo $file */
foreach ($iterator as $file) {