Skip to content

Instantly share code, notes, and snippets.

@sirodoht
sirodoht / index.html
Last active May 13, 2020 18:16
Basic HTML/CSS boilerplate with Normalize.css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
@sirodoht
sirodoht / new-db-postgres.md
Last active July 30, 2021 09:15
How to create new database and new user with password on PostgreSQL (the easiest way)

How to create new database and new user with password on PostgreSQL

First, create db:

$ createdb avocado

Then, create user:

$ createuser avocado
@ninjarobot
ninjarobot / Makefile
Last active September 6, 2022 05:49
Building nginx for macOS without homebrew
# default target so running 'make' by itself wll download and build nginx
build: nginx
cd nginx && ./configure --with-pcre=../pcre2 && make
nginx: pcre2
curl -O https://nginx.org/download/nginx-1.21.6.tar.gz
tar -xzvf nginx-*.tar.gz
mv nginx-*/ nginx
rm nginx-*.tar.gz
@sirodoht
sirodoht / vscode.json
Last active March 22, 2023 18:13
VSCode settings JSON configuration
{
"editor.bracketPairColorization.enabled": true,
"editor.cursorStyle": "block",
"editor.dragAndDrop": false,
"editor.hover.enabled": false,
"editor.linkedEditing": false,
"editor.minimap.enabled": true,
"editor.minimap.showSlider": "always",
"editor.minimap.size": "fill",
"editor.renderWhitespace": "selection",
@benob
benob / reshard.py
Created March 4, 2023 17:35
Script to decompose/recompose LLAMA LLM models with different number of shards.
# script to decompose/recompose llama model in different number of shards
# note that it loads the full model * 2 in cpu memory
import os
import json
import sys
import torch
import glob
if len(sys.argv) != 4:
@gubatron
gubatron / compiling_building_c_cpp_notes.md
Last active February 29, 2024 05:23
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015;

Last update on December 14, 2023

Updated on February 27, 2023

Updated August 29, 2019.

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@Kartones
Kartones / postgres-cheatsheet.md
Last active April 12, 2024 17:44
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active April 16, 2024 14:07
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH