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 | |
| Route::get('mp4-stream/{filename}', function($filename){ | |
| $contentType = "video/mp4"; | |
| $path = $filename; | |
| $fullsize = filesize($path); | |
| $size = $fullsize; | |
| $stream = fopen($path, "r"); | |
| $response_code = 200; | |
| $headers = array("Content-type" => $contentType); | |
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
| import os | |
| import sys | |
| import site | |
| # Calculates the path based on location of WSGI script. | |
| apache_configuration = os.path.realpath(os.path.dirname(__file__)) | |
| project = os.path.join(apache_configuration, 'nomedoproto') | |
| sys.path.append(apache_configuration) | |
| sys.path.append(project) |
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
| def hack1(n, k): | |
| def f(s): | |
| return s.count('1') | |
| binaries = [] | |
| for x in range(2**n): | |
| binaries.append(bin(x)) | |
| binaries.sort(key=f, reverse = True) | |
| return binaries[k - 1] | |
| def hack(n, k): |
NewerOlder