This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| claude-aws() { | |
| local cache_file="/tmp/bedrock_models_cache" | |
| local cache_ttl=86400 | |
| local selected_model_id | |
| local selected_profile | |
| local current_time=$(date +%s) | |
| # 1. Select AWS Profile via fzf FIRST | |
| # We need this now so it can be used for the cache refresh if needed | |
| selected_profile=$(aws-vault list --profiles | fzf --height 20% --border --header "Select AWS Profile") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script type="module"> | |
| import { Application, Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js" | |
| import { enter, leave, toggle } from "https://unpkg.com/el-transition@0.0.7/index.js" | |
| window.Stimulus = Application.start() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # via https://gist.github.com/419201#file_gitconfig.bash | |
| # Install (from Matt's gist) these useful Git aliases & configurations with the following command: | |
| # $ bash <(curl -s https://raw.github.com/gist/419201/gitconfig.bash) | |
| git config --global color.ui auto # colorize output (Git 1.5.5 or later) | |
| git config --global color.interactive auto # and from 1.5.4 onwards, this will works: | |
| echo "Set your name & email to be added to your commits." | |
| echo -n "Please enter your name: " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'json' | |
| require 'redis' | |
| class RedisComments | |
| def initialize(redis,namespace,sort_proc=nil) | |
| @r = redis | |
| @namespace = namespace | |
| @sort_proc = sort_proc | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <style type="text/css"> | |
| .nested { | |
| display: none; | |
| } | |
| </style> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| $(document).ready(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user app; | |
| worker_processes 2; | |
| error_log /home/app/logs/nginx.error.log info; | |
| events { | |
| worker_connections 1024; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sequel' | |
| # Database | |
| # | |
| # A helper class to wrap calls to Sequel Database, primarily for getting a database from a YAML config | |
| # file and for migrating. | |
| class Database | |
| @@configuration_file = File.join( File.dirname(__FILE__), "../config/database.yml" ) | |
| raise Exception.new("No '#{@@configuration_file}' file was found. ") if @@configuration_file.nil? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
| # - a browser with WebSocket support | |
| # | |
| # Usage: | |
| # ruby redis_pubsub_demo.rb | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/hello/:name' do |name| | |
| "#{params.inspect}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.slowEach = function(array, interval, callback) { | |
| if(!array.length) return; | |
| var i = 0; | |
| next(); | |
| function next() { | |
| if(callback.call(array[i], i, array[i]) !== false) | |
| if(++i < array.length) | |
| setTimeout(next, interval); | |
| } |
NewerOlder