Skip to content

Instantly share code, notes, and snippets.

View siddharthnagarro's full-sized avatar

siddharthnagarro

  • Nagarro
  • Gurgaon
View GitHub Profile
@siddharthnagarro
siddharthnagarro / validate_email.sql
Created August 14, 2023 04:45 — forked from toledorobia/validate_email.sql
MySQL - Validate email
SELECT *
FROM user
WHERE email NOT REGEXP '^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9_\-]@[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]\.[a-zA-Z]{2,4}$'
@siddharthnagarro
siddharthnagarro / Common-Currency.json
Created October 11, 2022 09:24 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@siddharthnagarro
siddharthnagarro / grab_vimeo_thumbnail.php
Created April 20, 2022 08:10 — forked from bacoords/grab_vimeo_thumbnail.php
Grab a thumbnail of a private (but embeddable) Vimeo video
<?php
/**
* Grab the url of a publicly embeddable video hosted on vimeo
* @param str $video_url The "embed" url of a video
* @return str The url of the thumbnail, or false if there's an error
*/
function grab_vimeo_thumbnail($vimeo_url){
if( !$vimeo_url ) return false;
$data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) );