https://fonts.google.com/?selection.family=Open+Sans
cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip
-- Remove the history from | |
rm -rf .git | |
-- recreate the repos from the current content only | |
git init | |
git add . | |
git commit -m "Initial commit" | |
-- push to the github remote repos ensuring you overwrite history | |
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git |
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) { | |
// path/to/whatever does not exist | |
} | |
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) { | |
// path/to/whatever exists | |
} |
In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.
Here's one way to set it up:
npm init -y
in your project folder (don't skip this step!)npm install terser
Now, to minify a file called like_button.js
, run in the terminal:
const $ = x => document.querySelector(x) | |
const $$ = x => [...document.querySelectorAll(x)] | |
const nonempty = x => x.length > 0 | |
const lower_case = x => x.toLowerCase() | |
const includes = y => x => x.includes(y) | |
const multiple_included = xs => x => xs.some(includes(x)) | |
const show = x => x.style.display = "" | |
const hide = x => x.style.display = "none" | |
const head = x => x[0] | |
const last = x => x[x.length - 1] |
HuggingFace Page for model download: https://huggingface.co/hakurei/waifu-diffusion-v1-3
const { Prisma } = require("@prisma/client"); | |
/** | |
* this plugin is used to automatically exclude fields from prisma queries | |
* this works with almost all prisma queries that use select and include | |
* if a custom query is used, it will not work by default, | |
* but it can by adding a $autoExclude:true to the args | |
* next to select and include, there is now exclude | |
* if a field ends with an underscore, it will be excluded unless explicitly in select or include | |
* truthy field in exclude will be excluded, even if present in select or include |
//bookmarklet-title: Canvas DL | |
//bookmarklet-about: When playing skribbl.io and someone has made a nice drawing, this lets you download the current drawing as a PNG. | |
var w = window.wdq || (window.wdq = document.createElement("a")); | |
var p = /The word was '([^']*)'/g, | |
pp = /<span>([^<>]+) is drawing now!/g, | |
tt = document.body.innerHTML; | |
var mm, nn, xx; | |
while (mm = p.exec(tt)) nn = mm; | |
while (mm = pp.exec(tt)) xx = mm; |
PERMISSIONS = { | |
"CREATE_INSTANT_INVITE": 1 << 0, | |
"KICK_MEMBERS": 1 << 1, | |
"BAN_MEMBERS": 1 << 2, | |
"ADMINISTRATOR": 1 << 3, | |
"MANAGE_CHANNELS": 1 << 4, | |
"MANAGE_GUILD": 1 << 5, | |
"ADD_REACTIONS": 1 << 6, | |
"VIEW_AUDIT_LOG": 1 << 7, | |
"PRIORITY_SPEAKER": 1 << 8, |
import numpy as np | |
import soundfile as sf | |
from scipy.fftpack import fft, ifft | |
def rotateSignal(signal,flip): | |
if flip: | |
signal = signal[::-1] | |
x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft | |
rotSig = ifft(x) |