Skip to content

Instantly share code, notes, and snippets.

View ualinker's full-sized avatar
🇺🇦

Artem Komarov ualinker

🇺🇦
View GitHub Profile
@ualinker
ualinker / mysql_timestamp_datetime.sql
Created July 8, 2021 14:31
Source of truth for MySQL TIMESTAMP and DATETIME fields
create temporary table tmp (ts timestamp, dt datetime);
set @@session.time_zone='Europe/Berlin'; # UTC+1
select unix_timestamp(), now(); # 1625752798 (2021-07-08 15:59:58 UTC)
insert into tmp values (NOW(), NOW()); # 17:05 UTC, 16:05 local time
select tmp.*,UNIX_TIMESTAMP(ts),UNIX_TIMESTAMP(dt) from tmp;
# ts dt ts dt
# 2021-07-08 16:06:10, 2021-07-08 16:06:10, 1625753170, 1625753170
set @@session.time_zone='Europe/Kiev'; # UTC+2
select tmp.*,UNIX_TIMESTAMP(ts),UNIX_TIMESTAMP(dt) from tmp;
# ts (changed) dt (same) ts (same) dt (changed)
@ualinker
ualinker / airvpn_tomato.ovpn
Last active June 11, 2017 13:02
AirVPN Tomato configuration
# The original configuration posted on AirVPN site did not work for me. I have found this one somewhere on the net,
# which is doing okay. This is not written by me. Unfortunately, I can't remember where I found it, please let me know if
# you're the author.
##### CLIENT OPTIONS #####;
server-poll-timeout 10 ### When polling possible remote servers to connect to in a round-robin fashion, spend no more than n seconds waiting for a response before trying the next server. ###;
explicit-exit-notify 5
rcvbuf 262144
sndbuf 262144
@ualinker
ualinker / gist:cd305c091992863682210de7bb8ddf7c
Created November 1, 2016 16:48
Ukrsibbank StarAccess JAVA applet exception
Exception Name: JavaNativeException
Description: java.lang.NullPointerException
at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1090)
at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1085)
at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:1080)
at java.awt.Toolkit.getEventQueue(Toolkit.java:1734)
at java.awt.EventQueue.invokeLater(EventQueue.java:1266)
at sun.plugin2.main.client.MacOSXKeyHandler.notifyFlagsChangedFromNative(Unknown Source)
User Info: (null)
@ualinker
ualinker / magento.conf
Last active November 9, 2015 22:19 — forked from jonathonbyrdziak/magento.conf
A configuration file for magento under nginx.
#####################################################
#
# Provided by the Magento Support Center
# http://magentosupport.help/knowledgebase/configuring-nginx-to-work-with-magento-advanced/
#
# Your Magento Tutorial specialists
#
server {
listen *:8080;
server_name fanatik.redrokk.com www.fanatikbike.com fanatikbike.com;
@ualinker
ualinker / ISO-3366-1.sql
Last active August 29, 2015 14:03 — forked from nobuti/gist:3816985
Without continents
CREATE TABLE IF NOT EXISTS `countries` (
`code` CHAR(2) NOT NULL COMMENT 'Two-letter country code (ISO 3166-1 alpha-2)',
`name` VARCHAR(255) NOT NULL COMMENT 'English country name',
`full_name` VARCHAR(255) NOT NULL COMMENT 'Full English country name',
`iso3` CHAR(3) NOT NULL COMMENT 'Three-letter country code (ISO 3166-1 alpha-3)',
`number` SMALLINT(3) ZEROFILL NOT NULL COMMENT 'Three-digit country number (ISO 3166-1 numeric)',
PRIMARY KEY (`code`)
) ENGINE=InnoDB;
INSERT INTO `countries` (`code`, `name`, `iso3`, `number`, `full_name`) VALUES
_redirectToGrid: function () {
$('<form>').prop({action: url.grid, method: 'post'})
.append($('<input>').attr('consumer_id', integration.consumerId))
.append($('<input>').attr('reauthorize', integration.isReauthorize))
.append($('<input>').attr('form_key', window.FORM_KEY))
.submit();
}
[19-Nov-2013 19:01:44 UTC] PHP Catchable fatal error: Argument 1 passed to Magento\Object::__construct() must be of the type array, null given, called in /var/www/api/lib/Magento/Data/Form/AbstractForm.php on line 59 and defined in /var/www/api/lib/Magento/Object.php on line 73
[19-Nov-2013 19:01:44 UTC] PHP Stack trace:
[19-Nov-2013 19:01:44 UTC] PHP 1. {main}() /var/www/api/index.php:0
[19-Nov-2013 19:01:44 UTC] PHP 2. Magento\App\EntryPoint\EntryPoint->run() /var/www/api/index.php:23
[19-Nov-2013 19:01:44 UTC] PHP 3. Magento\App\Http->execute() /var/www/api/lib/Magento/App/EntryPoint/EntryPoint.php:66
[19-Nov-2013 19:01:44 UTC] PHP 4. Magento\App\FrontController\Interceptor->dispatch() /var/www/api/lib/Magento/App/Http.php:97
[19-Nov-2013 19:01:44 UTC] PHP 5. Magento\App\FrontController\Interceptor->_invoke() /var/www/api/var/generation/Magento/App/FrontController/Interceptor.php:177
[19-Nov-2013 19:01:44 UTC] PHP 6. Magento\Code\Plugin\InvocationChain->proceed() /var/www/api/var/generation/Ma
<?php
$proxy = new SoapClient('http://vagrant.vm/api2/api/soap_wsi?wsdl');
$session = $proxy->login((object)array('username' => 'api', 'apiKey' => '123123q'));
$cart = $proxy->shoppingCartCreate((object)array('sessionId' => $session->result));
$paymentList = $proxy->shoppingCartPaymentList((object)array('sessionId' => $session->result, 'quoteId' => $cart->result));
var_dump($paymentList->result);
Feature: Subscribe
In order to be able to receive notifications about new releases
As a user
I should be able to subscribe to artists
Scenario: Subscribe attempt by unauthorised user from artist page
Given I am on artist page of Филипп Киркоров
When I press "Subscribe"
Then login dialog should appear
@ualinker
ualinker / Login.feature
Created December 13, 2012 22:09
Login.feature
Feature: Login
In order to make new subscriptions
As a registered, but not authenticated user
I need to login
Scenario: Successful login with correct credentials
Given I am a registered user
And I am on homepage
When I open login form
And fill in my credentials