Skip to content

Instantly share code, notes, and snippets.

@jgusta
jgusta / dump_walk.php
Created November 25, 2019 06:42
A function that returns a big string version of var_dump or print_r except it descends into private props and shows things in as compact manner as possible.
<?php
if (!function_exists('dump_walk')) {
/**
* This function is like print_r($node, true) but cleaner
* @param $node
* @param string $indent_string
* @param int $depth
* @param null $parentType
* @return string
*/
@jgusta
jgusta / clearCacheFiles.php
Created April 25, 2017 17:44
The removed clearCacheFiles() function
function clearCacheFiles($cacheLocation) {
if (is_string($cacheLocation)) {
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($cacheLocation), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
if ($file->isFile()) {
@unlink($file->getPathname());
}
}
}
}
@jgusta
jgusta / gist:8787983
Last active August 29, 2015 13:55
Mango Quinoa Black Bean Salad
2 cups cooked quinoa, cooked in vegetable or chicken broth, at room temperature or chilled
1 (15-ounce) can black beans, drained and rinsed
2 medium mangos, peeled and diced
2 red bell pepper, diced
4 green onions, white and green parts thinly sliced
1/2 cup chopped fresh cilantro
4 tablespoon red wine vinegar
3 tablespoons extra virgin olive oil
1-2 tablespoons fresh lime juice
1/2 teaspoon kosher salt