Skip to content

Instantly share code, notes, and snippets.

View alexandermitsyk's full-sized avatar
🎯
Focusing

Alexander Mitsyk alexandermitsyk

🎯
Focusing
  • Prefixbox LTD
  • Hungary
View GitHub Profile
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest single run all tests",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": [
"--verbose",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@alexandermitsyk
alexandermitsyk / jquery-custom-serialize.js
Last active March 27, 2019 11:42
jQuery form unchecked checkbox serialize script
//source https://tdanemar.wordpress.com/2010/08/24/jquery-serialize-method-and-checkboxes/
//added selector option
(function ($) {
$.fn.serialize = function (options) {
return $.param(this.serializeArray(options));
};
$.fn.serializeArray = function (options) {
var o = $.extend({
@alexandermitsyk
alexandermitsyk / amazonCloudfrontHeaders.function.php
Last active August 23, 2019 02:16
AWS Cloudfront Header Checker For PHP
<?php
function getHeaders( $header_name = null ) {
$headervals = "";
$keys = array_keys( $_SERVER );
if ( is_null( $header_name ) ) {
$headers = preg_grep( "/^HTTP_(.*)/si", $keys );
} else {
$header_name_safe = str_replace( "-", "_", strtoupper( preg_quote( $header_name ) ) );
$headers = preg_grep( "/^HTTP_${header_name_safe}$/si", $keys );
<?php
$NorthAmericanCountryCodes = array(
"AG",
"BS",
"BB",
"BZ",
"CR",
"CU",
"DM",
"DO",