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 | |
| /** | |
| * Always treats dates as DateTime objects and adjusts their timezone | |
| * to app.timezone, if different. | |
| * | |
| * In combination with Eloquent\Model protected $dates, this trait can ensure | |
| * that: | |
| * a) whever date (string, \DateTime, \Carbon\Carbon) will always | |
| * be treated as \DateTime |
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
| alias d-yarn-install="docker run --rm -it --workdir=/myapp -v $(pwd):/myapp node yarn install" |
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 | |
| $model = DB::table('kpt160')->whereRaw( | |
| 'kpt160.room_name = :room_name AND | |
| ( | |
| (kpt160.inspection_date_begin <= :idb AND kpt160.inspection_date_end >= :idb) OR | |
| (kpt160.inspection_date_begin < :ide AND kpt160.inspection_date_end >= :ide) OR | |
| (:idb < kpt160.inspection_date_begin AND :ide > kpt160.inspection_date_begin) | |
| )', | |
| [ | |
| 'room_name' => $requestRoomId, |
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 feature branch | |
| git pull upstream master -—rebase | |
| git push origin <nama branch yang di PR> -f |
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
| ./certbot-auto certonly --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns --manual | |
| # https://certbot.eff.org/docs/using.html#dns-plugins |
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 axios from 'axios'; | |
| // You can use any cookie library or whatever | |
| // library to access your client storage. | |
| import cookie from 'cookie-machine'; | |
| axios.interceptors.request.use(function(config) { | |
| const token = cookie.get(__TOKEN_KEY__); | |
| if ( token != null ) { | |
| config.headers.Authorization = `Bearer ${token}`; |
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 | |
| // Credit: https://stackoverflow.com/questions/12684765/twitter-api-returns-error-215-bad-authentication-data | |
| $token = 'YOUR_TOKEN'; | |
| $token_secret = 'YOUR_TOKEN_SECRET'; | |
| $consumer_key = 'CONSUMER_KEY'; | |
| $consumer_secret = 'CONSUMER_SECRET'; | |
| $host = 'api.twitter.com'; | |
| $method = 'GET'; |
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
| telnet | |
| root/Zte521 | |
| sendcmd 1 DB all | |
| sendcmd 1 DB p UserInfo | |
| sendcmd 1 DB set 0 Password <PasswordBaru> | |
| sendcmd 1 DB save | |
| sendcmd 1 DB set TelnetCfg 0 TS_UPwd <PasswordBaru> |
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
| zip modified-files.zip $(git diff --name-only SHA1 SHA2) |
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 -S 0.0.0.0:8000 -t ./public -d xdebug.remote_enable=1 -d xdebug.remote_autostart=1 |