Skip to content

Instantly share code, notes, and snippets.

@thelindat
thelindat / myclass.lua
Last active April 19, 2024 18:30
ox_lib class example
-- ref: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Classes_in_JavaScript
-- Person Class
---@class Person : OxClass
---@field name string
local Person = lib.class('Person')
function Person:constructor(name)
print('calling Person constructor for', name)
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 19, 2024 18:25
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@cwhite92
cwhite92 / fqcn_from_path.php
Last active April 19, 2024 18:25
Get the FQCN from a PHP file specified by file path
<?php
public static function fqcnFromPath(string $path): string
{
$namespace = $class = $buffer = '';
$handle = fopen($path, 'r');
while (!feof($handle)) {
$buffer .= fread($handle, 512);
@Ynng
Ynng / custom.css
Last active April 19, 2024 18:24
vscode vtuber logo
.editor-group-watermark > .letterpress{
background-image: url("https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/VSCode/VSCode.png") !important;
opacity: .75;
}
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active April 19, 2024 18:20
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@AnierinBliss
AnierinBliss / README.md
Last active April 19, 2024 18:19
Compiling Evolution X 8.x for currently supported tensor-based Google Pixel devices

Install android build dependencies

curl https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/android_build_env.sh -o android_build_env.sh
chmod +x android_build_env.sh
./android_build_env.sh
sudo apt-get install python3-pip
sudo pip install lxml
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active April 19, 2024 18:14
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@dfinke
dfinke / psllm.ps1
Last active April 19, 2024 18:14
<#
.EXAMPLE
llm "what is the capital of spain" -provider openai
.EXAMPLE
llm "what is the capital of spain" -provider anthropic
.EXAMPLE
llm "what is the capital of spain" -provider gemini
#>
@mkhl
mkhl / acme-editorconfig
Created April 1, 2019 20:05
EditorConfig support for Acme
#!/usr/local/plan9/bin/rc
. 9.rc
. $PLAN9/lib/acme.rc
fn convert {
awk -F'=' '
$1 == "indent_style" {
print "Spaces", ($2 == "space") ? "on" : "off"
}