Skip to content

Instantly share code, notes, and snippets.

@rnmp
rnmp / Stacks.swift
Created October 29, 2024 02:27
Prototype of stacks in SwiftUI. See it in action: https://youtu.be/g7ag_P3TYZg
import SwiftUI
// The following code was generated using GPT 4-o1 with modifications and follow ups.
//
// Initial prompt:
//
// How would you code a view in swiftui where there are 3 views on top of each other
// (think 3 squares) and when tapped, they transition into a full window view where they
// are all presented in a grid? This is more or less similar to what macOS has in stacks
// on the dock
@rnmp
rnmp / DraggablePanel.swift
Last active October 15, 2024 19:59
Draggable floating panel in SwiftUI. See use case: https://youtu.be/10Ee-BAxGug
import SwiftUI
// Generated using ChatGPT 4o
// Prompts:
// - "How to quickly make a panel using SwiftUI on macOS that can be dragged around inside a window?"
// - "Let's make it take content as closure"
struct DraggablePanel<Content: View>: View {
@State private var offset = CGSize.zero
@State private var dragOffset = CGSize.zero
@rnmp
rnmp / Sidebar.swift
Last active October 28, 2024 16:31
Sliding sidebar (hover to show) in SwiftUI. See more or less how I built it: https://youtu.be/FYrNgz2xADc
import SwiftUI
struct Sidebar<Content: View>: View {
@State var visible: Bool = false
var content: () -> Content
init(@ViewBuilder content: @escaping () -> Content) {
self.content = content
}
@rnmp
rnmp / vim_the_guide.md
Last active April 8, 2020 15:36
Vim: The Guide

Why I switched?

  1. VSCode can get so fucking slow sometimes
  2. VSCode-like tooling is available for vim (typescript autoimport, autofixes, etc): E.g. https://github.com/neoclide/coc-tsserver
  3. Vim has way better navigational features built-in: you can move a lot faster in a file once you get used to the commands. More on that later.

How to get started?

  1. Get familiar with vim commands: Run vimtutor on your terminal
  2. Download a decent terminal app if you haven’t already. A lot of people use iTerm2, I prefer Kitty (way faster): https://sw.kovidgoyal.net/kitty/
  3. Install NeoVim
  4. Be prepared to google things you want in vim and add them to your vimconfig, I can’t tell you which ones you should get bc that’s kinda up to you and you should understand which ones work for you, but here’s mine (very messy): https://github.com/rnmp/dotfiles/blob/master/.config/nvim/init.vim
@rnmp
rnmp / index.html
Last active January 9, 2020 19:03
Get screen + window resolutions
<html>
<body><script>document.body.innerHTML = `
<h1>Alright, alright, alright</h1>
<p>Screen resolution: ${window.screen.width}x${window.screen.height}
<p>Window resolution: ${window.innerWidth}x${window.innerHeight}
`;
</script></body>
</html>
@rnmp
rnmp / deets.md
Last active November 18, 2019 17:05
Friendsgiving Deets

When?

Wednesday, November 27th

Dinner will commence at 7pm, but appetizers and food will be served starting 4pm. If you can't come at that time that's alright, there will be plenty of food.

Where?

124 Storms Ave 3H
Jersey City, NJ 07306

Call or text Rolando when you get there: +1 561 398 7213

@rnmp
rnmp / 1 - description.md
Last active December 19, 2018 19:59
Small Rm in 2BR Apt with Office Space for working professionals in Bed-Stuy

TBA

@rnmp
rnmp / SketchSystems.spec
Last active June 8, 2018 20:24
Org Profile
Org Profile
Public
Logo
Mission
Cover Photo
What We Do
Org Name
Website Address
Causes
Links
@rnmp
rnmp / cloudSettings
Created February 18, 2018 03:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-02-18T03:24:11.868Z","extensionVersion":"v2.8.7"}
@rnmp
rnmp / launch_agent.plist
Last active April 6, 2017 15:43
Append Notes Count to Task Folders
<!-- Runs script every 5 minutes -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>notes-app-tasks-pending-count.job</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/osascript</string>