Skip to content

Instantly share code, notes, and snippets.

@ravenscroftj
ravenscroftj / minimal_continue_groq_config.md
Created April 28, 2024 08:46
Minimal Groq + Continue.Dev Recipe

Minimal continue.dev Groq Config

{
  "models": [
    {
      "title":"Groq Llama 8b",
      "provider":"openai",
      "model": "llama3-8b-8192",
      "apiBase": "https://api.groq.com/openai/v1",
 "apiKey": "",
@davidteren
davidteren / nerd_fonts.md
Last active May 10, 2024 07:58
Install Nerd Fonts via Homebrew [updated & fixed]
@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 10, 2024 07:57
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@sv99
sv99 / How can I replace a newline (\n) using sed.md
Last active May 10, 2024 07:56
How can I replace a newline (\n) using sed?

stackoverflow (hdorio)

Fast answer:

sed ':a;N;$!ba;s/\n/ /g' file
  1. :a create a label 'a'
  2. N append the next line to the pattern space
  3. $! if not the last line, ba branch (go to) label 'a'
  4. s substitute, /\n/ regex for new line, / / by a space, /g global match (as many times as it can)
@fauxpark
fauxpark / applefn.patch
Last active May 10, 2024 07:54
QMK Apple Fn
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 18f8b0bbfc..4ef3e230e4 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -878,6 +878,10 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
endif
endif
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes)
+ OPT_DEFS += -DAPPLE_FN_ENABLE
@daggerhart
daggerhart / wp-disable-login-form.php
Last active May 10, 2024 07:52
Completely disable the WordPress login form. You have your reasons.
<?php
// pick a hook from the wp-login.php file that best our needs. I chose the filter: wp_login_errors
add_filter( 'wp_login_errors', 'my_login_form_lock_down', 90, 2 );
/**
* Completely lock down the WordPress login form by hijacking the page
* and only executing the the login header, footer, and necessary
* closing tags.
*
* Provide a secret way to show the login form as a url variable in
@Yousha
Yousha / .gitignore
Last active May 10, 2024 07:52
.gitignore for PHP developers.
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
@nh2
nh2 / tcp-nodelay.md
Last active May 10, 2024 07:51
Understanding TCP_NODELAY

I believe the following is the best way to work with Nagle's algorithm / TCP_NODELAY / TCP_CORK.

It is described in this RedHat manual and the verdict is:

  • Set TCP_NODELAY = 1, always.
  • If you can batch data for sending by creating a buffer manually, or using writev(), prefer that.
  • If you cannot (e.g. "when using different libraries that provides abstractions for layers" from the above manual):
    • Set TCP_CORK = 1, then write the data, then set TCP_CORK = 0.
  • This builds a packet in kernel space and then flushes it out.
@kspalaiologos
kspalaiologos / hello.mb
Last active May 10, 2024 07:50
A small hello world in malbolge
(=<`#9]~6ZY327Uv4-QsqpMn&+Ij"'E%e{Ab~w=_:]Kw%o44Uqp0/Q?xNvL:`H%c#DD2^WV>gY;dts76qKJImZ

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