Skip to content

Instantly share code, notes, and snippets.

View agoalofalife's full-sized avatar
😉
Do what you can, with what you have, where you are

Ilya Chubarov agoalofalife

😉
Do what you can, with what you have, where you are
View GitHub Profile
let name = 'Maria';
let name2 = 'Vasilij';
let age = 18;
let result = tag`My name ${name} sd sdc sdc and ${name2} and ${age}`;
function tag(srting,...values) {
return srting.reduce((prev,current,id) => {
if (id > 0) {
if (typeof values[id - 1] == 'string') {
@agoalofalife
agoalofalife / php
Last active August 23, 2017 19:07
Curl отправки фото в vk api
$url = $_POST['upload_url'];
$file = new CURLFile(realpath('photo.jpg'));
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'photo' => $file
));
@agoalofalife
agoalofalife / 0_reuse_code.js
Created May 10, 2016 12:13
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// Обрабатывает клик на картинке
$('.img_block img').click(function() {
// Получаем адрес картинки