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
&tls.Config{ | |
// Causes servers to use Go's default ciphersuite preferences, | |
// which are tuned to avoid attacks. Does nothing on clients. | |
PreferServerCipherSuites: true, | |
// Only use curves which have assembly implementations | |
CurvePreferences: []tls.CurveID{ | |
tls.CurveP256, | |
tls.X25519, // Go 1.8 only | |
}, | |
} |
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
<script> | |
export let rows; | |
export let perPage; | |
export let trimmedRows; | |
$: totalRows = rows.length | |
$: currentPage = 0 | |
$: totalPages = Math.ceil(totalRows / perPage) | |
$: start = currentPage * perPage | |
$: end = currentPage === totalPages - 1 ? totalRows - 1 : start + perPage - 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
<script> | |
export let type = "circle"; | |
</script> | |
{#if type == "line"} | |
<div class="flex justify-center items-center bg-transparent"> | |
<div class="loader bg-indigo-100 p-5 rounded-full flex space-x-3"> | |
<div class="w-5 h-5 bg-red-400 rounded-full animate-bounce" /> | |
<div class="w-5 h-5 bg-red-400 rounded-full animate-bounce" /> | |
<div class="w-5 h-5 bg-red-400 rounded-full animate-bounce" /> |
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
<script> | |
import { onMount } from "svelte"; | |
let createScene; | |
let el; | |
onMount(async () => { | |
const module = await import("$lib/scene"); | |
createScene = module.createScene; | |
createScene(el); | |
}); | |
</script> |
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
<div class="flex items-center justify-center min-h-screen bg-gray-50"> | |
<div class="relative w-full max-w-lg"> | |
<div | |
class="absolute rounded-full animate-blob mix-blend-multiply filter blur-2xl opacity-70 -top-5 -right-2 w-72 h-72 bg-yellow-500" | |
/> | |
<div | |
class="absolute rounded-full animate-blob animation-delay-2000 mix-blend-multiply filter blur-2xl opacity-70 top-0 -left-2 w-72 h-72 bg-indigo-500" | |
/> | |
<div |
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
<script> | |
export let title = ""; | |
let isHovered = false; | |
let x; | |
let y; | |
function mouseOver(event) { | |
isHovered = true; | |
x = event.pageX + 5; | |
y = event.pageY + 5; |
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
//add this to config | |
theme: { | |
extend: { | |
'animation': { | |
'gradient-x':'gradient-x 15s ease infinite', | |
'gradient-y':'gradient-y 15s ease infinite', | |
'gradient-xy':'gradient-xy 15s ease infinite', | |
}, | |
'keyframes': { | |
'gradient-y': { |
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
<script> | |
let name = 'world'; | |
function clickOutside(node) { | |
const handleClick = event => { | |
if (node && !node.contains(event.target) && !event.defaultPrevented) { | |
node.dispatchEvent( | |
new CustomEvent('click_outside', node) |
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
// CONNECTION EVENTS | |
mongoose.connection.on('connected', function () { | |
console.log('Mongoose connected'); | |
}); | |
mongoose.connection.on('error', function (err) { | |
console.log('Mongoose connection error: ' + err); | |
}); | |
mongoose.connection.on('disconnected', function () { | |
console.log('Mongoose disconnected'); | |
}); |
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 FORMATS | |
const months = { | |
0: 'January', | |
1: 'February', | |
2: 'March', | |
3: 'April', | |
4: 'May', | |
5: 'June', | |
6: 'July', | |
7: 'August', |
NewerOlder