Skip to content

Instantly share code, notes, and snippets.

View jimmyhoran's full-sized avatar
🛠️
Working on my own thing

Jimmy Horan jimmyhoran

🛠️
Working on my own thing
View GitHub Profile
@jlia0
jlia0 / agent loop
Last active April 21, 2025 15:19
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@willccbb
willccbb / grpo_demo.py
Last active April 21, 2025 12:44
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
@Jackman3005
Jackman3005 / Prisma.ts
Created May 20, 2024 04:45
Prisma Query Debugging code
function buildPrismaWithQueryDebugging(
sqlQueryReportingThresholdMs: number,
prismaActionReportingThresholdMs: number
) {
const prisma = new PrismaClient({
log: [
{
emit: "event",
level: "query",
@mjbalcueva
mjbalcueva / password-input.tsx
Last active April 20, 2025 15:15
shadcn ui custom password input
'use client'
import * as React from 'react'
import { EyeIcon, EyeOffIcon } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Input, type InputProps } from '@/components/ui/input'
import { cn } from '@/lib/utils'
const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(({ className, ...props }, ref) => {
extension UIButton {
// padding - the spacing between the Image and the Title
func centerTitleVertically(padding: CGFloat = 12.0) {
guard let imageViewSize = self.imageView?.frame.size, let titleLabelSize = self.titleLabel?.frame.size
else {
return
}
let totalHeight = imageViewSize.height + titleLabelSize.height + padding
extension UIButton {
// iconName - SFSymbol Name
// size - Size of the Symbol in points
// scale - .small, .medium, .large
// weight - .ultralight, .thin, .light, .regular, .medium, .semibold, .bold, .heavy, .black
// tintColor - Color of the Symbol
// backgroundColor - Background color of the button
func setSFSymbol(iconName: String, size: CGFloat, weight: UIImage.SymbolWeight,
scale: UIImage.SymbolScale, tintColor: UIColor, backgroundColor: UIColor) {
let symbolConfiguration = UIImage.SymbolConfiguration(pointSize: size, weight: weight, scale: scale)
observeKeyboardWillShowNotification(scrollView) { [weak self] keyboardSize in
guard let keyboardHeight = keyboardSize?.height else { return }
self?.someViewYouWantToMoveBottomConstraint?.constant = -keyboardHeight
}
observeKeyboardWillHideNotification(scrollView) { [weak self] _ in
self?.someViewYouWantToMoveBottomConstraint?.constant = .zero
}
protocol ScrollableContentKeyboardObserving {
func observeKeyboardWillShowNotification(_ scrollView: UIScrollView, onShowHandler onShow: ((CGSize?) -> Void)?)
func observeKeyboardWillHideNotification(_ scrollView: UIScrollView, onHideHandler onHide: ((CGSize?) -> Void)?)
}
extension ScrollableContentKeyboardObserving {
func observeKeyboardWillShowNotification(_ scrollView: UIScrollView, onShowHandler onShow: ((CGSize?) -> Void)? = nil) {
let block: (Notification) -> Void = { notification -> Void in
extension NSError {
/// A convenience initializer for NSError to set its description.
///
/// - Parameters:
/// - domain: The error domain.
/// - code: The error code.
/// - description: Some description for this error.
convenience init(domain: String, code: Int, description: String) {
self.init(domain: domain, code: code, userInfo: [(kCFErrorLocalizedDescriptionKey as CFString) as String: description])
@edvinasbartkus
edvinasbartkus / android.yml
Created November 20, 2019 14:45
Running Detox tests for Android on Github Actions Workflow
name: Android
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout