Skip to content

Instantly share code, notes, and snippets.

View balamyt92's full-sized avatar
🐯

Anatoly balamyt92

🐯
View GitHub Profile
<body>
<div id="data" data-supra="<?= htmlspecialchars((string)new Result($_GET['id'])) ?>"></div>
<script>
// supra js
</script>
</body>
@balamyt92
balamyt92 / xorg
Created February 14, 2019 07:32
xorg config
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 390.77 (buildmeister@swio-display-x64-rhel04-14) Tue Jul 10 23:19:22 PDT 2018
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 390.77 (buildd@lcy01-amd64-022) Thu Sep 6 07:51:39 UTC 2018
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
@balamyt92
balamyt92 / getScritp.js
Created December 28, 2018 03:32
native js $.getScript
function getScript(source, callback) {
var script = document.createElement('script');
var prior = document.getElementsByTagName('script')[0];
script.async = 1;
script.onload = script.onreadystatechange = function( _, isAbort ) {
if(isAbort || !script.readyState || /loaded|complete/.test(script.readyState) ) {
script.onload = script.onreadystatechange = null;
script = undefined;
<div class="embed-video" data-oembed-url="https://www.youtube.com/watch?v=_CK5Kag7enw">
<div style="left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.2493%;">
<iframe allow="autoplay; encrypted-media" allowfullscreen="" scrolling="no" src="https://www.youtube.com/embed/_CK5Kag7enw?rel=0&amp;showinfo=0" style="border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;" tabindex="-1"></iframe>
</div>
</div>
function Andry(iteration, sleep, fn, finish, error)
{
let promise = new Promise((resolve, reject) => {
setTimeout(() => {
console.log(iteration);
resolve(true);
}, sleep);
});
promise
.then(
function showToggle(item, flag) {
if (flag) {
item.show();
} else {
item.hide();
}
return flag;
}
function Element($el) {
@balamyt92
balamyt92 / scratch.html
Created June 29, 2017 07:07
yandex map example
<div id="js-contacts-map"
data-coordx="55.9919811255658"
data-coordy="92.88684045689777"
data-zoom="12" data-address="Копылова 78"
class="my-class-for-map-container">
</div>
<!-- Перед /body -->
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
<?php
// select all days in between date
$sql = "select * from
(select adddate('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4) v
where selected_date between :day_start - INTERVAL 1 DAY and :day_
@balamyt92
balamyt92 / QuickGit.php
Created October 23, 2016 14:33 — forked from lukeocodes/QuickGit.php
Current git version.
<?php
class QuickGit {
private $version;
function __construct() {
exec('git describe --always',$version_mini_hash);
exec('git rev-list HEAD | wc -l',$version_number);
exec('git log -1',$line);
$this->version['short'] = "v1.".trim($version_number[0]).".".$version_mini_hash[0];
<?php
function parseFile($filename, $column = null)
{
$f = file_get_contents($filename);
$f = iconv("WINDOWS-1251", "UTF-8", $f);
file_put_contents($filename . '.new', $f);
$handle = fopen($filename . '.new', "r");
$result = array();