Skip to content

Instantly share code, notes, and snippets.

View CalebCurry's full-sized avatar
💭
it's complicated

Caleb Curry CalebCurry

💭
it's complicated
View GitHub Profile
import hashlib
def hash_key(key):
"""Returns an integer hash for a given key."""
# Use SHA-256 for consistency in hash values
hash_object = hashlib.sha256(key.encode())
return int(hash_object.hexdigest(), 16)
def distribute_keys(keys, servers):
"""Distributes keys across the given number of servers using hashing."""
<!DOCTYPE html>
<html>
<head>
<title>Throttle and Debounce Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>
</head>
<body>
<button id="clickMe">Click Me (throttled)!</button>
<br><br>

Contributor Agreements

Your Contributions: Any code, documentation, or other material you contribute to Caleb Curry / CodeBreakthrough is done on a voluntary basis.

Ownership and Licensing: By contributing, you give up any ownership or control over your contribution. Caleb Curry / CodeBreakthrough can use it however they choose, even commercially, and decide on any licenses.

Warranties: You confirm that you own the rights to your contribution and that it doesn't infringe on anyone else's rights or break any laws.

@CalebCurry
CalebCurry / cargo.toml
Created January 20, 2024 14:59
basic example of serializing a message, signing it, and verifying it
[package]
name = "signatures"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bls-signatures = "0.15.0"
rand = "0.8.5"
### Keybase proof
I hereby claim:
* I am calebcurry on github.
* I am calebcurry (https://keybase.io/calebcurry) on keybase.
* I have a public key ASDDn18kVSy1fD5df9a92_iwPtYDljnNa8gUDN8cfHMYTAo
To claim this, I am signing this object:
/*
So far we've covered the basics. What now?
Basically, deep dive the last section. Study up on structs, pointers, and memory management
Master input and output and data validation
Figure out how to connect to a database or file in C and make data driven applications
Study data structures and how to make them in C
- linked lists
- stack
- queue
- etc...
#include <stdio.h>
#include <stdlib.h> //required for the memory functions
#include <stdbool.h>
#include <string.h>
typedef struct user
{
char name[30];
int age;
bool isVerified;
#include <stdio.h>
#include <string.h>
struct rectangle
{
int length;
int width;
};
typedef struct position //name here is optional
#include <stdio.h>
void square(int *a)
{
*a *= *a;
//we can change value where pointer points to
}
//int getSizeIllustration (int data[])
//{
#ifndef HEADER_FILE //include guards prevent multiple includsion
#define HEADER_FILE //if not yet defined, define it
//optional but recommended
int square (int input);
int cube(int input);
int power(int input, int exponent);
int recursivePower(int input, int exponent);
void changeVal(int *a);
int oldestValue( int *ages, int size);