Skip to content

Instantly share code, notes, and snippets.

@donbr
donbr / langchain_vertexai_image_summarization.ipynb
Last active January 28, 2024 07:37
Vertex AI Models - Image Summarization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mirakui
mirakui / compile_assets_and_rsync_with_remote_cache.rb
Created November 15, 2012 13:19
Fast deploy using capistrano_rsync_with_remote_cache and turbo-sprockets-rails3
# Requirements:
# https://github.com/vigetlabs/capistrano_rsync_with_remote_cache
# https://github.com/ndbroadbent/turbo-sprockets-rails3
require 'capistrano/recipes/deploy/strategy/rsync_with_remote_cache'
Capistrano::Deploy::Strategy::RsyncWithRemoteCache.class_eval do
def deploy!
update_local_cache
prepare_assets
update_remote_cache
finalize_assets
@jhjguxin
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created July 9, 2012 03:32
Creating nested resources in ruby on rails 3 and updating scaffolding links and redirection
@uhlenbrock
uhlenbrock / deploy.rb
Created December 14, 2011 17:36
Precompile assets locally for Capistrano deploy
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
@rsvp
rsvp / netspeed.sh
Last active May 13, 2020 15:08
netspeed.sh : check download speed rate via command line | Linux bash script
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2013-07-11
#
# _______________| netspeed : check download speed via command line.
#
# Usage: netspeed [tokyo, london, usw, use, east, west, URL]
# ^default U.S. west coast.
# [ -speed_KB/sec ]
# ^negation activates the Mbps converter.
#
@msp
msp / unicorn-logrotate
Created May 19, 2011 11:19
Unicorn and logrotate
Unhandled listen loop exception #<IOError: closed stream>.
/var/www/drownedinsound/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:624:in `select'
/var/www/drownedinsound/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:624:in `worker_loop'
/var/www/drownedinsound/shared/bundle/ruby/1.8/gems/newrelic_rpm-2.13.4/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:7:in `call'
/var/www/drownedinsound/shared/bundle/ruby/1.8/gems/newrelic_rpm-2.13.4/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:7:in `worker_loop'
/var/www/drownedinsound/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:496:in `spawn_missing_workers'
/var/www/drownedinsound/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:493:in `fork'
/var/www/drownedinsound/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:493:in `spawn_missing_workers'
/var/www/drownedinsound/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_ser
@denmarkin
denmarkin / devise.en.yml
Created May 4, 2011 18:50
Custom overwrite for Device::SessionsController
sessions:
signed_in: 'Signed in successfully.'
signed_in_first_time: "MY CUSTOM WELCOME GREETING. DO NOT FORGET TO READ OUR GUIDELINE!"
signed_out: 'Signed out successfully.'
@troex
troex / unicorn.sh
Created April 4, 2011 20:57
Unicorn start/stop/restart script for Debian
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs mysql
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: unicorn initscript
# Description: Unicorn is an HTTP server for Rack application
### END INIT INFO
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby