Skip to content

Instantly share code, notes, and snippets.

@Ta180m
Ta180m / WSL 2 GNOME Desktop.md
Last active May 19, 2024 12:23
Set up a GNOME desktop environment on WSL 2

WSL 2 GNOME Desktop

NOTE: If you want the ultimate Linux desktop experience, I highly recommend installing Linux as your main OS. I no longer use Windows (except in a VM) so I will not be maintaining this guide anymore.

Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.

GNOME is one of the more complex — and that means more difficult to run — desktop environments, so for years people couldn't figure [o

@angeldelrio
angeldelrio / tablapaises.sql
Created August 26, 2015 17:25
Tabla MySQL paises el mundo en español
CREATE TABLE `paises` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) DEFAULT NULL,
`nombre` varchar(80) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
INSERT INTO `paises` VALUES(1, 'AF', 'Afganistán');
INSERT INTO `paises` VALUES(2, 'AX', 'Islas Gland');
INSERT INTO `paises` VALUES(3, 'AL', 'Albania');
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active May 19, 2024 12:14
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@jinjier
jinjier / 250.csv
Last active May 19, 2024 12:07
JavDB Top 250 movies code list. [Updated at 2024/02]
1 LAFBD-41
2 SSNI-497
3 ABP-984
4 IPX-580
5 IPX-811
6 IPX-177
7 STARS-804
8 SMBD-115
9 ABP-968
10 ABF-017
@lorisleiva
lorisleiva / AppWithLocalStorage.vue
Last active May 19, 2024 12:05
Abstraction of the local storage using Vue3's composition API
<script setup>
import useLocalStorage from './useLocalStorage'
const publicKey = useLocalStorage('solana-wallet-public-key')
</script>
<template>
<div>
<input type="text" v-model="publicKey">
<div v-text="publicKey"></div>
</div>
@butageek
butageek / windows_activation.md
Last active May 19, 2024 12:05
Activate Windows for free

For Windows 10

Step 1 - Open PowerShell or Command Prompt as administrator

Step 2 - Install KMS client key

slmgr /ipk your_license_key

Replace your_license_key with following volumn license keys according to Windows Edition:

@cloudwithax
cloudwithax / server.py
Created October 3, 2023 02:02
openai api to ollama api translator
import httpx
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
app = FastAPI()
# Define a Pydantic model for request input
class GenerateRequest(BaseModel):
model: str
prompt: str
@basham
basham / css-units-best-practices.md
Last active May 19, 2024 11:58
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@NjohPrince
NjohPrince / update-about-info.validations.ts
Last active May 19, 2024 11:58
This snippet defines custom validation rules for updating user profile information, ensuring that inputs meet specific criteria before form submission. The updateAboutInfoValidations object is designed to validate fields such as about, companyLocation, jobTitle, and company.
import { UpdateAboutInfoType } from '../../../../services/api/profile.service'
import { Place } from '../../../../types'
import { Validations } from '../../../hooks/use-form'
export const updateAboutInfoValidations: Validations<UpdateAboutInfoType> = {
about: {
custom: {
isValid: (value: string) => value?.length >= 128 && value?.length <= 256,
message: 'Your bio should be atleast 128 characters and atmost 256 characters.',
},