Skip to content

Instantly share code, notes, and snippets.

version: '3'
services:
agent:
image: portainer/agent:2.17.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
networks:
@mki
mki / Catalog.js
Last active February 5, 2020 20:14
React example code
/*
1. For react we made this gist. It is worth noting that the project uses the old version of the react
and in this example the componentWillReceiveProps (newProps) method is specified,
which will stop working in the 17th version of the react.
We refactored ViewedSlider.js for an example of switching to version 17.
2. I am attaching a small video of the test.customorrow.com project, which is made on Vue.js.
It demonstrates our experience in js, even if not in the organization of the project,
but the approach itself is important. While coding on vue.js we understand some things at react.
You can pause and watch the code. https://yadi.sk/i/u1oJrgZNZ_bOeA
@mki
mki / Yandex wordstat get keywords.js
Created August 17, 2017 07:24
Yandex for optoplan
var data = [];
$('.b-link.b-phrase-link__link').each(function(){
data.push($(this).text());
})
$('.b-form-input__input').prop('value', data);
import requests
r = requests.get('https://api.instagram.com/v1/users/search?q=mkispb&count=1&access_token=...')
user_id = None
for user in r.json()['data']:
if user['username'] == 'mkispb':
user_id = user['id']
@mki
mki / vkcom_audio_download.py
Created November 4, 2016 16:43 — forked from st4lk/vkcom_audio_download.py
Python: vkontakte.ru (vk.com) audio music downloader
# -*- coding: utf-8 -*-
"""
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com)
Запуск:
python vkcom_audio_download.py
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
то открывается страница в браузере с запросом на доступ к аккаунту.
[color]
ui = true
[user]
email = xxx@xxx.com
name = xxxx.xxxx
[giggle]
main-window-maximized = true
main-window-geometry = 430x176+343+25
history-view-vpane-position = 285
main-window-view = HistoryView
@mki
mki / track_data.py
Created October 30, 2015 09:32 — forked from dcramer/track_data.py
Tracking changes on properties in Django
from django.db.models.signals import post_init
def track_data(*fields):
"""
Tracks property changes on a model instance.
The changed list of properties is refreshed on model initialization
and save.
>>> @track_data('name')
@mki
mki / gist:750a97a2a69635a79fa9
Last active August 29, 2015 14:00 — forked from Integral/gist:5156170
Backbone.Form.editors.Select2
/**
* SELECT2
*
* Renders Select2 - jQuery based replacement for select boxes
*
* Requires an 'options.values' value on the schema.
* Can be an array of options, a function that calls back with the array of options, a string of HTML
* or a Backbone collection. If a collection, the models must implement a toString() method
*/
Backbone.Form.editors.Select2 = Backbone.Form.editors.Base.extend({
@mki
mki / screen1.py
Created November 30, 2012 22:16
Gists for article
from django.contrib.auth.models import User
user = User.objects.get(pk=5)
user.set_password('super-sekrit')
user.save()
@mki
mki / example.as
Created August 29, 2012 19:48
FileReference example for package upload files (see more at http://mkifiles.ru/?p=1518)
//Функция вызывается при клике по кнопке
public function onClick(event:Event) : void
{
// Пробегаем по массиву композиций и формируем массив для
// загрузки "urlLoader"
while (i < this.arrMusic.length)
{
// Формируем Request
var urlRequest:URLRequest = new URLRequest();
urlRequest.url = ''; // ссылка куда грузим файл