Skip to content

Instantly share code, notes, and snippets.

View BulatSa's full-sized avatar
🎯
Working

Bulat BulatSa

🎯
Working
View GitHub Profile
<?php
$file_big = "file-big.txt";
$file_small = "file-small.txt";
$file_clear = "file-clear.txt";
function getLines($file) {
$f = fopen($file, 'r');
try {
while ($line = fgets($f)) {
<?php
$file_big = "file-big.txt";
$file_small = "file-small.txt";
$file_clear = "file-clear.txt";
function getLines($file) {
$f = fopen($file, 'r');
try {
while ($line = fgets($f)) {
@BulatSa
BulatSa / header.php
Created May 21, 2019 07:20
Open Graph for Bitrix
<head>
<!-- og -->
<meta property="og:title" content="<?$APPLICATION->ShowTitle()?>">
<meta property="og:description" content='<?=$APPLICATION->ShowProperty("description");?>'/>
<meta property="og:type" content="website" />
<meta property="og:image" content='<?=$APPLICATION->ShowProperty("ogimage","https://".$_SERVER['HTTP_HOST'].SITE_TEMPLATE_PATH."/img/og-new.jpg");?>' />
<!-- og -->
</head>
<div className="parent">
<h3 onClick={toggleView}>Утро</h3>
<div className="hidden-child">
<p>Здравствуйте!</p>
</div>
</div>
@BulatSa
BulatSa / Hide-show.js
Created October 14, 2020 19:10
Hide/show header on scroll
const body = document.body;
const nav = document.querySelector(".page-header nav");
const menu = document.querySelector(".page-header .menu");
const scrollUp = "scroll-up";
const scrollDown = "scroll-down";
let lastScroll = 0;
window.addEventListener("scroll", () => {
const currentScroll = window.pageYOffset;
if (currentScroll <= 0) {