Skip to content

Instantly share code, notes, and snippets.

View alexrozanski's full-sized avatar

Alex Rozanski alexrozanski

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

@importRyan
importRyan / whenHovered.md
Last active April 6, 2024 06:54
Reliable SwiftUI mouse hover

Reliable mouseEnter/Exit for SwiftUI

Kapture 2021-03-01 at 14 43 39

On Mac, SwiftUI's .onHover closure is not always called on mouse exit, particularly with high cursor velocity. A grid of targets or with finer target shapes will often have multiple targets falsely active after the mouse has moved on.

It is easy to run back to AppKit's safety. Below is a SwiftUI-like modifier for reliable mouse-tracking. You can easily adapt it for other mouse tracking needs.

import SwiftUI
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
// See: https://devforums.apple.com/message/1000934#1000934
import Foundation
// Logic
operator prefix ¬ {}
@prefix func ¬ (value: Bool) -> Bool {
return !value
}
@rgcottrell
rgcottrell / gist:fdc7dd7cf5bc3ed61010
Last active May 24, 2023 21:57
Thread safe shared instance "singletons" in Swift.
class Singleton {
class var sharedInstance: Singleton {
struct Static {
static var token: dispatch_once_t = 0
static var instance: Singleton!
}
dispatch_once(&Static.token) {
Static.instance = Singleton()
}
return Static.instance
@orta
orta / podcasts.md
Created January 15, 2014 15:14
Recommended Podcasts

Tech

  • Edge Cases - Highly technical, lots of raw content.
  • Springboard - Cute, useful to me as someone interested in how people learn iOS.
  • Debug - Lots of interviews with ex-apple employees.

Mental Cooldown

  • Escape Pod - Small Sci-Fi stories, quality varies but nice for a long walk where you want your mind to wonder.
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@steventroughtonsmith
steventroughtonsmith / gist:7515380
Last active April 2, 2019 01:38
iOS 7 UIKeyCommand keydown/keyup and keycode input implementation for a UIResponder. Private API, of course…
-(BOOL)canBecomeFirstResponder
{
return YES;
}
-(UIKeyCommand *)_keyCommandForEvent:(UIEvent *)event // UIPhysicalKeyboardEvent
{
NSLog(@"keyCommandForEvent: %@\n\
type = %i\n\
keycode = %@\n\
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@simonmichael
simonmichael / gist:1185421
Created September 1, 2011 03:59
ghc-pkg-clean, ghc-pkg-reset
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages.
# ghc-pkg-clean -f cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place.