Skip to content

Instantly share code, notes, and snippets.

View webag's full-sized avatar

Андрей webag

  • Pen&Brain
  • Kazan, Russian Federation
View GitHub Profile
@webag
webag / form.html
Created June 26, 2014 13:45
Отправка почты с файловым вложением. Необходим phpmailer
<form class="ajax-form" enctype="multipart/form-data">
<input type="text" name="cname" placeholder="Введите имя">
<input type="text" name="ctel" placeholder="Введите телефон">
<input type="hidden" value="order" name="ctip">
<input name="attachfile" type="file">
<button type="submit" class="btn btn-primary">Отправить</button>
</form>
@webag
webag / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@webag
webag / send.php
Last active April 8, 2024 09:50
PHP Добавление контакта и сделки в amocrm с полями из формы сайта.
<?
//amo
//ПРЕДОПРЕДЕЛЯЕМЫЕ ПЕРЕМЕННЫЕ
$responsible_user_id = 7292136; //id ответственного по сделке, контакту, компании
$lead_name = 'Заявка с сайта'; //Название добавляемой сделки
$lead_status_id = '11331793'; //id этапа продаж, куда помещать сделку
$contact_name = $cname; //Название добавляемого контакта
$contact_phone = $cphone; //Телефон контакта
@webag
webag / main.js
Created June 16, 2017 08:48
youtube api video list
/***********************
YouTube api feed BEGIN
***********************/
$(document).ready(function () {
var channelId = "UCrhuhV3v32U8DbI25GUsdIA";
var apiKey = "AIzaSyCE-obn38anepy2x4JmF-wOdCseiE234Zo";
$.ajax({
type: "GET",
url: "https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=" + channelId + "&maxResults=10&order=date&type=video&key=" + apiKey,
@webag
webag / catalog-categories.php
Created June 16, 2017 09:15
youtube api video list php
<?
$channel_id = "UCrhuhV3v32U8DbI25GUsdIA";
$api_key = "AIzaSyCE-obn38anepy2x4JmF-wOdCseiE234Zo";
$video_list_query = file_get_contents("https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=". $channel_id. "&maxResults=10&order=date&type=video&key=". $api_key);
$video_list = json_decode($video_list_query);
?>
<?
foreach ($video_list->items as $video) :
@webag
webag / template.php
Created July 27, 2017 08:13
Php вырезание значения src из строки
<?
$full_link = strval($arItem["PROPERTIES"]["LINK_TO_MAP"]["~VALUE"]);
preg_match('~src="(.*?)"~', $full_link, $matches);
?>
<a href="<?=$matches[1]?>" class="shop__map fancy-map">Схема проезда</a>
@webag
webag / main.js
Last active May 8, 2024 11:03
UTM to forms
/* UTM to Forms Begin */
document.addEventListener('DOMContentLoaded', function () {
if (window.localStorage) {
const params = new URLSearchParams(window.location.search);
const utmParams = ['utm_source', 'utm_medium', 'utm_content', 'utm_campaign', 'utm_term'];
utmParams.forEach(param => {
const value = params.get(param);
if (value !== null && value !== "") {
localStorage.setItem(param, value);
}
@webag
webag / main.js
Created November 15, 2018 07:18
waypoint stagger
/***********************
Waypoints BEGIN
***********************/
$(function () {
var itemQueue = [];
var delay = 150;
var queueTimer;
function processItemQueue() {
if (queueTimer) return;
@webag
webag / index.html
Created December 25, 2018 08:05
Round circle countdown to date timer counter
<div class="circle days"></div>
<div class="circle hours"></div>
<div class="circle minutes"></div>
<div class="circle seconds"></div>
@webag
webag / index.html
Created March 15, 2019 07:35
100vh height 100%
<script>
function setIntroHeight(){
var vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', vh + 'px');
}
setIntroHeight();
</script>
<style>
.block{