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 / index.js
Last active February 11, 2021 10:04
Weekly PRs by Core UI team
const axios = require('axios');
const todayDate = new Date();
const reportStartDate = new Date();
const reportEndDate = new Date();
reportStartDate.setDate(todayDate.getDate());
reportEndDate.setDate(reportStartDate.getDate() - 7);
const baseTeamMembersUrl = 'https://api.github.com/orgs/datarobot/teams/core-ui/members';
@antydemant
antydemant / aes-ctr.js
Created January 17, 2021 20:26
Encryption demo
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* AES Counter-mode implementation in JavaScript (c) Chris Veness 2005-2014 / MIT Licence */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* jshint node:true *//* global define, escape, unescape, btoa, atob */
'use strict';
if (typeof module != 'undefined' && module.exports) var Aes = require('./aes'); // CommonJS (Node.js)
function textTo16Binary(string) {
return string.split('').map(function (char) {
FROM cypress/browsers:node12.18.3-chrome87-ff82
# setup
WORKDIR /app
RUN mkdir -p /app/tests/js/e2e/cypress/
WORKDIR /app/tests/js/e2e/cypress
COPY ./tests/js/e2e/cypress/package.json ./package.json
RUN npm install --no-save
@antydemant
antydemant / tests.js
Created December 10, 2020 22:52
Deno Tests
import { assertEquals, superoak, bcrypt } from "../deps.js";
import { getNumberOfWeek } from "../utils/dates.js";
import { isHashSameWith, isUserExist } from "../utils/validation-rules.js";
import { getUser } from "../services/userService.js";
import { executeQuery } from "../database/database.js";
import app from "../app.js";
Deno.test({
name: "Should GET request to / return status code 200",
<div class="row mb-2">
<div class="col-md-6">
<div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
<div class="col p-4 d-flex flex-column position-static">
<strong class="d-inline-block mb-2 text-primary">World</strong>
<h3 class="mb-0">Featured post</h3>
<div class="mb-1 text-muted">Nov 12</div>
<p class="card-text mb-auto">This is a wider card with supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="stretched-link">Continue reading</a>
</div>
@antydemant
antydemant / .eslintrc.js
Created October 22, 2020 08:46
ESLint + Prettier
module.exports = {
extends: ['airbnb/base', 'eslint-config-prettier'],
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error',
},
};
@antydemant
antydemant / README.md
Last active June 21, 2020 14:02
Steps
  1. Create repository - ✅
  2. Apply .gitignore boilerplate for Node.js apps - ✅
  3. Initialize new project by npm init (package.json) -
  4. Install express framework https://www.npmjs.com/package/express (npm install express, then check package.json)
const express = require('express');

const server = express();
const port = 3000;
@antydemant
antydemant / script.php
Last active February 11, 2020 23:58
Akeneo API - Update SKUs
<?php
////////////////////////////////// ˅˅˅ Credentials ˅˅˅ ////////////////////////////////
/*
* Path to the file
*/
define("FILE_PATH", "EXAMPLE.csv");
/*
* API Host
*/
define("API_HOST", "http://localhost:8080");
@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;
/**
@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().