Skip to content

Instantly share code, notes, and snippets.

@plugn
plugn / objectUtils.js
Last active August 3, 2021 22:52
magical comprehensions for JS Object instances
/**
* @title objectUtils.js
* @description magical comprehensions for JS Object instances
* @author Max L Dolgov, plugn@github.com
*
* Here is `var` keyword for ability to re-declare functions,
* it makes tweaking functions in browser console possible.
*
*/
@plugn
plugn / php.func.es6js.js
Last active August 3, 2021 15:11
php.func.es6.js
/**
* php.es6
* @description PHP functions implemented in JavaScript/ES6
* @author Max L Dolgov <bananafishbone@gmail.com>
*/
function count(value) { return value.length }
function chr(num) { return String.fromCharCode(num) }
function ord(str) { return String(str).charCodeAt(0) }
function trim(str) { return String(str).trim() }
function substr(str, start, length) { return String(str).substr(start, length) }
@plugn
plugn / flexbox.html
Created April 3, 2020 00:02 — forked from Munawwar/flexbox.html
HBox and VBox layout with CSS3 flexbox
<!DOCTYPE HTML>
<html>
<head>
<!-- HBox and VBox layouts have been implementated with many libraries/toolkits on
different platforms and languages (like ExtJS,QT,GTK,.NET...).
This tries to achieve the same but with CSS only.
Supported browsers: IE 10+, Safari 6.1, Latest FF, Chrome -->
<style type="text/css">
html, body {
@plugn
plugn / sortObject.example.js
Last active April 24, 2020 14:01
Object deep sort by keys
var sample = {
el: {
upload: 'Upload file',
filterPopover: {
apply: 'Apply'
},
rightholdersItem: {
cardInterestedParty: 'Interested Party',
documents: 'Documents',
catalog: 'Catalogue'
@plugn
plugn / index.html
Last active January 19, 2020 22:06
flex layout with text overflow in ellipsis mode. header// source https://jsbin.com/tupifec
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>header</title>
<style id="jsbin-css">
.flex-row {
display: flex;
flex-direction: row;
@plugn
plugn / GitCommitEmoji.md
Created November 14, 2019 10:13 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@plugn
plugn / getCookie.js
Last active February 1, 2019 13:43
getting cookies utility
/**
* @author Max L Dolgov
* @description getting cookies utility
*/
export const getCookies = () => document.cookie.split(';').map(s => s.trim().split('='))
export const getCookie = cookieName => (getCookies().find(v => v[0] === cookieName) || [])[1]
export const getCookiesMap = () => getCookies().reduce(reducer = (acc, v) => ({ ...acc, [v[0]]: v[1] }), {})
@plugn
plugn / InputPlus.vue
Last active November 23, 2018 17:09
Sexy Input for Semantic-UI
<template>
<div class="ui icon input">
<input
:placeholder="placeholder"
:value="value"
@input="onInput"
@blur="onBlur"
ref="input"
/><i
class="icon" :class="value ? 'close link' : icon"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
html, body {
height: 100%;
}
@plugn
plugn / index.html
Last active October 2, 2019 14:49
_.flow() example // source https://jsbin.com/yoheci
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="http://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>