Skip to content

Instantly share code, notes, and snippets.

View millisami's full-sized avatar
🎯
Focusing on landing a Web3 Job

Sachin Sagar Rai millisami

🎯
Focusing on landing a Web3 Job
View GitHub Profile
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
# an example Monit configuration file for delayed_job
#
# To use:
# 1. copy to /var/www/apps/{app_name}/shared/delayed_job.monitrc
# 2. replace {app_name} and {environment} as appropriate
# 3. add this to your /etc/monit/monitrc
#
# include /var/www/apps/{app_name}/shared/delayed_job.monitrc
check process delayed_job with pidfile /var/www/apps/{app_name}/shared/pids/delayed_job.pid
@millisami
millisami / git.rake
Created October 4, 2009 15:22 — forked from maxim/git.rake
# Rake tasks for managing git plugins with submodules.
#
# These tasks aim to make life simpler by automating all the boring work.
# What you get:
# - complete git integration (all you need to know is install, uninstall and update)
# - complete github integration (only use author name + plugin name)
# - rails plugin hooks (install.rb/uninstall.rb) are taken care of
#
# Available commands:
#
@millisami
millisami / gist:217770
Created October 24, 2009 22:18 — forked from dhh/gist:45076
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName example.com
# ServerAlias *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
# destroy all objects
Given(/^no #{capture_plural_factory} exist$/) do |plural_factory|
plural_factory.classify.constantize.destroy_all
# you could add the following to verify that there are indeed no records
find_models(plural_factory.singularize).should be_nil
end
Rails CMS alternatives
======================
Note: project activity was checked on 11/26/09.
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
# Put this in config/initializers/date_time_format.rb
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
:short => lambda { |time| time.strftime("%b #{time.day.ordinalize}, %Y - %H:%M") }
)
# To use this time format do:
DateTime.now.to_s(:short)
@millisami
millisami / tinyurl.rb
Created December 27, 2009 05:22 — forked from woods/tinyurl.rb
#!/usr/bin/env ruby
#
# A complete URL-shortening web application, written in Ruby/Sinatra. Run it
# from the command line, and then visit http://localhost:4567/
#
# Or to run it under apache/passenger, you'll need a config.ru file with the
# following contents:
#
# require 'tinyurl'
# run Sinatra::Application
##formtastic_datepicker_interface
module Formtastic
module DatePicker
protected
def datepicker_input(method, options = {})
format = options[:format] || ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[:default] || '%d %b %Y'
string_input(method, datepicker_options(format, object.send(method)).merge(options))
end
abstract attribute_normalizer authlogic authlogic_rpx autotest-rails aws aws_cloud_map aws_credentials aws-ext aws-s3 aws-sdb bcrypt-ruby blueprints bmabey-email_spec
builder bundler cancan capistrano cgi_multipart_eof_fix compass chronic classifier closure-compiler colored columnize compass-960-plugin compass-colors configuration construct
contacts crack culerity daemons database_cleaner data_objects delayed_job delayed_paperclip diff-lcs directory_watcher validatable erubis eventmachine extlib facebooker
facets factory_girl factory_girl_extensions fakeweb fancy-buttons fastercsv fastthread fcoury-matchy ffi ffmike-test_benchmark flay flexmock flog metric_fu formtastic frankie
friendly fssm gdata gembox gemcutter gem_plugin geoip geokit trample git github git_remote_branch glue gravtastic haml haml-edge has_scope heckle helperful heroku highline hirb