Skip to content

Instantly share code, notes, and snippets.

@lmarz
lmarz / egl-on-wayland-xdg.c
Last active May 1, 2024 12:09
Simple example of a wayland client with xdg-shell and EGL
/* Compile with:
* wayland-scanner private-code /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml xdg-shell.c
* wayland-scanner client-header /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml xdg-shell.h
* gcc -c xdg-shell.c
* gcc -c egl-on-wayland-xdg.c
* gcc -o egl-on-wayland-xdg xdg-shell.o egl-on-wayland-xdg.o -lwayland-egl -lwayland-client -lEGL -lGL
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@GetVladimir
GetVladimir / Setup-iCloud+-Custom-Domain-Catch-All-email-with-Gmail.md
Last active May 1, 2024 12:08
How to setup iCloud+ Custom Domain Catch All email with Gmail

How to setup iCloud+ Custom Domain Catch All email with Gmail

I've recently tested on how to move the custom domain catch all email from G Suite to the new iCloud+ Catch All feature and wanted to share my experience.

The end result is having Custom Domain email and Catch All routing, that can be fully used via Gmail, including receiving and sending emails.


The steps

  • Setup your Custom Domain (or subdomain) with iCloud+

React Basics Review - State, Styling & Event Handling

Setup

Create a new React project in stackblitz.com

Exercises

  1. Remove everything other than the <div> from <App>
@jrknox1977
jrknox1977 / ollama_dspy.py
Created February 9, 2024 18:06
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.

During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot

@KlassenKonstantin
KlassenKonstantin / ClippedForeground.kt
Last active May 1, 2024 12:05
evervault.com inspired animation
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.nativeCanvas
@Composable
@andrewlimaza
andrewlimaza / keep-pmpro-member-price-manual-renewal.php
Created November 4, 2021 10:33
Keep pre-existing members on their initial checkout price when renewing their membership level.
<?php
/**
* Keep pre-existing members on their initial checkout price when manually renewing. Grandfather 'old' members when their levels pricing changes.
* Note: This is not needed for recurring membership levels and is designed for levels with an expiration date.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@lopspower
lopspower / README.md
Last active May 1, 2024 12:02
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@regiellis
regiellis / iterative_upscale.json
Last active May 1, 2024 12:01
Iterative Upscale Images Workflow
{
"last_node_id": 25,
"last_link_id": 41,
"nodes": [
{
"id": 4,
"type": "Width/Height Literal",
"pos": [
-209,
451
@idleberg
idleberg / vscode-macos-context-menu.md
Last active May 1, 2024 12:01
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉