I hereby claim:
- I am amirkhiz on github.
- I am habil (https://keybase.io/habil) on keybase.
- I have a public key ASDT1ZcD9RZiUQOcrqb1jQ2fewEmmYkquGViyofv9xRJ9Ao
To claim this, I am signing this object:
<?php | |
/** | |
* Reference/source: http://stackoverflow.com/a/1464155/933782 | |
* | |
* I want a short alphanumeric hash that’s unique and who’s sequence is difficult to deduce. | |
* I could run it out to md5 and trim the first n chars but that’s not going to be very unique. | |
* Storing a truncated checksum in a unique field means that the frequency of collisions will increase | |
* geometrically as the number of unique keys for a base 62 encoded integer approaches 62^n. | |
* I’d rather do it right than code myself a timebomb. So I came up with this. | |
* |
<?php | |
// Reference https://codebriefly.com/unique-alphanumeric-string-php/ | |
function unique_code($limit) | |
{ | |
return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); | |
} | |
echo unique_code(8); |
<?php | |
function getPotentialDomains( $lines ) { | |
$re = '~((https|http){1}://(www|ww2|web)?(\.)?(([a-z0-9\-])+\.)+([a-z]{2,}){1})~ui'; | |
$domains = []; | |
foreach ( $lines as $line ) { | |
preg_match_all( $re, $line, $matches, PREG_SET_ORDER, 0 ); | |
$domains = array_merge( $domains, $matches ); |
Billy Chia Billy Chia | |
E.164 is the international telephone numbering plan that ensures each device on the PSTN has globally unique number. | |
This is what allows phone calls and text messages can be correctly routed to individual phones in different countries. | |
E.164 numbers are formatted [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits. | |
Examples of E.164 Numbers | |
E.164 Format Country Code Country Subscriber Number | |
+14155552671 1 US 4155552671 | |
+442071838750 44 GB 2071838750 |
I hereby claim:
To claim this, I am signing this object:
find * -type d -print0 | xargs -0 chmod 0755 # for directories | |
find . -type f -print0 | xargs -0 chmod 0644 # for files | |
stat -c "%a %n" * # Check permissions |
class Controller { | |
public function search() | |
{ | |
$kelime = $_POST['query']; | |
$result = $this->site_model->search($keyword); | |
foreach ($result as $item) { | |
switch ($item->type) { | |
case 'products': |
$('#frm-human-res').submit(function (e) { | |
e.preventDefault(); | |
var form_data = new FormData(), | |
cv_file = document.getElementById("upload-btn").files[0]; | |
var other_data = $(this).serializeArray(); | |
$.each(other_data, function (key, input) { | |
form_data.append(input.name, input.value); | |
}); |
function generateUniqueId() | |
{ | |
mt_srand(); | |
$order_no = substr(md5(uniqid(mt_rand())), 0, 8); | |
return $order_no; | |
} |