Skip to content

Instantly share code, notes, and snippets.

View ImaginaryStargazer's full-sized avatar
💤

Imaginary Stargazer ImaginaryStargazer

💤
View GitHub Profile
@ImaginaryStargazer
ImaginaryStargazer / README.md
Created February 1, 2024 17:26 — forked from cellularmitosis/README.md
Jason Pepas' Technical Blog
@ImaginaryStargazer
ImaginaryStargazer / zcc.md
Created December 18, 2023 05:33 — forked from kassane/zcc.md
Zig compiler on C/C++ projects - CMake, Meson and other

Unix-like

$> export CC="zig cc $@"
$> export CXX="zig c++ $@"
...
# your build system
$> cmake or meson - commands
@ImaginaryStargazer
ImaginaryStargazer / cgo.md
Created November 8, 2023 18:40 — forked from zchee/cgo.md
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@ImaginaryStargazer
ImaginaryStargazer / LLM.md
Created September 24, 2023 21:36 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

Open a 1x1 pixel powershell window to draw as little attention as possible :

powershell -noexit -command "[console]::WindowWidth=1; [console]::WindowHeight=1; [console]::BufferWidth=[console]::WindowWidth"

powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo -file "name_of_script.ps1"
@ImaginaryStargazer
ImaginaryStargazer / bash-guide-1.md
Created May 26, 2020 20:57 — forked from Titiaiev/bash-guide-1.md
шпаргалка по написанию bash скриптов, по ссылке - оригинальная статья на хабре

Бесплатная книга-сайт на русском, полный гайд
Advanced Bash-Scripting Guide

Введение

BASH — Bourne-Again SHell (что может переводится как «перерожденный шел», или «Снова шел Борна(создатель sh)»), самый популярный командный интерпретатор в юниксоподобных системах, в особенности в GNU/Linux. Ниже приведу ряд встроенных команд, которые мы будем использовать для создания своих скриптов.

>break выход из цикла for, while или until

@ImaginaryStargazer
ImaginaryStargazer / leetcode309.swift
Created May 25, 2020 19:31 — forked from fengyitsai/leetcode309.swift
309. Best Time to Buy and Sell Stock with Cooldown
class Solution {
func maxProfit(_ prices: [Int]) -> Int {
guard !prices.isEmpty else {
return 0
}
var hold = [Int](repeating: Int.min, count: prices.count + 1)
var sell = [Int](repeating: 0, count: prices.count + 1)
var cooldown = [Int](repeating: 0, count: prices.count + 1)
@ImaginaryStargazer
ImaginaryStargazer / .htaccess
Created May 20, 2020 09:28 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/