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
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)); |
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\Controllers; | |
use GDText\Box; | |
use GDText\Color; | |
use App\Post; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Cache; |
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
Bulk Multiple cursor: | |
Mark all then Atl + shift + 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
{"version":1,"resource":"file:///var/www/html/laravel/filament/app/Models/User.php","entries":[{"id":"gjXE.php","timestamp":1663760020239},{"id":"xJ9X.php","timestamp":1663760031893}]} |
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
"repositories": [ | |
{ | |
"type": "path", | |
"url": "../pkg/laravel-admin" | |
}, | |
{ | |
"type": "vcs", | |
"url": "[email protected]:vendor/my-private-repo.git" | |
} | |
] |
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 | |
/* | |
* 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); |
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 "./node_modules/tailwindcss/base"; | |
@import "./node_modules/tailwindcss/components"; | |
@import "./node_modules/tailwindcss/utilities"; |
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 custom_title($title_parts) { | |
if ( is_search() ) { | |
$title_parts['title'] = get_search_query(); | |
} | |
return $title_parts; | |
} | |
add_filter( 'document_title_parts', 'custom_title' ); |
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
//<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; |
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 | |
$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