Skip to content

Instantly share code, notes, and snippets.

View olivsinz's full-sized avatar
🎯
Focusing

OLIVIER Z. olivsinz

🎯
Focusing
View GitHub Profile
@olivsinz
olivsinz / gist:d78afc400b0350cde42203d10359f9f3
Created May 6, 2023 16:31
Apply background on product page (main-product.liquid) with main product image - Shopify
<div id="section-with-background">
<!-- product page section to apply background color to -->
</div>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
const image = new Image();
image.crossOrigin = "Anonymous";
@olivsinz
olivsinz / users_geolocation.php
Created May 23, 2020 12:45
Get Your User's Geolocation
<?php
/**
*
*/
trait UsersGeolocation
{
// Get User's Geolocation
function get_timezone()
{
@olivsinz
olivsinz / uniquable.php
Created May 23, 2020 12:23
PHP Script to Create a unique alphanumeric string like Voucher Code, Referral Code, Coupon Code, OTP or any kind of Promotional Code
<?php
/**
*
*/
trait Uniquable
{
// this function can create a unique alphanumeric string. To create a
// unique string contains letter and number (alphanumeric) with the character limit $limit. These kinds of
// unique string can be used as Voucher Code, Referral Code, Coupon Code, OTP or any kind of Promotional Code.