Skip to content

Instantly share code, notes, and snippets.

@abir-taheer
abir-taheer / instagram-follower-following.js
Last active July 24, 2024 00:09
"This is our community, this is our family, these are our friends." https://www.youtube.com/watch?v=gk7iWgCk14U&t=425s
if (window.location.origin !== "https://www.instagram.com") {
window.alert(
"Hey! You need to be on the instagram site before you run the code. I'm taking you there now but you're going to have to run the code into the console again.",
);
window.location.href = "https://www.instagram.com";
console.clear();
}
const fetchOptions = {
credentials: "include",
1 - Primeiramente, o Docker só tem plena compatibilidade com o Windows 10.
2 - Baixe o Docker neste link: https://www.docker.com/products/docker-desktop
3 - Instale o Docker. A instalação é simples. O Docker Compose já será instalado juntamente.
4 - Apos instalar o Docker, é necessário instalar o WSL (Windows Subsystem for Linux). Para tanto, abra um terminal de linha de comando em modo administrativo e digite o comando abaixo:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
5 - Após o comando finalizar, reinicie o seu computador.
6 - Após o computador reiniciar, abra novamente um terminal de linha de comando em modo administrativo e digite o comando abaixo:
@danpetitt
danpetitt / esmodules.md
Last active July 24, 2024 00:06
Typescript, Jest and ECMAScript Modules

Typescript, Jest and ECMAScript Modules (ESM)

Package.json

Add the type property to package.json to ensure modules are supported:

{
  "type": "module",
}
@NinoM4ster
NinoM4ster / main.go
Created November 11, 2022 03:54
Golang DNS server with multiple A/SRV records
package main
import (
"fmt"
"log"
"github.com/miekg/dns"
)
// adapted from https://gist.github.com/walm/0d67b4fb2d5daf3edd4fad3e13b162cb
@adrianhajdin
adrianhajdin / .eslintrc.cjs
Last active July 23, 2024 23:59
Tailwind CSS Full Course 2023 | Build and Deploy a Nike Website
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
@vishnuhd
vishnuhd / docker-desktop-k8s-local-image.md
Created August 22, 2019 13:17
Reference local images in Docker for Mac - Kubernetes

Reference local images in Docker for Mac - Kubernetes

To run a local baked docker image in docker for mac kubernetes set the imagePullPolicy to Never.

For example:

apiVersion: v1
kind: Pod
metadata:
 name: local-image-test
@wojteklu
wojteklu / clean_code.md
Last active July 23, 2024 23:58
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@doraneko94
doraneko94 / roc_auc_ci.py
Last active July 23, 2024 23:57
Calculating confidence interval of ROC-AUC.
from sklearn.metrics import roc_auc_score
from math import sqrt
def roc_auc_ci(y_true, y_score, positive=1):
AUC = roc_auc_score(y_true, y_score)
N1 = sum(y_true == positive)
N2 = sum(y_true != positive)
Q1 = AUC / (2 - AUC)
Q2 = 2*AUC**2 / (1 + AUC)
SE_AUC = sqrt((AUC*(1 - AUC) + (N1 - 1)*(Q1 - AUC**2) + (N2 - 1)*(Q2 - AUC**2)) / (N1*N2))
@jpillora
jpillora / rdiff-example.sh
Created July 6, 2017 06:41
rdiff file example
# $ apt install rdiff
# $ rdiff --help
# Usage: rdiff [OPTIONS] signature [BASIS [SIGNATURE]]
# [OPTIONS] delta SIGNATURE [NEWFILE [DELTA]]
# [OPTIONS] patch BASIS [DELTA [NEWFILE]]
# Options:
# -v, --verbose Trace internal processing
# -V, --version Show program version
# -?, --help Show this help message
import os
os.environ["OPENAI_API_KEY"] = "XXX"
os.environ["GROQ_API_KEY"] = "YYY"
from routellm.controller import Controller
client = Controller(
routers=["mf"],
strong_model="gpt-4-1106-preview",