Skip to content

Instantly share code, notes, and snippets.

@mcmah309
mcmah309 / context.txt
Created December 14, 2024 19:32 — forked from zackangelo/context.txt
Llama 3.3 Multi-tool Use Context Window
<|begin_of_text|><|start_header_id|>system<|end_header_id|>Environment: ipython
Cutting Knowledge Date: December 2023
Today Date: 13 Dec 2024
# Tool Instructions
You may optionally call functions that you have been given access to. You DO NOT have
to call a function if you do not require it. ONLY call functions if you need them. Do NOT call
functions that you have not been given access to.
import asyncio
import base64
import json
import os
import pyaudio
from websockets.asyncio.client import connect
class SimpleGeminiVoice:
def __init__(self):
@khronokernel
khronokernel / electron_patcher.py
Last active December 14, 2024 19:25
Electron and Chrome patcher to force OpenGL rendering
"""
electron_patcher.py: Enforce 'use-angle@1' in Chrome and Electron applications
Version 1.0.0 (2024-08-11)
"""
import enum
import json
from pathlib import Path
@cyruscyliu
cyruscyliu / install-python38-ubuntu1604.sh
Last active December 14, 2024 19:23
Install python3.8 on Ubuntu 16.04
sudo apt-get update
sudo apt-get install -y build-essential \
zlib1g-dev libncurses5-dev libgdbm-dev \
libnss3-dev libssl-dev libreadline-dev \
libffi-dev libsqlite3-dev wget libbz2-dev
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
tar -xf Python-3.8.0.tgz
cd Python-3.8.0
./configure --enable-optimizations
make -j 8
@rponte
rponte / using-uuid-as-pk.md
Last active December 14, 2024 19:23
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@DevBrent
DevBrent / README.md
Last active December 14, 2024 19:20
MongoDB Index Export/Migration Tool

MongoDB Index Export/Migration Tool

Description:

Have you ever needed to copy your indexes from one platform to another without restoring a backup?

Instructions:

Run this script on the source database. You have one option which is to force the background option.

var always_background = true;
;;; widen-window.el --- Widen selected window
;; Copyright (C) 1985, 1989, 1992, 1993, 1994, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
;; Copyright (C) 2008 Yuto Hayamizu
;; Copyright (C) 2014 Akira Tamamori
;; Author: Akira Tamamori
;; Keywords: convenience
;; Version: 0.1.2
@kenszeapp
kenszeapp / SQLServer_SearchHelpers_20221212.sql
Created January 19, 2023 09:16
TSQL shortcut query improve productivity
use master
/*
SQL Server Management Studio
Keyboard Shortcut-Enabled Helper Procedures
1. Execute this script on SQL Server
2. Configure Management Studio:

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@itsmikita
itsmikita / README.md
Last active December 14, 2024 19:14
Create bootable USB drive from InstallMacOSX.pkg

Create bootable USB drive from InstallMacOSX.pkg

  1. Erase USB drive with Disk Utility using format Mac OS Extended (Journaled) and Master Boot Record and call it MyVolume
  2. Use Finder to mount/open InstallMacOSX.dmg.
  3. Run following commands:
pkgutil --expand /Volumes/Install\ OS\ X/InstallMacOSX.pkg /tmp/El\ Capitan
diskutil eject Install\ OS\ X
cd /tmp/El\ Capitan