Skip to content

Instantly share code, notes, and snippets.

@myyellowshoe
myyellowshoe / AutoScalingSvgSolution.md
Last active February 5, 2025 14:10
Auto Scaling Svg Solution

Autoscaling SVG's

Scaling svgs is annoying and most solutions require tradoffs I don't want. I'm suprised the ammount of solutions out there that are pretty subpar or require extra overhead.

What I don't want:

  • use an image tag
  • use wrappers
  • use weird padding
  • pass down props for width/height or viewBox props.
#!/bin/bash
set -eu
set -x
docker build -t deno-cent7 .
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
@silver-xu
silver-xu / ts-boilerplate.md
Last active March 2, 2025 19:56
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@darkr4y
darkr4y / httpsrv.py
Last active November 13, 2024 15:18
python simple http server with upload & download
#!/usr/bin/env python
"""Extend Python's built in HTTP server to save files
curl or wget can be used to send files with options similar to the following
curl -X PUT --upload-file somefile.txt http://localhost:8000
wget -O- --method=PUT --body-file=somefile.txt http://localhost:8000/somefile.txt
__Note__: curl automatically appends the filename onto the end of the URL so
@carlesloriente
carlesloriente / compile-and-install-glibc_2.18-centos-7.sh
Last active February 1, 2025 23:29
Compile and install GLIBC 2.18 in CentOS 7
# Check gist comments to verify system PATH and or adapt it.
wget https://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxvf glibc-2.18.tar.gz
cd glibc-2.18
mkdir build
cd build
../configure --prefix=/opt/glibc-2.18
make -j4
sudo make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/glibc-2.18/lib
@sergiks
sergiks / README.md
Last active November 19, 2024 12:20
Let's Encrypt wildcard certificates in docker

NGINX and Certbot example with CloudFlare API in Docker

Sample config files to demonstrate seup that creates and updates free SSL certificates from Let's Encrypt given that the domains are maintained at CloudFlare service.

How it works

Certbot verifies domains ownership by accessing CloudFlare API that adds temporary TXT DNS records. To enable it You must provide your CloudFlare API token. More details in documentation for dns-cloudflare Certbot plugin.

Certbot saves created certificates in Docker volume certbot_etc. Pay attention to output of the certbot run - it mentions path to the created certificates.

// Only export the things that are actually needed, cut out everything else
export { WebGLRenderer } from 'three/src/renderers/WebGLRenderer.js'
export { ShaderLib } from 'three/src/renderers/shaders/ShaderLib.js'
export { UniformsLib } from 'three/src/renderers/shaders/UniformsLib.js'
export { UniformsUtils } from 'three/src/renderers/shaders/UniformsUtils.js'
export { ShaderChunk } from 'three/src/renderers/shaders/ShaderChunk.js'
export { Scene } from 'three/src/scenes/Scene.js'
export { Mesh } from 'three/src/objects/Mesh.js'
export { LineSegments } from 'three/src/objects/LineSegments.js'
@noelbundick
noelbundick / LICENSE
Last active March 30, 2025 13:12
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@itspig
itspig / hosts
Last active March 18, 2025 18:30
小米盒子、小米电视去广告 hosts file for MiBox & MiTV
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 cdn.ad.xiaomi.com
127.0.0.1 log.ad.xiaomi.com
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 o2o.api.xiaomi.com
127.0.0.1 gallery.pandora.xiaomi.com
127.0.0.1 mishop.pandora.xiaomi.com
127.0.0.1 upgrade.mishop.pandora.xiaomi.com