View countdown_timer.js
This file contains 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
var endDate = new Date("Feb 5, 2021 12:00:00 GMT-0800").getTime(); | |
var timer = setInterval(function() { | |
let now = new Date().getTime(); | |
let t = endDate - now; | |
if (t >= 0) { | |
let days = Math.floor(t / (1000 * 60 * 60 * 24)); |
View OpenGraphImageController.php
This file contains 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\Controllers; | |
use GDText\Box; | |
use GDText\Color; | |
use App\Post; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Cache; |
View vscode shortcut.txt
This file contains 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
Bulk Multiple cursor: | |
Mark all then Atl + shift + i |
View History|-1265a2d8|entries.json
This file contains 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
{"version":1,"resource":"file:///var/www/html/laravel/faysal.me/tailwind.config.js","entries":[{"id":"wydG.js","timestamp":1653179623574},{"id":"BSP7.js","timestamp":1653179644309},{"id":"NzRX.js","timestamp":1653179658241},{"id":"dHqh.js","timestamp":1653180285517},{"id":"OeJj.js","timestamp":1653180370243}]} |
View composer.json
This file contains 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
"repositories": [ | |
{ | |
"type": "path", | |
"url": "../pkg/laravel-admin" | |
}, | |
{ | |
"type": "vcs", | |
"url": "git@bitbucket.org:vendor/my-private-repo.git" | |
} | |
] |
View csv-to-json.php
This file contains 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 | |
/* | |
* Converts CSV to JSON | |
* Example uses the csv file of this gist | |
*/ | |
$feed="https://gist.githubusercontent.com/devfaysal/9143ca22afcbf252d521f5bf2bdc6194/raw/ec46f6c2017325345e7df2483d8829231049bce8/data.csv"; | |
//Read the csv and return as array | |
$data = array_map('str_getcsv', file($feed)); | |
//Get the first raw as the key | |
$keys = array_shift($data); |
View app.scss
This file contains 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 "./node_modules/tailwindcss/base"; | |
@import "./node_modules/tailwindcss/components"; | |
@import "./node_modules/tailwindcss/utilities"; |
View override-search-title-meta.php
This file contains 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 custom_title($title_parts) { | |
if ( is_search() ) { | |
$title_parts['title'] = get_search_query(); | |
} | |
return $title_parts; | |
} | |
add_filter( 'document_title_parts', 'custom_title' ); |
View image-preview.js
This file contains 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
//<input onchange="previewFile('#logo_preview', '#logo')" id="logo" type="file" name="logo"> | |
//<img id="logo_preview" src=""> | |
function previewFile(preview, source) { | |
var preview = document.querySelector(preview); | |
var file = document.querySelector(source).files[0]; | |
var reader = new FileReader(); | |
reader.onloadend = function () { | |
preview.src = reader.result; |
View email_scrape.php
This file contains 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 | |
$url = 'http://computerandu.wordpress.com/2011/06/29/how-to-get-google-invite/'; | |
$emails = scrape_email($url); | |
echo implode($emails, ' '); | |
function scrape_email($url) { | |
if ( !is_string($url) ) { | |
return ''; | |
} |
NewerOlder