This file contains 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
// Version 4.0 | |
const pSBC=(p,c0,c1,l)=>{ | |
let r,g,b,P,f,t,h,i=parseInt,m=Math.round,a=typeof(c1)=="string"; | |
if(typeof(p)!="number"||p<-1||p>1||typeof(c0)!="string"||(c0[0]!='r'&&c0[0]!='#')||(c1&&!a))return null; | |
if(!this.pSBCr)this.pSBCr=(d)=>{ | |
let n=d.length,x={}; | |
if(n>9){ | |
[r,g,b,a]=d=d.split(","),n=d.length; | |
if(n<3||n>4)return null; | |
x.r=i(r[3]=="a"?r.slice(5):r.slice(4)),x.g=i(g),x.b=i(b),x.a=a?parseFloat(a):-1 |
This file contains 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
<template> | |
<!-- WYSIWYG Editor --> | |
<div class="editor mb-4"> | |
<editor-menu-bar class="editor-bar" :editor="editor"> | |
<div slot-scope="{ commands, isActive, focused }"> | |
<!-- Bold --> | |
<button | |
type="button" | |
class="btn btn-plain" | |
:class="{ 'is-active': isActive.bold() }" |
This file contains 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
/** | |
* Get Color Contrast | |
* @param {string} hex Hexa Color Code | |
*/ | |
export const getColorContrast = (hex) => { | |
const color = hexToRgb(hex); | |
const treshold = 186; | |
const contrast = color | |
&& (color.r * 0.299 + color.g * 0.587 + color.b * 0.114) > treshold ? 'black' : 'white'; | |
// for (const key in color) { |
This file contains 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 | |
return [ | |
// ... | |
'debug_blacklist' => [ | |
'_ENV' => [ | |
'APP_KEY', | |
'DB_PASSWORD', |
This file contains 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
<draggable | |
v-model="product.images" | |
v-bind="dragOptions" | |
@start="drag = true" | |
@end="drag = false"> | |
<transition-group | |
class="row small-gutter" | |
type="transition" | |
:name="!drag ? 'flip-list' : null"> | |
<div class="col" v-for="(image, index) in product.images" :key="index + 0"> |
This file contains 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
sudo netstat -nputwc |
This file contains 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
file= | |
region=ap-southeast-1 | |
bucket= | |
resource="/${bucket}/${file}" | |
contentType="application/zip" | |
dateValue=`date -R` | |
stringToSign="PUT\n\n${contentType}\n${dateValue}\n${resource}" | |
s3Key= | |
s3Secret= | |
signature=`echo -en ${stringToSign} | openssl sha1 -hmac ${s3Secret} -binary | base64` |
This file contains 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
date -d "yesterday 13:00" '+%Y-%m-%d' | |
echo $(date -d "yesterday 13:00" +%Y_%m_%d) |
This file contains 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
.header-main { | |
border-bottom: 1px solid #ebebeb; | |
} | |
.header-main.sticky-header { | |
border-bottom-color: transparent; | |
} | |
.header-v2 .navbar-nav > li > a:before { | |
bottom: -1px; |
This file contains 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 | |
/** | |
* @param string $url | |
* @see https://stackoverflow.com/a/51246730/5627904 | |
*/ | |
function get_youtube_id($url) { | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ |