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 initAutoComplete() { | |
var input = document.getElementById("grid-address"); | |
var autocomplete = new google.maps.places.Autocomplete(input); | |
autocomplete.addListener("place_changed", function () { | |
let place = autocomplete.getPlace(); | |
let address = ""; | |
if (place.address_components) { | |
address = [ |
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 | |
public function downloadFile(Request $request) | |
{ | |
// !VALIDATE USER HAS ACCESS | |
// Get response and clean before return | |
$response = Storage::download(FILE_PATH_HERE); | |
ob_end_clean(); |
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
performance_schema = 0 | |
show_compatibility_56 = 1 |
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 | |
/** | |
* Sell only in specific states | |
*/ | |
add_filter( 'woocommerce_states', 'wc_sell_only_states' ); | |
function wc_sell_only_states( $states ) | |
{ | |
$states['US'] = [ | |
'AL' => __( 'Alabama', 'woocommerce' ), | |
'AK' => __( 'Alaska', 'woocommerce' ), |
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
background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); | |
background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px), calc(100% - 2.5em) 0.5em; | |
background-size: 5px 5px, 5px 5px, 1px 1.5em; | |
background-repeat: no-repeat; |
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
git config --global alias.workprofile 'config user.email "mike@work.dev"' |
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
for i in "$@" | |
do | |
case $i in | |
-o=*|--one=*) | |
ONE="${i#*=}" | |
shift | |
;; | |
-t=*|--two=*) | |
TWO="${i#*=}" | |
shift |
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 validateEmail(email) | |
{ | |
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return re.test(email); | |
} |
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 | |
public function convert($size) | |
{ | |
$unit = ['b','kb','mb','gb','tb','pb']; | |
return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $unit[$i]; | |
} | |
?> |
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
// Create a FileManager instance | |
let fileManager = NSFileManager.defaultManager() | |
// Rename 'hello.swift' as 'goodbye.swift' | |
do { | |
try fileManager.moveItemAtPath("hello.swift", toPath: "goodbye.swift") | |
} catch let error as NSError { | |
print("Ooops! Something went wrong: \(error)") | |
} |
NewerOlder