Skip to content

Instantly share code, notes, and snippets.

View sebastiandg7's full-sized avatar
๐ŸŒŠ

Sebastian Duque Gutierrez sebastiandg7

๐ŸŒŠ
View GitHub Profile
@shilman
shilman / mdx-v2-sb-6.5.md
Last active March 20, 2023 15:05
Experimental MDXv2 Support in Storybook 6.5

Experimental MDXv2 Support in Storybook 6.5

The MDX team has just released the long-awaited MDXv2 with dramatically better syntax and performance. It's a huge win for the community! ๐ŸŽ‰

Now I'm excited to announce experimental support in Storybook 6.5. This gist summarizes how to try it out, how to report bugs, and known gotchas that you might encounter along the way.

Installation

Since MDXv2 is a breaking change, it's an opt-in feature in Storybook 6.5.

#!/usr/bin/env sh
set -- $(locale LC_MESSAGES)
yesptrn="$1"; noptrn="$2"; yesword="$3"; noword="$4"
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
input_sink=$(pacmd stat |grep -o -P "(?<=Default source name: ).*")
output_sink=$(pacmd stat |grep -o -P "(?<=Default sink name: ).*")
echo "Input:" $input_sink
import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: 'img'
})
export class LazyImagesDirective {
constructor(ref: ElementRef) {
ref.nativeElement.loading = 'lazy';
}
@wilmarvh
wilmarvh / git checkout-all-branches.sh
Last active April 10, 2025 08:38
git checkout-all-branches
#!/bin/bash
#Whenever you clone a repo, you do not clone all of its branches by default.
#If you wish to do so, use the following script:
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master | grep -v main `; do
git branch --track ${branch#remotes/origin/} $branch
done
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active March 13, 2025 16:33
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

alias gdno="git diff --name-only"
alias gd="git diff"
alias gcm="git commit -m"
alias gaa="git add -A"
alias gca="git commit --amend --no-edit"
alias gcaa="git add --all && git commit --amend --no-edit"
alias gnope="git checkout ."
alias gwait="git reset HEAD"
alias gundo="git reset --soft HEAD^"
alias gl="git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit"
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active October 14, 2024 15:38
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

โš  This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active April 22, 2025 18:51
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <[email protected]>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@aviskase
aviskase / Postman.desktop
Last active January 22, 2025 01:08
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;