Skip to content

Instantly share code, notes, and snippets.

@emcmanus
emcmanus / LLM.md
Created April 3, 2023 21:38 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

Magic Wordle Words

The Best First-Guess in Wordle

Total character hints for each first guess (across the set of all possible answers):

  1. arose 24,791 hints
  2. soare 24,791
  3. aeros 24,791
  4. serai 24,469
@emcmanus
emcmanus / snakeToCamelCase.js
Last active May 17, 2022 02:29 — forked from felixjung/snakeToCamelCase.js
ES6 module to recursively convert snake case keys in an object to camel case using lodash.
'use strict';
/**
* @example
* import keysToCamelCase from './snakeToCamelCase';
* keysToCamelCase({bad_key: 1}); => {badKey: 1}
* keysToCamelCase([{bad_key: 1}]); => [{badKey: 1}]
*/
function keysToCamelCase(object) {
@emcmanus
emcmanus / NSDate+TimeAgoInWords.swift
Created October 3, 2014 22:00
A Swift port of Rails' time_ago_in_words.
//
// NSDate+TimeAgoInWords.swift
//
// A Swift port of Rails' time_ago_in_words.
// Created by Ed McManus for Yardsale on 9/30/14.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@emcmanus
emcmanus / gist:6065901
Created July 23, 2013 20:31
Parse.Promise Edge Cases
try
Parse.Promise.as().then( ->
Parse.Promise.as 1, 2, 3
).then((a, b, c) ->
# a, b, and c all have values
console.error "1. a: #{a}, b: #{b}, c: #{c}"
)
# Can we transform Parse.Promise.error into a success?
Parse.Promise.error().then( null, (error) ->
@emcmanus
emcmanus / gist:5630504
Created May 22, 2013 20:08
Clean whitespace from objective-c source.
find . -name "*.[hm]" -type f -print0 | xargs -0 sed -i '' -E "s/[[:space:]]*\$//"
@emcmanus
emcmanus / PFObject+YSComparison.h
Last active December 12, 2015 01:59
Objective-C isEqual implementation for Parse objects (PFObject, PFFile, and PFRelation)
//
// PFObject+YSComparison.h
//
// Created by Ed McManus for Yardsale Inc. on 2/1/13
// Learn more at https://getyardsale.com
//
// Requires BlocksKit https://github.com/pandamonia/BlocksKit
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@emcmanus
emcmanus / gist:2894558
Created June 8, 2012 08:50
Git Status in FishFish Prompt - Fish port of __git_ps1
# Port of __git_ps1 for Fish shell (tested with FishFish)
#--------------------------------------------------------------------------------------------------
# https://github.com/bjeanes/dot-files/tree/294254ce2f064bbfc586e98107da1ed510898ffd/fish/functions
# via @bjeanes - https://github.com/bjeanes
function __git_ps1
set -l g (git rev-parse --git-dir ^/dev/null)
if [ -n "$g" ]
set -l r ""
set -l b ""
@emcmanus
emcmanus / Chainable.rb
Created May 13, 2012 17:42
Simple paperclip processor that allows you to chain image styles.
#
# Chainable.rb
#
# Allows you to chain Paperclip styles.
# Created by Ed McManus for Yardsale Inc. on 5/12/2012
#
#
# *********************************************************************
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@emcmanus
emcmanus / RKObjectManager+Blocks.h
Created April 14, 2012 02:22
Block-based API Wrapper for Restkit (Requires A2DynamicDelegate)
//
// RKObjectManager+Blocks.h
//
// Created by Ed McManus for Yardsale Inc. on 3/27/12
// Learn more at https://getyardsale.com
//
// Requires A2DynamicDelegate https://github.com/pandamonia/A2DynamicDelegate
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal