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
| # homebrew-instant-php-version-swap.zsh | |
| # | |
| # @author: NasirNobin | |
| # @url https://gist.github.com/NasirNobin/3e5992608df21389dded1ac1661e1c7c | |
| # @url https://github.com/seanyeh/autosrc | |
| VALETPHPRC=".valetphprc" | |
| VALETPHPRC_IGNORE=0 | |
| valetphprc_find(){ |
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
| addEventListener("fetch", (event) => { | |
| event.respondWith( | |
| handleRequest(event.request).catch( | |
| (err) => new Response(err.stack, { status: 500 }) | |
| ) | |
| ); | |
| }); | |
| async function handleRequest(request) { | |
| const url = new URL(request.url); |
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 | |
| // default inRandomOrder()->first() takes a shit load of time, when we have large numbers of records in database; | |
| // here's a hack to make it a bit faster | |
| // it makes an additional `count()` query, be aware of that | |
| // add this to `AppServiceProvider@boot` | |
| Builder::macro("firstInRandomOrder", function () { | |
| return $this->skip(rand(0, ($this->count() - 1)))->first(); |
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
| # https://www.facebook.com/hasin/posts/10158405563459633 | |
| ffmpeg -i input.mp4 -c:v libx265 -x265-params crf=20 output.mp4 |
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 | |
| /** | |
| * Auto post to facebook from wordpress/website | |
| * Author -> Nasir Uddin Nobin | |
| */ | |
| function fb_update($ID, $post){ | |
| /** | |
| * download facebook php sdk https://github.com/facebookarchive/facebook-php-sdk | |
| * upload it to your directory and include it | |
| * if you paste this code to plugin file use (plugin_dir_path(__FILE__) |
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
| fs = require('fs') | |
| var option = process.argv[2]; | |
| fs.readdirSync('./').forEach(file => { | |
| if (/^\..*/.test(file) && option != '-a') return; | |
| console.log(file); | |
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
| fs = require('fs') | |
| const needToPrint = ['name','description','version']; | |
| const needToCopy = needToPrint.concat('dependencies'); | |
| const newJson = {}; | |
| fs.readFile('package.json', 'utf8', (err,data) => { | |
| if (err) { | |
| return console.log(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
| if [ $2 ]; then | |
| DB_NAME=$2 | |
| else | |
| DB_NAME='default_db' | |
| fi | |
| NAME=$1 | |
| TITLE=$(echo $NAME | tr 'a-z' 'A-Z') | |
| wp core download |
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
| // include jquery | |
| var x = ''; | |
| $('.item.file a').each(function(){ | |
| x+= 'http://media.pipexbd.com' + $(this).attr('href') + "\n"; | |
| }) | |
| // console.log(x); |