Skip to content

Instantly share code, notes, and snippets.

View ohmycto's full-sized avatar

Dennis Lukyanov ohmycto

View GitHub Profile
@ohmycto
ohmycto / README.md
Last active September 28, 2021 08:33
Development with Docker Compose

Setting up NFS when developing with Docker Compose

MacOS users

1. Make sure NFS is properly set up and running on your system.

a) Check status of nfsd service:

$ sudo nfsd status
@ohmycto
ohmycto / account_drop.md
Created August 13, 2018 13:25
Convead Liquid Object Model

AccountDrop

account: {
  domain
  site_url
  currency_iso
  currency_symbol
  top_viewed_offers: [OfferDrop]
  top_purchased_offers: [OfferDrop]
  top_6_offers: [OfferDrop]
@ohmycto
ohmycto / telegram_api.ex
Last active February 3, 2017 11:00
Elixir TelegramAPI for Bots
defmodule TelegramApi do
@base_api_url "https://api.telegram.org/bot"
@headers ["Content-Type": "application/json"]
# Get Telegram Bot info: TelegramApi.get("getMe", access_token)
# Set webhook: TelegramApi.post("setWebhook", access_token, %{url: "https://my-app.example.com/callback"})
# Remove webhook: TelegramApi.post("setWebhook", access_token, %{url: ""})
# Send message: TelegramApi.post("sendMessage", access_token, %{chat_id: 123456, text: "Answer From Bot"})
# Get file: TelegramApi.get("getFile", access_token, %{file_id: "file-id-from-message"})
@ohmycto
ohmycto / viber_api.ex
Last active October 30, 2018 21:45
Elixir ViberAPI for PA
defmodule ViberApi do
@api_url "https://chatapi.viber.com/pa/"
# Usage examples
# ==============
#
# Get Public Account info
# -----------------------
# ViberApi.get("get_account_info", token)
#
@ohmycto
ohmycto / feed.xml
Created October 20, 2016 09:13
Convead products feed minimal XML
<?xml version="1.0" encoding="utf-8"?>
<yml_catalog date="2016-10-20 11:25">
<shop>
<categories>
<category id="1">Category 1</category>
<category id="2" parentId="1">Subcategory 1</category>
...
</categories>
<offers>
<offer id="1" available="true">
@ohmycto
ohmycto / convead_samples.js
Created September 30, 2015 11:25
Convead JavaScript integration samples
/*
* Convead catch user info code samples.
* Requires jQuery.
*/
// Catch email from field with ID 'user_email' on blur
$('#user_email').blur(function(e) {
var email_regexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i;
var email = $(this).val();
if ((typeof convead !== 'undefined') && (email_regexp.test(email))) {
@ohmycto
ohmycto / cart_template.html
Created August 10, 2015 14:21
Convead liquid example
<!-- CART BEGINS HERE -->
<table cellpadding="0" cellspacing="0" style="margin: 15px 0; font-size: 15px; line-height: 1.3em;" width="100%">
<tr>
<td colspan="5" style="padding: 0 0 10px 0;">
<h4 style="font-size: 22px; line-height: 1.2em; font-weight: 400; margin: 0; padding: 4px 0;">Ваша корзина</h4>
</td>
</tr>
{% for line_item in cart.line_items %}
<tr>
<td colspan="5" style="border-top: 1px solid #e0e0e0;"></td>