Skip to content

Instantly share code, notes, and snippets.

View richardgroves's full-sized avatar

Richard Groves richardgroves

View GitHub Profile
@rain-1
rain-1 / LLM.md
Last active May 22, 2024 08:18
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.

@javiribera
javiribera / gist:3c1cbb0f2831d42d83bb2473188e3fac
Created March 15, 2020 17:10
Download entire iCloud shared albums icloud-album-download.sh
#!/bin/bash
# requires jq
# arg 1: iCloud web album URL
# arg 2: folder to download into (optional)
#
# Credits: https://gist.github.com/zneak/8f719cd81967e0eb2234897491e051ec
# icloud-album-download.sh
function curl_post_json {
//
// TextStyle.swift
//
// Created by Rob Napier on 12/20/19.
// Copyright © 2019 Rob Napier. All rights reserved.
//
import SwiftUI
public struct TextStyle {
@alladinian
alladinian / SwiftUICocoaApp.swift
Last active April 21, 2022 18:21
A super simple Cocoa App boilerplate for SwiftUI prototyping _without_ Xcode
import Cocoa
import SwiftUI
func startApp(content: NSView) {
let app = NSApplication.shared
let menubar = NSMenu()
let appMenuItem = NSMenuItem()
let appMenu = NSMenu()
let appName = ProcessInfo.processInfo.processName
let quitTitle = "Quit \(appName)"
import UIKit
import PlaygroundSupport
let touchAnimationDuration: TimeInterval = 0.3
var shouldPulse = true
class Handler {
@objc
func didTouchUpInside(_ button: UIButton) {
@pepasflo
pepasflo / .gitignore
Last active October 22, 2023 12:06
Scripts for encrypting / decrypting secrets (to prevent them from being accidentally checked into git)
secrets/
@arturgrigor
arturgrigor / Podfile
Created September 10, 2018 09:55
Sample Podfile for silencing warnings for CocoaPods dependencies
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target '%TargetName%' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for %TargetName%
# pod 'FBSDKCoreKit'
end
@ole
ole / UIAlertController+TextField.swift
Last active September 13, 2022 14:20
A UIAlertController with a text field and the ability to perform validation on the text the user has entered while the alert is on screen. The OK button is only enabled when the entered text passes validation. More info: https://oleb.net/2018/uialertcontroller-textfield/
import UIKit
/// A validation rule for text input.
public enum TextValidationRule {
/// Any input is valid, including an empty string.
case noRestriction
/// The input must not be empty.
case nonEmpty
/// The enitre input must match a regular expression. A matching substring is not enough.
case regularExpression(NSRegularExpression)
@shaps80
shaps80 / 1. UserDefaults+Key.swift
Last active September 25, 2020 08:29
Adds a Swift extension to make UserDefaults more consistent to work with.
//
// UserDefaults.swift
//
// Created by Shaps Benkau on 24/05/2018.
// Copyright © 2018 152percent Ltd. All rights reserved.
//
import Foundation
#if os(iOS)
@DougGregor
DougGregor / dynamic_member_lookup_environment.swift
Created May 2, 2018 16:59
Using Swift 4.2's @dynamicMemberLookup to expose environment variables
import Darwin
@dynamicMemberLookup
struct Environment {
subscript(dynamicMember name: String) -> String? {
get {
guard let value = getenv(name) else { return nil }
return String(validatingUTF8: value)
}