This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((document, window) => { | |
document.addEventListener('DOMContentLoaded', () => { | |
let images = Array.from(document.querySelectorAll('img[data-src]')); | |
if (!('IntersectionObserver' in window)) { | |
images.forEach(image => { | |
image.src = image.dataset.src; | |
}); | |
} else { | |
let observer = new IntersectionObserver((entries, observer) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Vue.js test project</title> | |
<style> | |
input[type="number"] { | |
width: 4rem; | |
height: 1rem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name BattleGroup | |
// @namespace DreamWar | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Sergey Shiryaev <[email protected]> | |
// @match http://dreamwar.ru/battle_group.php* | |
// @run-at document-end | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
function createElement(tagName, attributes) { | |
return Object.assign(document.createElement(tagName), attributes); | |
} | |
var privacyPolicyContainer = createElement('div', {className: 'form-control'}); | |
privacyPolicyContainer.appendChild(createElement('input', {name: 'privacy-policy', type: 'checkbox', checked: true, required: true})); | |
privacyPolicyContainer.appendChild(createElement('label', {htmlFor: 'privacy-policy', innerHTML: 'Согласен на обработку моих персональных данных'})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from urllib.parse import urlparse | |
from scrapy.crawler import CrawlerProcess | |
from scrapy.spiders import CrawlSpider, Rule | |
from scrapy.linkextractors import LinkExtractor | |
parser = ArgumentParser() | |
parser.add_argument('-d', '--domain') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from bs4 import BeautifulSoup | |
from imaplib import Commands, IMAP4 | |
import argparse | |
import configparser | |
import email | |
import urllib.request | |
import urllib.parse | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace DevGroup; | |
use Bitrix\Main\Config\Option; | |
use Bitrix\Main\Context; | |
use Bitrix\Main\EventManager; | |
use Bitrix\Main\HttpContext; | |
use Bitrix\Main\Page\Asset; | |
use Bitrix\Main\Page\AssetLocation; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$csv = new \SplFileObject('file.csv'); | |
$result = []; | |
while(false === $csv->eof()) { | |
$headers = $headers ? $headers : $csv->fgetcsv(); | |
$result[] = array_combine($headers, $csv->fgetcsv()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
gcc dwmbar.c -std=c99 -D_XOPEN_SOURCE=600 -lX11 -lasound -Wall -O3 -o dwmbar | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <time.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', function() { | |
var elements = document.querySelectorAll('[data-goal-ya], [data-goal-ga]'); | |
for (var i = 0; i < elements.length; i++) { | |
elements[i].addEventListener('click', function() { | |
try { | |
if (typeof(this.dataset.goalYa) != 'undefined') { | |
yaCounterXXXXXXX.reachGoal(this.dataset.goalYa); | |
} | |
if (typeof(this.dataset.goalGa) != 'undefined') { | |
ga('send', this.dataset.goalGa, location.pathname); |
NewerOlder