Skip to content

Instantly share code, notes, and snippets.

View antydemant's full-sized avatar
🇺🇦
🇺🇦

Ihor Ostapchuk antydemant

🇺🇦
🇺🇦
  • DataRobot
  • Khmelnytskyi, Ukraine
View GitHub Profile
@antydemant
antydemant / question.js
Created September 27, 2017 14:22
Firebase + Expres.js RESTful API, create new line of questions
router.post('/create',function (req, res, next) {
var questions = db.questions;
questions.push({
answerType: req.body.answerType,
questionText: req.body.questionText
});
res.sendStatus(201);
});
@antydemant
antydemant / jquery3.pseudo.js
Last active August 18, 2020 13:57
jQuery 3 pseudo class selection solution | Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: hover
//
// pseudo ':hover' is not supported by jQuery 3
//
// Works with jQuery 1.7.1
$("*").on('click', $.proxy(function() {
if ( this.$('.tooltip:hover').length > 0 ) { // jQuery 3.2.1 will trigger this -> Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: hover
console.log('Hovered!');
} else {
console.log('Where is my element!?');
@antydemant
antydemant / CMD
Last active February 25, 2018 12:52
Run PHP with Apache within Docker container without creating Dockerfile "Hot Start Docker Container"
docker run -td -p 80:80 --name "Your container name" -v "$PWD":/var/www/html php:7.2.2-apache
@antydemant
antydemant / PHP + Apache + MySQL CMD
Last active February 25, 2018 13:54
My Docker container link
docker run --name mysql-server -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wptest -e -d mysql
docker run -p 80:80 -v "$PWD":/var/www/html --name wptest-mysql --link mysql-server:mysql -d wptest
<optgroup id="country-optgroup-Europe" label="Europe">
<option value="AL" label="Albania">Albania</option>
<option value="AD" label="Andorra">Andorra</option>
<option value="AT" label="Austria">Austria</option>
<option value="BY" label="Belarus">Belarus</option>
<option value="BE" label="Belgium">Belgium</option>
<option value="BA" label="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
<option value="BG" label="Bulgaria">Bulgaria</option>
<option value="HR" label="Croatia">Croatia</option>
<option value="CY" label="Cyprus">Cyprus</option>
<optgroup id="country-optgroup-Africa" label="Africa">
<option value="Africa|dz" {if $userdata.country=='dz'}selected{/if} label="Algeria">Algeria</option>
<option value="Africa|ao" {if $userdata.country=='ao'}selected{/if} label="Angola">Angola</option>
<option value="Africa|bj" {if $userdata.country=='bj'}selected{/if} label="Benin">Benin</option>
<option value="Africa|bw" {if $userdata.country=='bw'}selected{/if} label="Botswana">Botswana</option>
<option value="Africa|bf" {if $userdata.country=='bf'}selected{/if} label="Burkina Faso">Burkina Faso</option>
<option value="Africa|bi" {if $userdata.country=='bi'}selected{/if} label="Burundi">Burundi</option>
<option value="Africa|cm" {if $userdata.country=='cm'}selected{/if} label="Cameroon">Cameroon</option>
<option value="Africa|cv" {if $userdata.country=='cv'}selected{/if} label="Cape Verde">Cape Verde</option>
<option value="Africa|cf" {if $userdata.country=='cf'}selected{/if} label="Central African Republic">Central African Republic</op

Keybase proof

I hereby claim:

  • I am antydemant on github.
  • I am antydemant (https://keybase.io/antydemant) on keybase.
  • I have a public key ASAL6SirYo3-Lfieu7lolHWjvgzjLotiENqCDjgChCc_xQo

To claim this, I am signing this object:

@antydemant
antydemant / JIRA jQuery code for CJS chrome extension.js
Created May 7, 2018 20:08
Highlight assigned JIRA ticket in the epic
$(document).ready(function(){
// Issues in Epic check Assignee each epic
if($(".issuerow").length > 0) {
$(".issuerow").each(function(i) {
var assigneeInEpic = $(this).find("td.nav.assignee").find("a").text();
var firstLastName = "Ihor Ostapchuk"; //Your First Name and Last Name in JIRA
if(assigneeInEpic == firstLastName) {
$(this).css("background-color","#adffd2");
}
});
@antydemant
antydemant / session-life-cycle.md
Created June 4, 2018 22:16 — forked from mindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().

@antydemant
antydemant / CacheClient.php
Last active July 15, 2019 19:32
Memcached(ElastiCache) + Custom session handler PHP boilerplate.
<?php
class CacheClient
{
/**
* @var bool ElastiCache auto discovery flag
*/
public $elasticache_auto_discovery_active = false;
/**