Skip to content

Instantly share code, notes, and snippets.

View dimitriipro's full-sized avatar

Dimitrii dimitriipro

View GitHub Profile
// generate file name and path
let filePath;
let filename = `bill${Random.id()}.html`;
if ( process.env.NODE_ENV === 'development' ) {
filePath = '/tmp/' + filename;
} else {
let path = Npm.require('path');
filePath = path.join( process.env.TEMP_DIR, filename );
}
@Itachi261092
Itachi261092 / README.md
Last active January 15, 2024 08:00
[1C-Bitrix / 1С-Битрикс] AJAX Custom Preloader / Кастомный прелоадер стандартного аякса

Кастомный ajax preloader на 1С-Битрикс.

Сам прелоадер честно стырен отсюда, но его можно заменить любым понравившимся кодом.

Ставится легко и просто. В принципе, все файлы понятно названы и проблем не должно возникнуть.

В футер перед /body ставим вызов включаемой области. Скрипт я обычно копирую вниз включаемой области. Весь код в ней - это хтмл код прелоадера.

CSS можно скопировать в template_styles, а можно подключить отдельно в header.php шаблона сайта.

@vladignatyev
vladignatyev / progress.py
Last active March 31, 2024 22:54
Python command line progress bar in less than 10 lines of code.
# The MIT License (MIT)
# Copyright (c) 2016 Vladimir Ignatev
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject to the following conditions:
#
@chrisguitarguy
chrisguitarguy / xml.py
Created October 21, 2011 21:18
Parse an XML sitemap with Python, requests and BeautifulSoup
from __future__ import with_statement # we'll use this later, has to be here
from argparse import ArgumentParser
import requests
from BeautifulSoup import BeautifulStoneSoup as Soup
def parse_sitemap(url):
resp = requests.get(url)
# we didn't get a valid response, bail