ssh-keygen -t ed25519 -C "user@email.com" -f ~/.ssh/id_rsa_github
ssh-keygen -t ed25519 -C "user@email.com" -f ~/.ssh/id_rsa_gitlab
Discover gists
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
import { NextResponse } from "next/server"; | |
import { getLowestPrice, getHighestPrice, getAveragePrice, getEmailNotifType } from "@/lib/utils"; | |
import { connectToDB } from "@/lib/mongoose"; | |
import Product from "@/lib/models/product.model"; | |
import { scrapeAmazonProduct } from "@/lib/scraper"; | |
import { generateEmailBody, sendEmail } from "@/lib/nodemailer"; | |
export const maxDuration = 300; // This function can run for a maximum of 300 seconds | |
export const dynamic = "force-dynamic"; |
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
alias fan-auto='systemctl start supermicro-fan-auto.timer' | |
alias fan-full='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan full' | |
alias fan-pue2='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan pue2' | |
alias fan-optimal='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan optimal' | |
alias fan-heavyio='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan heavyio' | |
alias fan-standard='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan standard' |
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
/** | |
* memoizes a function using localStorage as the cache | |
* @param {function|Promise} fn function or promise you wish to memoize | |
* @param {Object} [options] additional configuration | |
* @param {number} [options.ttl=0] time to live in seconds | |
* @param {Boolean} [options.backgroundRefresh=false] whether the cache should be refreshed asynchronously, | |
* Note: new results won't resolve until next execution | |
* @return {Promise} Promise object represents memoized result | |
*/ | |
function memoizeLocalStorage( |
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
// 1. The Interface | |
// --> Two ways to do it, | |
``` | |
@Multipart | |
@POST("the_endpoint") | |
suspend fun postImage( | |
@Part profile_photo: MultipartBody.Part, | |
@Part ("profile_photo") requestBody: RequestBody |
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
#!/usr/bin/env bash | |
# Show info and run flatpak apps with fzf | |
# flatapp [arguments] | |
flatpak_preview() { | |
app="$(echo "${1}" | awk -F'\t' '{print $2}')" | |
flatpak info "${app}" | |
} | |
export -f flatpak_preview |
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
23.21.150.121:3478 | |
iphone-stun.strato-iphone.de:3478 | |
numb.viagenie.ca:3478 | |
s1.taraba.net:3478 | |
s2.taraba.net:3478 | |
stun.12connect.com:3478 | |
stun.12voip.com:3478 | |
stun.1und1.de:3478 | |
stun.2talk.co.nz:3478 | |
stun.2talk.com:3478 |
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
#!/bin/bash | |
# | |
# Generates thumbnail contact sheets of all video files in current working directory. | |
# | |
# Script defaults to writing PNG contact sheets to the same folder, using the original | |
# video filename as the basename for the contact sheet | |
# | |
# More details: https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video | |
# | |
# NOTE: 'montage' requires that Ghostscript be installed, in order to be able to generate titles |
NOTICE: This guide will help you set ssh keys for GitHub and GitLab. However, this is not going to change your commit
user.name
oruser.email
. If you need to change those for specific repositories, just run the following commands while in your repository:
git config user.name "Your Name Here"
git config user.email your@email.com
For more info, see this answer. Also, keep in mind this only changes the
.git
folder inside your repository which never gets added/committed/pushed/uploaded.
I recently had to manage two ssh keys (one for Github and one for Gitlab). I did some research to find the best solution. I am justing putting the pieces together here.
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
if ('WebSocket' in window) { | |
(function () { | |
function refreshCSS() { | |
var sheets = [].slice.call(document.getElementsByTagName("link")); | |
var head = document.getElementsByTagName("head")[0]; | |
for (var i = 0; i < sheets.length; ++i) { | |
var elem = sheets[i]; | |
var parent = elem.parentElement || head; | |
parent.removeChild(elem); | |
var rel = elem.rel; |
NewerOlder