Skip to content

Instantly share code, notes, and snippets.

import llama_cpp
import re
import json
# Model configuration
# tested with mistral, llama2, llama3, and phi3
model_path = "/path/to/model"
base_llm = llama_cpp.Llama(model_path, seed=42, n_gpu_layers=-1, n_ctx=4096, verbose=False, temperature=0.0)
@pradippatil
pradippatil / install_curl_linux.sh
Last active December 25, 2024 04:29
Installing curl on linux from source
#!/bin/bash
## Lubuntu (Ubuntu 16.04 gave me error when tried to install curl using apt-gt
#
## sudo apt-get install curl
# Reading package lists... Done
# Building dependency tree
# Reading state information... Done
# Package curl is not available, but is referred to by another package.
# This may mean that the package is missing, has been obsoleted, or
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active December 25, 2024 04:27
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@0xdevalias
0xdevalias / generating-synth-patches-with-ai.md
Last active December 25, 2024 04:27
Some notes on generating software synthesizer patches with AI
#!/usr/bin/env python3
"""
Human quality transcripts from audio files using
AssemblyAI for transcription and Google's Gemini for enhancement.
Requirements:
- AssemblyAI API key (https://www.assemblyai.com/)
- Google API key (https://aistudio.google.com/)
- Python packages: assemblyai, google-generativeai, pydub
@pb111
pb111 / Descriptive Statistics with Python.ipynb
Created June 16, 2019 07:41
Descriptive Statistics with Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@data-enhanced
data-enhanced / jupyter_default_browser.md
Last active December 25, 2024 03:58
Change default browser for Jupyter Notebooks in Mac OS X

Change the Default Browser for Jupyter Notebooks in OS X

Step 1. Create an editable config file for Jupyter notebooks.

To do this, open Terminal and type:

jupyter notebook --generate-config

This generates the file:

~/.jupyter/jupyter_notebook_config.py

@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active December 25, 2024 03:50
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@stokito
stokito / webdav_curl.md
Last active December 25, 2024 03:49
WebDAV with curl or wget for scripts and command line

Assuming the following:

  • Webdav share URL: http://example.com/dav/
  • Username: user
  • Password: pass

curl options:

  • -u username:password use HTTP Basic authorization with the folowing username and password
  • -X GET send a request with GET method. You can use any other methods here.
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active December 25, 2024 03:48
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