Skip to content

Instantly share code, notes, and snippets.

View mykiwi's full-sized avatar
🥝
$ docker buildx bake future

Romain Gautier mykiwi

🥝
$ docker buildx bake future
View GitHub Profile
@dhh
dhh / linux-setup.sh
Last active April 27, 2024 10:05
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@astuyve
astuyve / deny_snippet.json
Created January 17, 2024 15:00
Deny cloudwatch permissions from Lambda to save money
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
@khalidx
khalidx / node-typescript-esm.md
Last active April 22, 2024 15:40
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@LiquidityC
LiquidityC / Makefile
Last active December 1, 2023 03:24
Generic drop in Makefile
VERSION = \"1.0.0\"
PREFIX ?= out
INCDIR = inc
SRCDIR = src
LANG = c
OBJDIR = .obj
MODULE = binary_name
CC = gcc
@rain-1
rain-1 / llama-home.md
Last active February 22, 2024 05:52
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@lyrixx
lyrixx / CHANGELOG-3.0.md
Last active February 23, 2024 14:36
Symfony CHANGELOG

Bridge/Doctrine

  • removed EntityChoiceList
  • removed $manager (2nd) and $class (3th) arguments of ORMQueryBuilderLoader
  • removed passing a query builder closure to ORMQueryBuilderLoader
  • removed loader and property options of the DoctrineType

Bridge/Monolog

  • deprecated interface Symfony\Component\HttpKernel\Log\LoggerInterface has been removed
@ruudk
ruudk / README.md
Created December 8, 2022 15:35
How to find the files that are the slowest to analyze with PHPStan?

How to find the files that are the slowest to analyze with PHPStan?

For us, PHPStan became a bit slower with every release. We have a very large codebase with 10.000+ classes. There seem to be a few known issues related to big arrays.

See: phpstan/phpstan#8353 phpstan/phpstan#8146

To understand which files are problematic we run the following command:

@lyrixx
lyrixx / ContainerTest.php
Last active August 31, 2023 07:32
Test applications services can boot
<?php
namespace Tests\Integration;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
@lyrixx
lyrixx / test.php
Last active November 10, 2023 14:27
Symfony Playgound with its Container and a custom configuration
<?php
use App\Kernel;
require __DIR__.'/vendor/autoload_runtime.php';
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;