This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // Used in https://github.com/im4aLL/roolith-event | |
| class Event { | |
| private static $events = []; | |
| public static function listen($name, $callback) { | |
| self::$events[$name][] = $callback; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Returns file's content using CURL. | |
| * | |
| * @param string $url | |
| * @return string | |
| */ | |
| function get_content_curl($url) | |
| { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * @author: unknown | |
| */ | |
| /** | |
| * Simulates a "wget url" and do not buffer data in the memory in order | |
| * to avoid thouse problems on large files. | |
| * | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Returns (array) number of interactions between a sender and a receiver within their respective thread. | |
| * | |
| * @param array $emails | |
| * @return array | |
| */ | |
| function getEmailThreads(array $emails) | |
| { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Given a time in -hour AM/PM format, convert it to military (24-hour) time. | |
| * | |
| * @param string $_12hourclock | |
| * @return string | |
| */ | |
| function timeConversion(string $_12hourclock) | |
| { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * It must return an integer representing the number of highest candles that can be blown. | |
| * | |
| * @param array $candles | |
| * @return integer | |
| */ | |
| function birthdayCakeCandles(array $candles) | |
| { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Given N positive integers, find the minimum and maximum values that can be | |
| * calculated by summing exactly four of the five integers. | |
| * | |
| * @param array $numbers | |
| * @return string | |
| */ | |
| function miniMaxSum(array $numbers) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Given an array of different values, calculate the fractions of its elements that are similar. | |
| * Print the decimal value of each fraction on a new line. | |
| * | |
| * @param array $values | |
| * @return string | |
| */ | |
| function plus_minus_2(array $groups) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Observe that its base and height are both equal to 'n', | |
| * and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces. | |
| * | |
| * @param integer $size | |
| * @return void | |
| */ | |
| function staircase(int $size) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Given an array of integers, calculate the fractions of its elements that are positive, | |
| * negative, and are zeros. Print the decimal value of each fraction on a new line. | |
| * | |
| * @param array $values | |
| * @return string | |
| */ | |
| function plus_minus(array $values) | 
NewerOlder