Skip to content

Instantly share code, notes, and snippets.

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 3, 2024 04:28
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@kauefraga
kauefraga / a-main.py
Last active May 3, 2024 04:27
A oração do programador 🙏
print("""
Código nosso que estás em C
Santificado seja vós, Console
Venha a nós o vosso array[10]
E seja feita, sim, {vossa chave}
Assim no if{} como no else{}
O for (nosso; de cada dia; nos dai hoje++)
Debugai as nossas sentenças
Assim como nós colocamos o ponto e vígula esquecido;
E não nos deixeis errar identação
@bradtraversy
bradtraversy / terminal-commands.md
Last active May 3, 2024 04:23
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen
@mlanett
mlanett / rails http status codes
Last active May 3, 2024 04:15
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@PARC6502
PARC6502 / OpenSourceBaas.md
Last active May 3, 2024 04:12
List of open source, self hosted BaaS - Backend as a service

Backend as a Service

Supabase - ~52K stars

  • Designed explicitly as an open source firebase alternative
  • Typescript based
  • Docker support

Appwrite - ~32K stars

  • Written in JavaScript and PHP
  • Docker based
  • Realtime support across all services
@kiliman
kiliman / globals.js
Created January 5, 2022 19:42
remix-fastify adapter
'use strict';
var node = require('@remix-run/node');
node.installGlobals();
@soulruins
soulruins / ConvertTo-Encoding.ps1
Last active May 3, 2024 04:11
Простенькая функция для перекодировки текста из одной кодировки в другую #powershell #decode #encode #codepage #charset #function
# "Проверка" | ConvertTo-Encoding windows-1251 koi8-r
# Get-Content notes.txt | ConvertTo-Encoding "windows-1251" "koi8-r" | Set-Content decoded.txt
function ConvertTo-Encoding ([string]$From, [string]$To){
Begin{
$encFrom = [System.Text.Encoding]::GetEncoding($from)
$encTo = [System.Text.Encoding]::GetEncoding($to)
}
Process{
$bytes = $encTo.GetBytes($_)
$bytes = [System.Text.Encoding]::Convert($encFrom, $encTo, $bytes)
@adrianhajdin
adrianhajdin / cron.route.ts
Created September 30, 2023 10:15
Web Scraping Full Course 2023 | Build and Deploy eCommerce Price Tracker
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";
@killerbees19
killerbees19 / .bash_aliases
Last active May 3, 2024 04:08
Supermicro Fan Control
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'
@cpitt
cpitt / memoizeLocalStorage.js
Last active May 3, 2024 03:58
Memoize a function using local storage as it's cache
/**
* 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(