Skip to content

Instantly share code, notes, and snippets.

@mattatz
mattatz / Quaternion.hlsl
Last active May 6, 2024 17:10
Quaternion structure for HLSL
#ifndef __QUATERNION_INCLUDED__
#define __QUATERNION_INCLUDED__
#define QUATERNION_IDENTITY float4(0, 0, 0, 1)
#ifndef PI
#define PI 3.14159265359f
#endif
// Quaternion multiplication
@Arutyun2312
Arutyun2312 / CustomGeometryReader.swift
Last active May 6, 2024 17:10
Custom Geometry Reader
//
// CustomGeometryReader.swift
//
//
// Created by Arutyun Enfendzhyan on 10.01.22.
//
import SwiftUI
struct CustomGeometryReader: View {
@qoomon
qoomon / conventional_commit_messages.md
Last active May 6, 2024 17:09
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@lamperez
lamperez / cs35l41_spi.md
Last active May 6, 2024 17:08
CS35L41 amplifiers in an ASUS Zenbook on linux

Asus Zenbook UX3402 speakers on Linux

Important

THIS IS NOW OBSOLETE WITH KERNEL VERSIONS ≥ 6.7.0

A recent announcement in the kernel mail list by Cirrus developers will solve the problem described here. Therefore, the proposed solutions will be soon obsolete. See this comment (thanks, @flukejones, for the tip).

I got the speakers working on my Asus Zenbook 14 OLED UX3402, the one with Intel CPU and the two CS35L41 audio amplifiers connected over SPI (not the UM3402YA, with AMD and I²C). The amplifiers are supported by the snd_hda_scodec_cs35l41 module in recent kernel versions, but they require some model-specific configuration paramaters, that should be provided by

@ju2wheels
ju2wheels / docker-compose.yml
Created June 10, 2015 20:11
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name:
@zec4o
zec4o / postman-api-testing.md
Last active May 6, 2024 17:09
Testes Automatizados de API com Postman
@ikrishagarwal
ikrishagarwal / setup-zsh-in-codespaces.md
Last active May 6, 2024 17:06
Setup starship, zsh suggestions and syntax highlight for your codespaces.
@zmwangx
zmwangx / Save URL to Safari reading list.scpt
Created February 2, 2014 07:44
AppleScript for saving URL to Safari reading list.
set theUrl to do shell script "pbpaste | grep -o -E \"\\b(https?|ftp|file)://[-A-z0-9+&@#/%?=~_|.;]*[A-z0-9+&@#/%=~_|]\" | head -1"
if theUrl = "" then
set html to do shell script "osascript -e '«class HTML» of (the clipboard as record)' | perl -ne 'print chr foreach unpack(\"C*\",pack(\"H*\",substr($_,11,-3)))'"
set theUrl to do shell script "echo " & quoted form of html & " | grep -o -E \"\\b(https?|ftp|file)://[-A-z0-9+&@#/%?=~_|.;]*[A-z0-9+&@#/%=~_|]\" | head -1"
end if
using terms from application "Safari"
tell application "Safari"
add reading list item theUrl as string
end tell
@nuomi1
nuomi1 / PrintBootCampESDInfo.swift
Last active May 6, 2024 17:05
macOS and BootCamp Latest
#!/usr/bin/env swift
//
// PrintBootCampESDInfo.swift
//
// Created by nuomi1 on 8/5/18.
// Copyright © 2018年 nuomi1. All rights reserved.
//
import Foundation
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 6, 2024 17:00
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent