A Pen by Pedro Andrรฉ on CodePen.
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
| ### Normal | |
| alias cl_ipconfig='ifconfig | grep inet' | |
| ### iOS | |
| alias cl_show_simulators='xcrun simctl list' | |
| alias cl_open_xcode_matadata='open -a finder ~/Library/Developer/Xcode' | |
| alias cl_open_provisioning_profiles='open -a finder ~/Library/MobileDevice/Provisioning\ Profiles/' |
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
| //A ๅฐๅๅธ J ๆฐ็ซน็ธฃ | |
| //B ๅฐไธญๅธ K ่ๆ ็ธฃ T ๅฑๆฑ็ธฃ | |
| //C ๅบ้ๅธ U ่ฑ่ฎ็ธฃ | |
| //D ๅฐๅๅธ M ๅๆ็ธฃ V ๅฐๆฑ็ธฃ | |
| //E ้ซ้ๅธ N ๅฝฐๅ็ธฃ W ้้็ธฃ | |
| //F ๅฐๅ็ธฃ O ๆฐ็ซนๅธ X ๆพๆน็ธฃ | |
| //G ๅฎ่ญ็ธฃ P ้ฒๆ็ธฃ | |
| //H ๆกๅ็ธฃ Q ๅ็พฉ็ธฃ Z ้ฃๆฑ็ธฃ | |
| //I ๅ็พฉๅธ |
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
| # Thanks to here https://stackoverflow.com/questions/13861658/is-it-possible-to-search-though-all-xcodes-logs | |
| EXT=".xcactivitylog" | |
| for LOG in *.xcactivitylog; do | |
| NAME=`basename $LOG $EXT` | |
| gunzip -c -S $EXT "${NAME}${EXT}" > "${NAME}.log" | |
| done |
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 insertBeforeFirstChinese(string, insertedString) { | |
| // cf. https://stackoverflow.com/questions/21109011/javascript-unicode-string-chinese-character-but-no-punctuation | |
| const index = string.split("") | |
| .findIndex(char => /\p{Script=Han}/u.test(char)) | |
| if (index > 0) { | |
| string = string.substr(0, index) + insertedString + string.substr(index); | |
| } | |
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 | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Support\Str; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Http\Response; | |
| // @TIP: Import your CacheService depends on your namespace | |
| use App\Service\Cache\CacheService; |
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 | |
| namespace App\Service\Cache; | |
| use Illuminate\Support\Facades\Cache; | |
| final class CacheService | |
| { | |
| /** | |
| * Is cache has value by given key and tags |
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 UIKit | |
| import SnapKit_Sources | |
| import PlaygroundSupport | |
| final class TestView: UIView { | |
| let labelPrimary: UILabel = { | |
| let label = UILabel() | |
| label.font = UIFont.systemFont(ofSize: 25) | |
| label.textColor = .black |
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
| # Ref: https://stackoverflow.com/questions/7787029/how-do-i-rename-all-files-to-lowercase | |
| for f in *; do mv "$f" "$f.tmp"; mv "$f.tmp" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done |
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
NewerOlder