Skip to content

Instantly share code, notes, and snippets.

View sepisoltani's full-sized avatar
🎯
Focusing

Sepehr Soltani sepisoltani

🎯
Focusing
View GitHub Profile
@sepisoltani
sepisoltani / sepisoltani-iran.php
Last active January 5, 2021 12:01
Laravel Iran package
<?php
#Province methods
\Sepisoltani\Iran\Facades\Iran::get_provinces() # returns collection of all provinces
\Sepisoltani\Iran\Facades\Iran::get_approved_provinces() # returns collection of approved provinces
\Sepisoltani\Iran\Facades\Iran::find_province($id) # returns province found with the $id
@sepisoltani
sepisoltani / sepisoltan-iran-usage.php
Created January 5, 2021 12:04
sepisoltan-iran-usage.php
<?php
return [
'use_cache' => false, # change this to true if you wants to use cache
'cache_times' => [
'provinces' => 86400, # time to purge provinces methods query caches
'countries' => 86400, # time to purge countries methods query caches
'cities' => 86400, # time to purge cities methods query caches
],
@sepisoltani
sepisoltani / solidity.sol
Last active August 30, 2021 11:42
solidity.sol
// SPDX-License-Identifier: MIT
pragma solidity >0.5.2;
contract Sepehr {
struct One {
uint256 a;
uint256 b;
uint256 c;
}
@sepisoltani
sepisoltani / solidity1.sol
Created August 30, 2021 12:01
 Solidity1.sol
// SPDX-License-Identifier: MIT
pragma solidity >0.5.2;
contract Sepehr {
uint256 = 10;
uint32 = 10;
uint26 = 10;
uint8 = 10;
}
contract HelloWorld {
}
pragma solidity >=0.5.0 <0.6.0;
contract HelloWorld {
}
contract Example {
// This will be stored permanently in the blockchain
uint myUnsignedInteger = 100;
}
struct Person{
uint age;
string name;
}
contract Example{
// Array with a fixed length of 2 elements:
uint[2] fixedArray;
// another fixed Array, can contain 5 strings:
string[5] stringArray;
// a dynamic Array - has no fixed size, can keep growing:
uint[] dynamicArray;
contract Example{
Person[] people; // dynamic Array, we can keep adding to it
}