Skip to content

Instantly share code, notes, and snippets.

@tr4g
tr4g / menger.html
Last active Jul 10, 2021
menger sponge javascript en una linea
View menger.html
Version de 511 bytes
<body bgcolor=0 text=snow onload=N=[K=R.getContext('2d')];for(t=B=127,I=K.getImageData(0,0,q=64,q);t--;$=Math.cos)N[t]=t/43&1;setInterval("t++;for(i=y=-1;y<1;y+=A)for(x=-1;x<1;x+=A=1/32,I.data[i+=4]=h+h)for(m=C=$(a=t/86),S=$(a+8),c=$(b=t/B),s=$(b+8),u=x*C+S,v=y*c-u*s,u=u*c+y*s,w=C-x*S,X=q+9*$(a+b),Y=q+9*$(b-a),Z=t,h=B;--h&&m<q;X+=u,Y+=v,Z+=w)for(m=1;N[X*m&B]+N[Y*m&B]+N[Z*m&B]<2&&m<q;m*=3);K.putImageData(I,0,0)",9)>JSpongy by p01<br><canvas id=R width=64 height=64 style=width:3in;height:3in;background:#fff>
Version de 281 bytes
<canvas id=R><svg onload=setInterval("for(i=q*q,C=M(t+=R.width=q),S=M(t+8);i--;R.getContext`2d`.fillRect(i/q,i%q,1,h/q))for(x=i%q/66-1,y=i/8712-1,m=w=x*C+S,X=Y=h=q,Z=t/q;m<--h;X+=y*C+w*S,Y+=y*S-w*C,Z+=C-x*S)for(m=1;(X*m%96&32)+(Y*m%96&32)+(Z*m%96&32)<64;)m*=3",M=Math.cos,t=q=132)>
@tr4g
tr4g / .eslint.js
Created Jul 9, 2021
eslint de vetmaster vue
View .eslint.js
module.exports = {
root: true,
env: {
node: true,
browser: true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
@tr4g
tr4g / a.md
Created Nov 22, 2020
Limitar memoria WSL 2
View a.md

Editar %UserProfile%\.wslconfig y poner:

[wsl2]
memory=8GB  # Any size you feel like
swap=0
localhostForwarding=true
@tr4g
tr4g / gist:b8995492e06d1d0bf62f6e40ce7ef957
Created Aug 5, 2020
Corregir fix windows scripts UnauthorizedAccess powershell
View gist:b8995492e06d1d0bf62f6e40ce7ef957
Set-ExecutionPolicy RemoteSigned
@tr4g
tr4g / a.md
Last active Jul 12, 2021
⭐️ FRESH WINDOWS -- instalador rapido de chocolatey que pide permiso de admin UAC
View a.md

Recordar instalar node 12 con nvm y que Docker-Compose no puede interconectar contenedores en WSL, se debe usar Windows

Instalar chocolatey (usando PowerShell como admin)

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Instalar mis paquetes favoritos

choco install -y --allow -empty-checksums --ignore-checksum googlechrome slack vscode winrar qbittorrent microsoft-windows-terminal firefox docker-desktop tableplus epicgameslauncher steam battle.net telegram goggalaxy vlc auto-dark-mode geforce-experience wsl cpu-z hwmonitor hwinfo office365business
@tr4g
tr4g / a.md
Created Jul 8, 2020
permitir sudo sin password en ubuntu
View a.md

cambiar la linea %sudo

%sudo ALL=(ALL:ALL) NOPASSWD:ALL

@tr4g
tr4g / a.sh
Last active Jul 8, 2020
installar nodejs 14 en ubuntu 20
View a.sh
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
# si wevea GPG:
sudo apt remove gpg
sudo apt install gnupg1
@tr4g
tr4g / wsl.c
Created Jul 7, 2020
Como ver si estoy en WSL1 o WSL2
View wsl.c
#include <stdio.h>
#include <string.h>
#include <sys/utsname.h>
int main(void)
{
struct utsname buf;
memset(&buf, 0, sizeof buf);
int ret = uname(&buf);
@tr4g
tr4g / btnLoader.js
Created Jun 16, 2020
loader para botones de VueJS
View btnLoader.js
/**
* Muestra un loader en un boton y llama a una funcion con el detenedor como metodo
*
* by @sebolio
*/
/**
* Modo de uso:
*
* [Importación en componente Vue]
@tr4g
tr4g / lid.sh
Created Jun 15, 2020
ver horarios de cierre y apertura de tapa macbook
View lid.sh
sudo log show --predicate 'eventMessage contains "Clamshell change detected"' --last 24h