Skip to content

Instantly share code, notes, and snippets.

@thegreatestminer
thegreatestminer / encoded-20201212150102.txt
Created December 12, 2020 15:01
MobaXTerm Professional x64 License Key [READ COMMENTS]
UEsDBBQAAAAIABNQjFGCf/GfLgAAACwAAAAHAAAAUHJvLmtleTMqdncpCXQOKDAp9woMzEo1MTVOrHAzTjTLME7VNs1LK8owTjQpcU8tcuLlAgBQSwECFAAUAAAACAATUIxRgn/xny4AAAAsAAAABwAAAAAAAAAAAAAAAAAAAAAAUHJvLmtleVBLBQYAAAAAAQABADUAAABTAAAAAAA=
@sindresorhus
sindresorhus / esm-package.md
Last active May 2, 2024 20:54
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@RamonLopezEscudero
RamonLopezEscudero / Merge_Sort.c
Last active May 2, 2024 20:51
Código del método de ordenamiento "Merge Sort"
#include <stdio.h>
#include <stdlib.h>
void merge(int *array, int p, int q, int r)
{
// Declaracion de variables
int i, j, k;
int n_1 = (q - p) + 1;
int n_2 = (r - q);
int *L, *R;
@ArthurZucker
ArthurZucker / mamba_peft.py
Created March 7, 2024 09:32
Mamba peft finetuning
from datasets import load_dataset
from trl import SFTTrainer
from peft import LoraConfig
from transformers import AutoTokenizer, AutoModelForCausalLM, TrainingArguments
tokenizer = AutoTokenizer.from_pretrained("state-spaces/mamba-130m-hf")
model = AutoModelForCausalLM.from_pretrained("state-spaces/mamba-130m-hf")
dataset = load_dataset("Abirate/english_quotes", split="train")
training_args = TrainingArguments(
output_dir="./results",
num_train_epochs=3,
@leocomelli
leocomelli / git.md
Last active May 2, 2024 20:46
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@tvst
tvst / streamlit_app.py
Last active May 2, 2024 20:46
Simple way to run heavy computations without slowing down other Streamlit users
import streamlit as st
import concurrent.futures # We'll do computations in separate processes!
import mymodule # This is where you'll do the computation
# Your st calls must go inside this IF block.
if __name__ == '__main__':
st.write("Starting a long computation on another process")
# Pick max number of concurrent processes. Depends on how heavy your computation is, and how
# powerful your machine is.
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active May 2, 2024 20:45
Building a react native app in WSL2
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@sarahcssiqueira
sarahcssiqueira / .phpcs.xml
Created August 3, 2023 23:18
Workaround to handle PSR-4 && WordPress Coding Standards at same time
<?xml version="1.0"?>
<ruleset name="CS">
<description>PHPCS example</description>
<config name="testVersion" value="5.6-"/>
<exclude-pattern>vendor/*</exclude-pattern>
<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="100"/>
<arg name="extensions" value="php"/>
@sourceperl
sourceperl / main.c
Last active May 2, 2024 20:43
Test code MSP430 I2C LCD
#include <msp430g2211.h>
#define I2C_SDA BIT0 // Serial Data line
#define I2C_SCL BIT6 // Serial Clock line
/* A crude delay function. Tune by changing the counter value. */
void delay( unsigned int n ) {
volatile int i;
for( ; n; n-- ) {