Skip to content

Instantly share code, notes, and snippets.

View samanrabiei's full-sized avatar

saman rabiei samanrabiei

View GitHub Profile
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@samanrabiei
samanrabiei / separate-numbers.js
Last active February 20, 2024 13:11 — forked from senior-x-79/separate numbers in javascript.js
جدا کردن خودکار سه رقمی اعداد فیلد ورودی
const inpNumber = document.getElementById("my-decimal-number");
inpNumber.addEventListener("keyup", handlerSeparateNumbers)
// functions
function funcReverseString(str) {
return str.split('').reverse().join('');
}
// event handlers
function handlerSeparateNumbers(e) {
@samanrabiei
samanrabiei / numberstoletters.php
Last active January 13, 2024 07:08
تبدیل عدد به حروف فارسی
با این کد می توانید در پروژه های خود اعداد مانند مبالغ را به حروف تبدیل کنید
تنها کافی است که این کد را به پروژه خود اضافه نمایید و ازش استفاده نمایید
نحوه استفاده
$number = new Number2Word;
echo $number->numberToWords(9500000);
خروجی
نه میلیون و پانصد هزار
@samanrabiei
samanrabiei / functions.php
Last active August 25, 2023 19:30 — forked from awais300/functions.php
فیلدهای سفارشی ووکامرس برای محصولات ساده و متغییر
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field