Skip to content

Instantly share code, notes, and snippets.

@ikrishagarwal
ikrishagarwal / setup-zsh-in-codespaces.md
Last active May 1, 2024 00:10
Setup starship, zsh suggestions and syntax highlight for your codespaces.
@ollieatkinson
ollieatkinson / SVG.swift
Last active May 1, 2024 00:08
Utilise the private CoreSVG framework in Swift
import Darwin
import Foundation
import UIKit
// https://github.com/xybp888/iOS-SDKs/blob/master/iPhoneOS17.1.sdk/System/Library/PrivateFrameworks/CoreSVG.framework/CoreSVG.tbd
// https://developer.limneos.net/index.php?ios=17.1&framework=UIKitCore.framework&header=UIImage.h
@objc
class CGSVGDocument: NSObject { }
@KTibow
KTibow / Monaco.svelte
Created November 6, 2022 20:14
Monaco editor in svelte
<script>
import { onMount } from "svelte";
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker";
import jsonWorker from "monaco-editor/esm/vs/language/json/json.worker?worker";
import cssWorker from "monaco-editor/esm/vs/language/css/css.worker?worker";
import htmlWorker from "monaco-editor/esm/vs/language/html/html.worker?worker";
import tsWorker from "monaco-editor/esm/vs/language/typescript/ts.worker?worker";
let subscriptions = [];
export let content;

These instructions are based on this blogpost by Anton Semjonov and this video by Animortis Productions. Please follow the link if you want more details, they go into much more detail about each step, whereas this document is more focused on being a concise cheat sheet. Let's go.

Install base system

Boot the Ubuntu installation medium. When asked, choose the "Try Ubuntu" option and open a terminal.

Switch to root, otherwise you'll have to type sudo all the time:

sudo su -
@drozzy
drozzy / README.md
Last active May 1, 2024 00:05
FMC (http://www.fmc-modeling.org/) compositional and dynamic elements draw.io libraries

ABOUT

This is just some stencils I created for myself to draw FMC (http://www.fmc-modeling.org/) diagrams with draw.io.

Here is how they look:

lib_fmc_compositional

lib_fmc_dynamic

@ole
ole / thirty-days-of-metal.md
Last active May 1, 2024 00:05
Warren Moore – Thirty Days of Metal
@Ayke
Ayke / cuda-wsl2-ubuntu.md
Last active May 1, 2024 00:04
Everything About CUDA in WSL2 Ubuntu

Prerequisites, i.e. the most important things

  1. Time of writing: Jan 18, 2023. The following assume you're trying to install CUDA on WSL2 Ubuntu.

  2. Check support matrix first before you install any version of CUDA, because chances are the latest CUDA does not have cuDNN support yet, then you'll have to re-install older version if you found out later.

    https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html#cudnn-cuda-hardware-versions

    At the time of writing, the latest cuDNN version is 8.7 and it supports CUDA 11.8.

  3. Windows 10 must be build 20145 or later.

@walduino
walduino / ffchromeCA.yaml
Created January 3, 2020 14:57
Ansible to add cert to CA and make firefox and chrome use the system CA store under linux
---
- name: certauth.yml | Make sure the folder exists (Debian, Ubuntu)
file:
path: /usr/local/share/ca-certificates
state: directory
- name: certauth.yml | Download root CA
get_url:
url: "{{ install_ip }}/xxx.crt"
dest: "/usr/local/share/ca-certificates/xxx.crt"
@brohee
brohee / Updating iLO 3.md
Last active April 30, 2024 23:56
Guide on updating old iLO 3 versions to a more current one

Updating a HP(E) server from iLO 3 version 1.55 to version 1.94

This short document explain how to resolve the issues arising when trying to update an old (Gen7) HP(E) server to the most recent iLO 3 (HPE Integrated Lights-Out) version, which solves a great number of security and usability issues.

Issues

  • Can't connect to iLO with a modern browser, for lack of supported TLS protocol version
    • solved by using FirefoxPortable version 31
    • and in the Firefox31 portable configuration, in the about:config settings, set security.tls.version.min (the minimum acceptable version of the TLS protocol) to 0 in order to be able to negociate down to TLS 1.0 (even if iLO 3 can do 1.1). Keep in mind your browser is now (even more) vulnerable to a host of attacks, do not connect to any potentially hostile host with it.
  • in the iLO web console, checking the option "Enforc
#include <metal_stdlib>
using namespace metal;
namespace SmoothMin2d {
float smoothMin(float x1, float x2, float k) {
float h = clamp(0.5 - 0.5 * (x2 - x1) / k, 0.0, 1.0);
return mix(x1, x2, h) - k * h * (1.0 - h);
}
float circleSDF(float2 point, float2 center, float radius) {