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 | |
| /** | |
| * 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
| <?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 | |
| 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
| 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
| 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
| #!/bin/bash | |
| docker stats $(docker ps | awk '{if(NR>1) print $NF}') |
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
| func calcMd5(filePath string) string { | |
| f, err := os.Open(filePath) | |
| if err != nil { | |
| log.Fatal(err) | |
| } | |
| defer f.Close() | |
| h := md5.New() | |
| if _, err := io.Copy(h, f); err != nil { | |
| log.Fatal(err) |
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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/garyburd/redigo/redis" | |
| "strconv" | |
| "strings" | |
| "time" | |
| ) |
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
| # Aliyun mirror | |
| deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse | |
| deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse | |
| deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse | |
| deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse | |
| deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse |