Skip to content

Instantly share code, notes, and snippets.

@fabiocicerchia
fabiocicerchia / combos.php
Last active May 1, 2024 22:02 — forked from farinspace/combos.php
PHP - Generate all the possible combinations among a set of nested arrays.
/**
* Generate all the possible combinations among a set of nested arrays.
*
* @param array $data The entrypoint array container.
* @param array $all The final container (used internally).
* @param array $group The sub container (used internally).
* @param mixed $val The value to append (used internally).
* @param int $i The key index (used internally).
*/
function generate_combinations(array $data, array &$all = array(), array $group = array(), $value = null, $i = 0)
@maxim
maxim / next_episodes
Created September 27, 2010 05:14
Outputs sorted times of upcoming episodes of shows fetched from IMDB.
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'nokogiri'
require 'time'
# USAGE:
# Put ids of IMDB shows here:
movie_ids = %w(tt0773262 tt0121955 tt0182576 tt0460649 tt0903747 tt0412142)