Skip to content

Instantly share code, notes, and snippets.

@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 11, 2024 13:58
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JoeyBurzynski
JoeyBurzynski / cloudflare-worker-ip-to-real-client-ip-address.js
Last active May 11, 2024 13:58
Resolving Cloudflare Worker IP Issues [Replace Cloudflare Worker IP with Real Client IP in X-Forwarded-For HTTP Header]
// Cloudflare Worker Sandbox Examples
// Learning here, not intended for production use.
// https://cloudflareworkers.com/#6bc84bcddcf251074b41adba568a9284:https://tutorial.cloudflareworkers.com
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
})
/**
@clee704
clee704 / pat.py
Last active May 11, 2024 13:56
Azure DevOps PAT helper
#!/bin/env python3
#
# Copyright 2024 Chungmin Lee
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the “Software”), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@jonpulsifer
jonpulsifer / toggle-virtualization.bat
Last active May 11, 2024 13:55
Virtualization must be disabled to use CS:GO anti-cheat clients like FACEIT and ESEA, but I like to use WSL2 and Docker, and this script helps me do that
@echo off
echo Virtualization must be disabled to use anti-cheat clients like FACEIT and ESEA
echo.
net session >nul 2>&1
if %ERRORLEVEL% EQU 0 goto :chchchchoices
echo This script requires elevated privileges. Re-run as Administrator to continue
goto :exit
:chchchchoices
@ih2502mk
ih2502mk / list.md
Last active May 11, 2024 13:54
Quantopian Lectures Saved
@bespokoid
bespokoid / linux_wifi_setup.md
Created October 13, 2019 21:14
Connecting to wifi network through command line #linux #cmd

Connecting to wifi network through command line

I am trying to connect to my WEP network just using the command-line (Linux).

I run:

sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits'

Then I try to obtain an IP with

@mattbell87
mattbell87 / remote-wsl.md
Last active May 11, 2024 13:49
VSCode Remote: Connect to WSL2 from another machine

VSCode Remote: Connect to WSL2 from another machine

Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.

Proxy jump method

  1. On the host set up OpenSSH for Windows
  2. Run wsl --update to make sure you are running the latest WSL
  3. Open WSL and install another SSH server inside WSL with sudo apt-get install openssh-server
  4. Now run sudo systemctl enable --now ssh to automatically start ssh when WSL starts.
@markhowellsmead
markhowellsmead / event_query.php
Last active May 11, 2024 13:49
Complex WordPress meta query by start and end date (custom meta fields)
<?php
/**
* Complex WordPress meta query by start and end date (custom meta fields)
* Intended for use on the `pre_get_posts` hook.
* Caution; this makes the query very slow - several seconds - so should be
* implemented with some form of caching.
*
* mark@sayhello.ch 22.10.2019, based on code from 201 onwards
*/
@stevebauman
stevebauman / RouteServiceProvider.php
Last active May 11, 2024 13:54
Throw exception on Eloquent model binding name mismatch
<?php
namespaced App\Providers;
use RuntimeException;
use Illuminate\Support\Facades\Route;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Routing\ImplicitRouteBinding;
class RouteServiceProvider extends ServiceProvider