Skip to content

Instantly share code, notes, and snippets.

@dchest
dchest / uuid.php
Created February 15, 2020 19:26
UUIDv4 generator for PHP 7+
<?php
/**
* Generate a random UUIDv4.
* @return string UUID
*/
function generate_uuid()
{
$b = random_bytes(16);
$b[6] = chr(ord($b[6]) & 0x0f | 0x40);
@av
av / post.md
Created December 28, 2024 20:14
r/LocalLLaMA - a year in review

r/LocalLLaMA - a year in review

This community was a great part of my life for the past two years, so as 2024 comes to a close, I wanted to feed my nostalgia a bit. Let me take you back to the most notable things happened here this year.

This isn't a log of model releases or research, rather things that were discussed and upvoted by the people here. So notable things missing is also an indication of what was going on of sorts. I hope that it'll also show the amount of progress and development that happend in just a single year and make you even more excited for what's to come in 2025.


The year started with the excitement about Phi-2 (443 upvotes, by u/steph_pop). Phi-2 feels like ancient history these days, it's also fascinating that we end the 2024 with the Phi-4. Just one week after, people discovered that apparently it [was trained on the software engineer's diary](https://reddit.com/r/LocalLLaMA/comments/1

import asyncio
import base64
import json
import os
import pyaudio
from websockets.asyncio.client import connect
class SimpleGeminiVoice:
def __init__(self):
@benixal
benixal / worker.js
Last active December 29, 2024 06:50
Free Telegram Upload Center
/*
https://github.com/benixal
https://www.youtube.com/@benixal
*/
export default {
// @ts-ignore
async fetch(request, env, ctx) {
@netbiosX
netbiosX / FodhelperUACBypass.ps1
Last active December 29, 2024 06:49
Bypass UAC via Fodhelper binary in Windows 10 systems
<#
.SYNOPSIS
This script can bypass User Access Control (UAC) via fodhelper.exe
 
It creates a new registry structure in: "HKCU:\Software\Classes\ms-settings\" to perform UAC bypass and starts
an elevated command prompt.
 
.NOTES
Function : FodhelperUACBypass
File Name : FodhelperUACBypass.ps1
@liuran001
liuran001 / config.yaml
Last active December 29, 2024 06:49
mihomo (Clash Meta) 懒人配置
# mihomo (Clash Meta) 懒人配置
# 版本 V1.15-241205
# https://gist.github.com/liuran001/5ca84f7def53c70b554d3f765ff86a33
# https://obdo.cc/meta
# 作者: 笨蛋ovo (bdovo.cc)
# Telegram: https://t.me/baka_not_baka
# 关注我的 Telegram 频道谢谢喵 https://t.me/s/BDovo_Channel
# 修改自官方示例规则 https://wiki.metacubex.one/example/#meta
# 转载请保留此注释
# 尽量添加了较为详尽的注释,不理解的地方建议对照 虚空终端 (Clash Meta) Docs 进行理解
@0xjac
0xjac / private_fork.md
Last active December 29, 2024 06:47
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@bmatcuk
bmatcuk / create-usb.sh
Created May 30, 2019 04:38
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list
@AidanSun05
AidanSun05 / DockBuilderExample.cpp
Created February 5, 2022 00:29
A commented example for Dear ImGui's DockBuilder API.
// The DockBuilder API is still marked as experimental, include Dear ImGui's internal header to pull the functions in:
#include "imgui_internal.h"
// [...]
// Beginning of main loop
// 1. DockBuilder functions only need to run once to take effect.
// This state variable will let us check for the first frame of the app.
static bool firstLoop = true;