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 sys | |
| import os | |
| import glob | |
| import win32com.client | |
| def convert(files, formatType = 32): | |
| powerpoint = win32com.client.Dispatch("PowerPoint.Application") | |
| powerpoint.Visible = 1 | |
| for filename in 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
| FROM alpine:3.4 | |
| RUN apk --no-cache --update add \ | |
| php5 \ | |
| php5-cli \ | |
| php5-pcntl \ | |
| php5-posix \ | |
| php5-sockets \ | |
| php5-mysql \ | |
| php5-zip \ | |
| php5-phar \ |
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 | |
| foreach (\Yii::$app->getModules() as $id => $child) { | |
| if(in_array($id, ['gii', 'debug'])) { | |
| continue; | |
| } | |
| $module = \Yii::$app->getModule($id); | |
| $namespace = $module->controllerNamespace."\\"; | |
| $dir = $module->controllerPath; | |
| $fileList = glob($dir."/*Controller.php"); |
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 | |
| $begin = microtime(true); | |
| $url = 'http://cdn-1.yi-you.org/courseware/4202ee83f0d8a3944c4b72dd/4ba56224b2498ae0931fe1f108bee658.pdf'; | |
| $total = 71; | |
| $urls = []; | |
| for ($i = 1; $i <= $total; $i++) { | |
| $urls[] = $url . '?odconv/jpg/page/' . $i . '/density/288/quality/92/resize/1280'; | |
| } | |
| if(!is_dir('images')) { |
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 | |
| /** | |
| * I had to parse an XLSX spreadsheet (which should damn well have been a CSV!) | |
| * but the usual tools were hitting the memory limit pretty quick. I found that | |
| * manually parsing the XML worked pretty well. Note that this, most likely, | |
| * won't work if cells contain anything more than text or a number (so formulas, | |
| * graphs, etc ..., I don't know what'd happen). | |
| */ |
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
| git remote show origin | |
| git remote prune origin |
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 | |
| $a = [ | |
| '1,2', | |
| '3', | |
| '4', | |
| '5,6' | |
| ]; | |
| $hash = [ | |
| 1 => 'xxx1', |
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 | |
| function make_semiangle($str){ | |
| $arr = array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', | |
| '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', | |
| 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E', | |
| 'F' => 'F', 'G' => 'G', 'H' => 'H', 'I' => 'I', 'J' => 'J', |
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
| function dump() | |
| { | |
| $args = func_get_args(); | |
| echo "\n<pre style=\"border:1px solid #ccc;padding:10px;margin:10px;font:14px courier;background:whitesmoke;display:block;border-radius:4px;\">\n"; | |
| $trace = debug_backtrace(false); | |
| $offset = (@$trace[2]['function'] === 'dump_d') ? 2 : 0; | |
| echo "<span style=\"color:red\">" . @$trace[1+$offset]['class'] . "</span>:" . |
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 | |
| class Tuple extends SplFixedArray | |
| { | |
| protected $prototype; | |
| public function __construct(array $prototype, array $data = []) | |
| { | |
| echo __METHOD__ . "\r\n"; | |
| parent::__construct(count($prototype)); |