For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
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
<template> | |
<input type="text" v-model="query" @input="search" /> | |
</template> | |
<script> | |
export default { | |
name: 'Debounce', | |
data: () => ({ | |
query: null, |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Timeline</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/tailwind.min.css" /> | |
</head> | |
<body class="bg-gray-100"> | |
<span id="app"> |
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
<template> | |
<span> | |
<!-- credits from https://github.com/vuejs/vuex/issues/863#issuecomment-329510765 --> | |
</span> | |
</template> | |
<script> | |
import { mapState, mapActions, mapMutations } from 'vuex'; | |
export default { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>axios cancel</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/tailwind.min.css" /> | |
</head> | |
<body class="pt-12"> | |
<div id="app"> |
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
DB::connection()->getPdo()->sqliteCreateFunction('REGEXP', 'preg_match', 2); | |
DB::table('tablename')->whereRaw('lower(tablecolumn) REGEXP "'.$regex.'"'); |
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
// history.pushState = ( f => function pushState(){ | |
// var ret = f.apply(this, arguments); | |
// window.dispatchEvent(new Event('pushstate')); | |
// window.dispatchEvent(new Event('locationchange')); | |
// return ret; | |
// })(history.pushState); | |
// history.replaceState = ( f => function replaceState(){ | |
// var ret = f.apply(this, arguments); | |
// window.dispatchEvent(new Event('replacestate')); |
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
// select the target node | |
var target = document.querySelector('title') | |
// create an observer instance | |
var observer = new MutationObserver(function(mutations) { | |
// We need only first event and only new value of the title | |
console.log('title changes', document.title) | |
}) | |
// configuration of the observer: |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<pre></pre> |
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
const string2Hue = (string) => { | |
let hash = 0; | |
for (let i = 0; i < string.length; i += 1) { | |
hash = string.charCodeAt(i) + hash + (hash % 360); | |
} | |
return hash % 360; | |
} |
OlderNewer