Skip to content

Instantly share code, notes, and snippets.

@osamaqarem
osamaqarem / nginx_macos.md
Last active April 4, 2025 08:54
Nginx on MacOS

Install nginx (Homebrew)

brew install nginx

Configuration file for nginx will be at /usr/local/etc/nginx/nginx.conf

Web apps can be stored at /usr/local/var/www

Commands

Start:

@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, [email protected]
*
* 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 <[email protected]>
*/
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"
@OrenBochman
OrenBochman / Search my gists.md
Last active August 28, 2024 21:07 — forked from santisbon/Search my gists.md
How to search gists

Gist Search Cheatsheet

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:orenbochman

Find all gists with a .yml extension.
extension:yml