Skip to content

Instantly share code, notes, and snippets.

View jhwheeler's full-sized avatar

Jackson Holiday Wheeler jhwheeler

View GitHub Profile
@gamingflexer
gamingflexer / main.py
Created July 19, 2023 09:02
Anthropic's tokenizer for Claude
from transformers import PreTrainedTokenizerFast
fast_tokenizer = PreTrainedTokenizerFast(tokenizer_file="/home/ubuntu/LLM/module/claude-v1-tokenization.json")
text = "Hello, this is a test input."
tokens = fast_tokenizer.tokenize(text)
tokens
@swyxio
swyxio / readme.md
Last active January 16, 2022 10:36
svelte society day talks and resources -
@miazga
miazga / howto.md
Last active March 23, 2024 16:59
Expo + Android TV
@hassanabbasi
hassanabbasi / Api.js
Last active December 21, 2019 10:34
Generalized API Manager for Javascript based applications
import axios from 'axios';
import qs from 'qs';
// Customized Axios object for API calls
var Api = axios.create({
// NOTE: Replace the API URL
baseURL: 'http://api.example.com/',
responseType: 'json',
withCredentials: true
// Add whatever you want to configure Axios here
@Atinux
Atinux / async-foreach.js
Last active October 10, 2023 03:04
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@islishude
islishude / caret.js
Last active November 26, 2023 00:16
[DEPRECATED]get/set caret position in contentEditable or textarea/input element(JavaScript)
/**
* @file get/set caret position and insert text
* @author islishude
* @license MIT
*/
export class Caret {
/**
* get/set caret position
* @param {HTMLColletion} target
*/
@jhwheeler
jhwheeler / language-learning-techniques.md
Last active November 8, 2023 12:40
Efficient and effective language learning techniques: Shadowing, Scriptorium, and Side-by-Side Reading.

Language Learning Techniques

Some of the techniques I've used to learn languages quickly and thoroughly:

  1. Shadowing

  2. Scriptorium

  3. Side-by-Side Reading

@jhwheeler
jhwheeler / bigONotation.js
Last active February 21, 2024 18:36
Big O Notation Exercises
// 1. Even or odd
function isEven(value){
if (value % 2 == 0){
return true;
}
else
return false;
}
@parmentf
parmentf / GitCommitEmoji.md
Last active April 26, 2024 09:53
Git Commit message Emoji