Skip to content

Instantly share code, notes, and snippets.

@Pigamo
Pigamo / Vite MultiImage import
Last active May 6, 2024 22:40
Imports multiple images from a folder using Vite globs
const gallery = Object.values(import.meta.glob('@assets/*.{png,jpg,jpeg,PNG,JPEG}', { eager: true, as: 'url' }))
@HimDek
HimDek / Install Windows Subsystem for Android on any Edition of Windows 11 non Insider.md
Last active May 6, 2024 22:38
This Guide will show you how to Install Windows Subsystem for Android or WSA on any Edition of Windows 11 non Insider release.

Install Windows Subsystem for Android on Windows 11 non Insider

WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator. The problem is Windows Subsystem for Android is currently only available through preview via the Beta Channel of the Windows Insider Program. But if you follow this guide, you don't have to be in Windows Insider Program to try it out. The only thing you need is Windows 11 installed and some patience.

Prerequisites:

  • A Device with any version and Edition of Windows 11 installed.
  • Internet Connection.
  • Hyper-V enabled.

Enable Hyper-V:

@netsensei
netsensei / gist:7c71b3215bbf440746151aafc4cfd84f
Last active May 6, 2024 22:37
Setting up a PI-Hole FTL DNS on a local network

Setuping PI-Hole FTL DNS on a local network

pihole comes with it's own lightweight DNS server called FTL. It's geared towards easy of use. Even so, setting up this feature can be hard. Here are some lessons I've learned.

In this example:

  • Your network is setup on 192.168.1.0/24
  • 192.168.1.1 is your DHCP server and IP gateway. (usually your router)
  • 192.168.1.254 is the host running pi-hole
@cubic3d
cubic3d / diff-hr-on-pr.yaml
Last active May 6, 2024 22:31
GitHub Actions workflow to create a resource diff on HelmRelease PRs
name: Create diff on updated HelmReleases
on:
pull_request:
branches:
- master
paths:
- "clusters/**.yaml"
env:
@SMSAgentSoftware
SMSAgentSoftware / Delete-DeviceRecords.ps1
Last active May 6, 2024 22:29
Deletes device records in AD / AAD / Intune / Autopilot / ConfigMgr. Useful for Autopilot test deployments.
[CmdletBinding(DefaultParameterSetName='All')]
Param
(
[Parameter(ParameterSetName='All',Mandatory=$true,ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
[Parameter(ParameterSetName='Individual',Mandatory=$true,ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
[string[]]$ComputerName,
[Parameter(ParameterSetName='All')]
[switch]$All = $True,
[Parameter(ParameterSetName='Individual')]
[switch]$AD,
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active May 6, 2024 22:28
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@Mehmetyaz
Mehmetyaz / lib.rs
Created May 6, 2024 21:33
Rust learning
use std::cell::RefCell;
use serde::{Serialize, Deserialize};
use serde_json::{Value};
use std::collections::HashMap;
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Message {
id: u32,
path: String,
data: HashMap<String, Value>,
@devmahmud
devmahmud / generate-pem.md
Last active May 6, 2024 22:24
Generate pem file to login into remote server

We can use pem file to login into remote server from our local machines. Infact if you use AWS, the only way to SSH into the server is using pem file.

1. On your local Machine from where you require access, Home directory of the user is preferable

cd ~
ssh-keygen -t rsa -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
@joakin
joakin / git-find-me-the-fucking-deleted-file.sh
Last active May 6, 2024 22:24
finding a deleted file in a git repository
# If you don't remember the exact path/name, search the log for deleted files
git log --diff-filter=D --summary | grep delete
# Find the file you want to get from the ouput, and use the path
# Find the commits that involved that path
git log --all -- some/path/to/deleted.file
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted)
git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file