This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#option --h : Show help information | |
#option --p|php: PHP Version | |
#option --test|set-test-mode:Test mode enable | |
#option --DSDSA|dd:dsds | |
#option --v|--vv|--vvv|verbose | |
#option --debug | |
#option --http-root-path=/var/www :Http path | |
#option --set-mode= : Mode, require option |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// object | |
let obj = {}; | |
let proxyObject = new Proxy(obj, { | |
set: function (obj, prop, value) { | |
obj[prop] = value; | |
return true; | |
}, | |
get: function (target, name) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, Input, OnInit} from "@angular/core"; | |
@Component({ | |
selector: 'avatar', | |
template: ` | |
<div [ngStyle]="styles" title="{{name}}"> | |
<span style="position: relative;float: left;top: 50%;left: 50%;transform: translate(-50%, -50%);"> | |
{{shortName}} | |
</span> | |
</div>` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (original) { | |
console.enableLogging = function () { | |
console.log = original; | |
}; | |
console.disableLogging = function () { | |
console.log = function () { | |
}; | |
}; | |
})(console.log); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Hold time | |
* @param alias | |
* @param fn | |
* @param time | |
*/ | |
function holdTimeout(alias, fn, time) { | |
var storageKey = 'holdTimeoutStorage'; | |
function _clear() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fix bootstrap tabs default active by hash | |
*/ | |
(function () { | |
// Javascript to enable link to tab | |
var url = document.location.toString(); | |
if (url.match('#')) { | |
$('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Libs; | |
use Illuminate\View\Compilers\BladeCompiler as LaravelBladeCompiler; | |
class BladeCompiler extends LaravelBladeCompiler | |
{ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[data-delete]').bind('click', function (event) { | |
event.preventDefault(); | |
// default | |
var element = event.currentTarget; | |
var item = $(element); | |
var message = 'Are you sure you want to delete this item?'; | |
var href = '#'; | |
if (item.length) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a2enmod vhost_alias | |
<VirtualHost *:80> | |
ServerName .ponich.com | |
RewriteEngine On | |
RewriteCond %{HTTPS} !on | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} | |
</VirtualHost> | |
# SSL with wildcard | |
<IfModule mod_ssl.c> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
WWW=/var/www/ | |
LARAVEL_PATH=${1} | |
DOMAIN=$(echo "$LARAVEL_PATH" | cut -d "/" -f1) | |
MYSQL_USER=dev | |
MYSQL_DB=$(echo $DOMAIN | sed 's/\./_/g') | |
project_root(){ | |
eval cd "${LARAVEL_PATH}" |