Skip to content

Instantly share code, notes, and snippets.

View ahoward's full-sized avatar
💭
probably outside if i'm not hacking.

ara.t.howard ahoward

💭
probably outside if i'm not hacking.
  • https://drawohara.io
  • Palmer, Alaska
  • 16:28 (UTC -08:00)
  • Instagram drawohara
View GitHub Profile
@schappim
schappim / deep_research.rb
Created February 9, 2025 09:39
A recreation of OpenAI's Deep Research feature in Ruby
#!/usr/bin/env ruby
# deep_research.rb
require 'openai'
require 'json'
require 'net/http'
require 'uri'
require 'timeout'
require 'time'
@radanskoric
radanskoric / app.rb
Created November 28, 2023 10:25
Turbo Frames and Streams on Sinatra
# This is a little experiment in using Turbo Frames and Streams without Rails.
# Built using just plain Sinatra as the web server.
#
# Make sure that you have sinatra and puma (or some other server) installed:
# gem install sinatra
# gem install puma
#
# You can then run the app with:
# ruby app.rb
require 'sinatra'
@lestoni
lestoni / gist:8c74da455cce3d36eb68
Last active April 8, 2025 13:37
vim folding cheatsheet

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@copiousfreetime
copiousfreetime / bdrg-2013-01_rails-vuln.md
Created January 16, 2013 17:59
Links used for 2013-01-15 Boulder Ruby User Group talk about the recent Rails vulnerabilities.
@ahoward
ahoward / a.rb
Created July 25, 2012 21:13
pry without a prompt
def console!(&block)
require 'pry'
Pry.config.hooks.send(:hooks).keys.
each{|which| Pry.config.hooks.clear(which)}
prompt = ">> "
Pry.config.prompt = proc{|*a| prompt }
block.binding.pry
@cookrn
cookrn / instructions.md
Last active March 29, 2017 15:12
Named Screen -- Inspired by @ahoward

Named Screen

A utility inspired by @ahoward that allows screens to be the name of the directory they were spawned from. This is mainly helpful for Terminal/iTerm tabs.

Executing this should rejoin sessions with the same name if they already exist or otherwise create them.

Usage

  1. Place or symlink into your path (I symlink as ns)
  2. Ensure the script is executable
@cookrn
cookrn / 00_usage.md
Created April 10, 2012 02:27
A Reasonable `to_map` for `ActiveRecord::Base`

to_map

A to_map function is very useful when you want to convert models to PLAIN OLD DATA. Think presenters, conductors, APIs, JSON, etc...

Installation

Add this monkey-patch to your Rails project and call it on your model instances.

Example Models

@cookrn
cookrn / links.md
Created March 20, 2012 19:51
How to Create and Apply a Patch w/ Git Across Similar Repositories
@durran
durran / sequence.rb
Created December 29, 2011 12:41
Integer sequence ids in Mongo
Mongoid.database.add_stored_function "sequence", <<-__
function(name) {
var ret = db.counters.findAndModify({ query: { _id: name}, update: { $inc : { next: 1}}, "new" :true, upsert: true});
return ret.next;
}
__
class Sequence
include Mongoid::Fields::Serializable