Skip to content

Instantly share code, notes, and snippets.

@choco-bot
choco-bot / 1.RegistrySnapshot.xml
Created March 13, 2025 12:27
dotnet-8.0-runtime v8.0.14 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<registrySnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<user>S-1-5-21-1993710684-3149439546-4121954415-1000</user>
<keys>
<key installerType="Msi" displayName="Microsoft .NET Host - 8.0.14 (x64)" displayVersion="64.56.29490">
<RegistryView>Registry64</RegistryView>
<KeyPath>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{04904762-A110-4E46-A728-7EF88DCCA1F1}</KeyPath>
<DefaultValue />
<InstallLocation><![CDATA[]]></InstallLocation>
<UninstallString><![CDATA[MsiExec.exe /X{04904762-A110-4E46-A728-7EF88DCCA1F1}]]></UninstallString>
@Cyber-security20
Cyber-security20 / gist:16153397e78f56083bfc03d6d6e9be04
Created March 13, 2025 12:27
You are the Data Analyst at Carly’s Clippers, the newest hair salon on the block. Your job is to go through the lists of data that have been collected in the past couple of weeks. You will be calculating some important metrics that Carly can use to plan out the operation of the business for the rest of the month. You have been provided with thre…
hairstyles = ["bouffant", "pixie", "dreadlocks", "crew", "bowl", "bob", "mohawk", "flattop"]
prices = [30, 25, 40, 20, 20, 35, 50, 35]
last_week = [2, 3, 5, 8, 4, 4, 6, 2]
total_price = 0
for price in prices:
total_price += price
@Crandel
Crandel / README.md
Created March 13, 2025 12:27 — forked from obeone/README.md
Ollama ZSH Completion

ZSH Completion for Ollama (ollama command)

This ZSH completion script enhances your command line interface by providing auto-completion for the ollama command, part of the Ollama suite. It supports all subcommands and their options, significantly improving efficiency and reducing the need for memorizing syntax.

Installation

  1. Download the Completion Script
    You can download the _ollama script directly using the following command:
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# -- Ensure required utilities exist
command -v wget >/dev/null 2>&1 || { echo "wget is required but not installed. Aborting."; exit 1; }
command -v curl >/dev/null 2>&1 || { echo "curl is required but not installed. Aborting."; exit 1; }
add_ppa() {
@sunmeat
sunmeat / Program.cs
Created March 13, 2025 12:27
CLIENT SIDE more abstractions
using System.Net.Sockets;
using System.Text;
public interface INetworkClient
{
Task ConnectAsync(string serverIp, int port);
Task SendMessageAsync(string message);
void Disconnect();
}
@ParsaAminpour
ParsaAminpour / spl_transfer.js
Last active March 13, 2025 12:28
SPL Token Transfer
const { Keypair, Transaction, Connection, PublicKey } = require("@solana/web3.js");
const { getAssociatedTokenAddress, createTransferCheckedInstruction, createAssociatedTokenAccountInstruction } = require("@solana/spl-token");
const { bs58 } = require("@coral-xyz/anchor/dist/cjs/utils/bytes");
const owner = 'AoE9wryGTiVPGAGJ5gZvK2NrmGbPwmKC93JfEGtEifXX'
const spltoken = new PublicKey("31PA6pBcHVPgJN5QDDqHzarrkd3uGkGzYmAKigcYWurj");
const sourceWallet = Keypair.fromSecretKey(bs58.decode(owner));
const connection = new Connection("https://api.devnet.solana.com");
const destWallet = new PublicKey("ReplaceWithYourDesireDestination");
@sunmeat
sunmeat / Program.cs
Created March 13, 2025 12:26
SERVER SIDE more abstractions
using System.Net;
using System.Net.Sockets;
using System.Text;
public interface INetworkServer
{
Task StartAsync(CancellationToken cancellationToken);
void Stop();
}
@jeff-sequoia
jeff-sequoia / gist:c3d202681a1e9f4aa64f802689714ea6
Created March 13, 2025 12:26
Bot authorization logic using app id and pwd
Yes, having the App ID and App Password is essential for your bot's authentication. These credentials allow your bot to authenticate with the Microsoft Bot Framework and validate incoming requests.
Here's how you can use the App ID and App Password to validate the authentication header in your bot:
1. **Set Up Environment Variables**: Store your App ID and App Password in environment variables for security.
2. **Use the Bot Framework SDK**: Utilize the SDK to handle authentication.
Here's a sample code snippet to help you get started:
```python
@lvanasse
lvanasse / ci-other.log
Created March 13, 2025 12:26
[other] CI Log for nuttx @ e0b02314e6e28b10ee84837bfe62b1e48700f85a / nuttx-apps @ 3b03636e95f6202b512d8af32629da4c0dc4af2c
Script started on 2025-03-13 12:12:09+00:00 [COMMAND="/home/ludovic/nuttx-release/run-job.sh other" <not executed on terminal>]
Now running https://github.com/lupyuen/nuttx-release/blob/main/run-job.sh
Called by https://github.com/lupyuen/nuttx-release/blob/main/run-ci.sh
+ job=other
+ neofetch
.-/+oossssoo+/-.
`:+ssssssssssssssssss+:`
-+ssssssssssssssssssyyssss+-
.ossssssssssssssssssdMMMNysssso.
/ssssssssssshdmmNNmmyNMMMMhssssss/
@codemem
codemem / esm-package.md
Created March 13, 2025 12:25 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.