Skip to content

Instantly share code, notes, and snippets.

@andrii-trush
andrii-trush / js-delegate.js
Created February 21, 2022 09:59 — forked from evenicoulddoit/js-delegate.js
Basic JavaScript Delegation
(function(document, EventTarget) {
var elementProto = window.Element.prototype,
matchesFn = elementProto.matches;
/* Check various vendor-prefixed versions of Element.matches */
if(!matchesFn) {
['webkit', 'ms', 'moz'].some(function(prefix) {
var prefixedFn = prefix + 'MatchesSelector';
if(elementProto.hasOwnProperty(prefixedFn)) {
matchesFn = elementProto[prefixedFn];
@andrii-trush
andrii-trush / ColumnSortable.vue
Created November 6, 2018 22:34
VueJS component for Laravel pagination + column sortable (https://github.com/Kyslik/column-sortable)
<template>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th class="text-nowrap">
<a href="#" @click.prevent="sortChange('name')">
<span>Name</span>
<i class="fa" :class="getClass('name', 'alpha')"></i>
</a>
@andrii-trush
andrii-trush / index.php
Created September 24, 2018 07:34
CryptoJS + php
<?php
$key = hex2bin("A9392200EE003FA282FD26B6FE6E408F66E8FA57AE9B37A81AB1EA6D2CEB8591");
$iv = hex2bin("0A8F11794D8CB7FD05F8C5A18B0B2AB6");
$text = 'FJZXx9cIM40H981AfaZT2jfj+7vFhbx8h288Q589/Wc=';
$decrypted = openssl_decrypt($text, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv);
?>
<!doctype>