Skip to content

Instantly share code, notes, and snippets.

@4wk-
4wk- / README.md
Last active April 15, 2024 14:08
Clean uninstall then reinstall of WSL on Windows 10, with systemD support

Uninstall then reinstall WSL on Windows 10 (clean way)

Background

I've been using wsl (version 2) with genie mod for years without issue, but one day, Windows 10 finally catch up on wsl Windows 11 features and gives us a way to use systemD natively.

I wanted to use the new "right way" to enable systemD on Windows Subsystem for Linux (without genie), and I also had a (probably related) infinite Windows RemoteApp error poping in.

Fixing it

A - Uninstall wsl and related stuff

  1. In powershell (as admin)
@johncarter-
johncarter- / breakpoints.md
Last active March 30, 2022 10:23
Tailwind CSS Breakpoint Display
<div class="fixed top-0 left-0 z-50 px-2 py-px text-sm leading-none text-white bg-black rounded-br">
    <span class="inline xxs:hidden xs:hidden sm:hidden md:hidden lg:hidden xl:hidden 2xl:hidden">none</span>
    <span class="hidden xxs:inline xs:hidden sm:hidden md:hidden lg:hidden xl:hidden 2xl:hidden">xxs</span>
    <span class="hidden xxs:hidden xs:inline sm:hidden md:hidden lg:hidden xl:hidden 2xl:hidden">xs</span>
    <span class="hidden xxs:hidden xs:hidden sm:inline md:hidden lg:hidden xl:hidden 2xl:hidden">sm</span>
    <span class="hidden xxs:hidden xs:hidden sm:hidden md:inline lg:hidden xl:hidden 2xl:hidden">md</span>
    <span class="hidden xxs:hidden xs:hidden sm:hidden md:hidden lg:inline xl:hidden 2xl:hidden">lg</span>
    <span class="hidden xxs:hidden xs:hidden sm:hidden md:hidden lg:hidden xl:inline 2xl:hidden">xl</span>
    <span class="hidden xxs:hidden xs:hidden sm:hidden md:hidden lg:hidden xl:hidden 2xl:inline">2xl</span>
@alfredoem
alfredoem / pdf-example.blade.php
Created November 3, 2015 19:17
Template for a invoice render with DomPDF
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aloha!</title>
<style type="text/css">
* {
font-family: Verdana, Arial, sans-serif;
}
@hissy
hissy / gist:7352933
Created November 7, 2013 11:07
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,
@strangerstudios
strangerstudios / heartbeat-api-demo.php
Last active April 30, 2024 17:08
Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6.
<?php
/*
Plugin Name: Heartbeat API Demo
Plugin URI: http://www.strangerstudios.com/wp/heartbeat-api-demo
Description: Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6.
Version: .1
Author: strangerstudios
If logged in as a user and viewing the frontend of your website,
every 15 seconds you should see the following in your Javascript console:
@ideag
ideag / functions.php
Last active February 23, 2022 10:10
A very simple implementation of WordPress front-end login form. Just put this to your theme's functions.php file. Usage: use [tiny_login] shortcode or get_tiny_login_form()/the_tiny_login_form() template tags Arguments: one (optional) argument 'redirect': pass url where to redirect after successful login (default: false); Localization: replace '…
<?php
// a simple WordPress frontend login implementation
// written by Arūnas Liuiza | tinyStudio | wp.tribuna.lt
// Usage: use [tiny_login] shortcode or get_tiny_login_form()/the_tiny_login_form() template tags
// Arguments: one (optional) argument 'redirect': pass url where to redirect after successful login (default: false);
// Localization: replace 'theme' with your text domain string.
// login action hook - catches form submission and acts accordingly
add_action('init','tiny_login');