Skip to content

Instantly share code, notes, and snippets.

@pmocz
pmocz / latticeboltzmann.py
Last active May 1, 2024 12:12
Create your own Lattice Boltzmann Simulation (with Python): main
# Simulation parameters
Nx = 400 # resolution x-dir
Ny = 100 # resolution y-dir
rho0 = 100 # average density
tau = 0.6 # collision timescale
Nt = 4000 # number of timesteps
# Lattice speeds / weights
NL = 9
idxs = np.arange(NL)
@nasirhafeez
nasirhafeez / freeradius-advanced-use-cases.md
Last active May 1, 2024 12:11
FreeRADIUS Advanced Use Cases
@HimDek
HimDek / Install Windows Subsystem for Android on any Edition of Windows 11 non Insider.md
Last active May 1, 2024 12:11
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:

@tobiase
tobiase / responsive_image.py
Created April 25, 2018 23:30 — forked from davecranwell/responsive_image.py
Responsive image tag for Wagtail CMS
from django import template
from django.template import Context
from django.template.base import parse_bits
from wagtail.wagtailimages.templatetags.wagtailimages_tags import ImageNode
from wagtail.wagtailimages.models import Filter, SourceImageIOError, InvalidFilterSpecError
from britishswimming.utils.models import SocialMediaSettings
register = template.Library()
@smeijer
smeijer / github-sync.sh
Created February 6, 2024 17:43
sync github repositories
#! /usr/bin/env node
import fs from 'fs';
import { promisify } from 'util';
import path from 'path';
import { spawn } from 'child_process';
const fsExists = promisify(fs.exists);
if (!process.env.GITHUB_TOKEN) throw new Error("process.env.GITHUB_TOKEN is required");
if (!process.env.GITHUB_USER) throw new Error("process.env.GITHUB_USER is required");
@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