Skip to content

Instantly share code, notes, and snippets.

View yetimdasturchi's full-sized avatar
👨‍💻
Fisting code

Manuchehr Usmonov yetimdasturchi

👨‍💻
Fisting code
View GitHub Profile
let Router = {
routes: {
"/": "index",
"/sayhello/:name": "sayhello"
},
init: function() {
this._routes = [];
for (let route in this.routes) {
let method = this.routes[route];
this._routes.push({
<?php
function clear_phone($number)
{
return preg_replace('/\D/', '', $number);
}
function validate_phone($number)
{
return boolval( preg_match("/^998(90|91|93|94|95|97|98|99|33|88)[0-9]{7}$/", $number ) );
@yetimdasturchi
yetimdasturchi / fetch-navigator.js
Created May 3, 2022 20:52
Navigate in site without reloading
var fetchBody = function( url ) {
fetch( url ).then(function (response) {
return response.text();
}).then(function (html) {
var title = html.replace(/^.*?<title>(.*?)<\/title>.*?$/s,"$1");
var body = html.replace(/^.*?<body>(.*?)<\/body>.*?$/s,"$1");
document.title = title;
document.body.innerHTML = body;
history.pushState({page:url}, null, url);
window.scrollTo({ top: 0, behavior: 'smooth' });

PHP dasturlash tilida Tic tac toe o'yini

o'yinni ishga tushirish uchun buyruqlar satrida

$: php ticTac.php

PHP dasturlash tilida Snake Xenzia o'yini

o'yinni ishga tushirish uchun buyruqlar satrida

$: php snakeGame.php

PHP dasturlash tilida otishma o'yini

o'yinni ishga tushirish uchun buyruqlar satrida

$: php shooterGame.php
@yetimdasturchi
yetimdasturchi / readme.md
Created June 21, 2022 05:32
Simple php security functions
<?php
  echo xss_clean( $unclean );
?>
@yetimdasturchi
yetimdasturchi / birnarsa.md
Last active June 28, 2022 20:01
PHP asosida yozilgan dasturlash tili

Birnarsa dasturlash tili

Birnarsa dasturlash tili php asosida ishlab chiqilgan bo'lib ekranga matn chop etish uchun foydalaniladi. Unda atiga chopet, yangiqator funskiyalari mavjud xolos.

Kod namunasi

chopet "Salom dunyo"
yangiqator
chopet "dunyo"
#include "PS2Mouse.h"
int clicked = 0;
a mouse(6,5); //clock, data
void setup(){
Serial.begin(9600);
while(!Serial);
mouse.begin();
}

Telegram chat botni linux shell orqali boshqarish

Curl kengaytmasini o'rnatish

Debian:

sudo apt install curl

Arch: