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 art="php artisan" | |
| alias dracarys="git reset --hard && git clean -df" | |
| alias phpfix="php php-cs-fixer.phar fix" | |
| alias weather='curl -s wttr.in/Hurghada | sed -n "2,7p"' | |
| alias usd='curl -s "https://www.google.com/finance/converter?a=1&from=USD&to=EGP" | LC_CTYPE=C sed "/res/!d;s/<[^>]*>//g"' | |
| alias shrug="echo '¯\_(ツ)_/¯' | pbcopy"; | |
| alias fight="echo '(ง'̀-'́)ง' | pbcopy"; | |
| alias happy="echo 'ᕕ( ᐛ )ᕗ' | pbcopy"; | |
| # Commit all the current changes with a message |
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 | |
| $input = 'nome:ps4 sku:SKU7889-988;OI99129 data:10/12/2016 nome:Playstation 4 nome:Nintendo Wii sku:TESTE123 9aos'; | |
| preg_match_all('/(?:([^: ]+):)([^: ]+(?:\s+[^: ]+\b(?!:))*)/', $input, $matches, PREG_SET_ORDER); | |
| echo $input; | |
| echo '<pre>'; | |
| print_r($matches); | |
| echo '</pre>'; |
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 | |
| /** | |
| * Config for PHP-CS-Fixer ver2 | |
| */ | |
| $rules = [ | |
| '@PSR2' => true, | |
| // addtional rules |
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 | |
| # You can call this script like this: | |
| # $./volume.sh up | |
| # $./volume.sh down | |
| # $./volume.sh mute | |
| function get_volume { | |
| amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1 | |
| } |
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
| # Before usage make sure to have a working mail setup. | |
| # If you are not sure what that means and you run Ubuntu just run "apt install mailutils" and | |
| # choose following settings (be sure to replace example.com with your domain): | |
| # General type of mail configuration?: Internet Site | |
| # System mail name: example.com | |
| # Root and postmaster mail recipient: username | |
| # Other destinations to accept mail for: $myhostname, example.com, mail.example.com, localhost.example.com, localhost | |
| # Force synchronous updates on mail queue?: No | |
| # Local networks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 |
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
| { | |
| "type": "index_hadoop", | |
| "spec": { | |
| "ioConfig": { | |
| "type": "hadoop", | |
| "inputSpec": { | |
| "paths": "hdfs://analytics-hadoop/tmp/gsc-all.csv.gz", | |
| "type": "static" | |
| } | |
| }, |
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 | |
| return PhpCsFixer\Config::create() | |
| ->setRiskyAllowed(true) | |
| ->setRules([ | |
| '@PSR2' => true, | |
| 'array_syntax' => ['syntax' => 'short'], | |
| 'binary_operator_spaces' => | |
| [ | |
| 'align_equals' => true, |
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 | |
| require_once __DIR__.'/relative/path/to/PrettierPHPFixer/File'; | |
| return PhpCsFixer\Config::create() | |
| ->registerCustomFixers([ | |
| (new PrettierPHPFixer()), | |
| ]) | |
| ->setRules([ | |
| 'Prettier/php' => true, |
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
| WITH RECURSIVE traversed (id, name, path, `left`, `right`) AS ( | |
| SELECT id, | |
| name, | |
| CAST(JSON_ARRAY(id) AS JSON), | |
| `left`, | |
| `right` | |
| FROM binary_tree | |
| WHERE id = 1 | |
| UNION | |
| SELECT b.id, |
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
| -- models/example_model.sql | |
| {{ config( | |
| materialized='rollup', | |
| rollups={ | |
| "hourly": "date_trunc('hour', event_time)", | |
| "daily": "date_trunc('day', event_time)" | |
| }, | |
| aggregates={ |