Skip to content

Instantly share code, notes, and snippets.

View kathgironpe's full-sized avatar

Katherine Giron Pe kathgironpe

View GitHub Profile
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
check_auth_args user, secret if user or secret
sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
user mauricio users; #this should be the username and the main group of the user that's going to deploy the application
worker_processes 4;
error_log logs/error.log;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
@kathgironpe
kathgironpe / jquery_cyle_display_loading_message.js
Created October 25, 2009 17:29
jQuery Cycle - Display Loading Message if Images Are not Loaded
$(document).ready(function($) {
$('#gallery-slideshow, .gallery-controls').hide();
$('#loading').show();
var last_slide = $('#gallery-slideshow li img:last');
var last_image_attr = last_slide.attr("src");
last_slide.onImagesLoad({
itemCallback: itemImagesLoaded
});
function itemImagesLoaded(){
$('#gallery-slideshow, .gallery-controls').show();
unless params[:golf_club_photo].nil?
Notifier.deliver_gc_images_uploaded(admin_gcsf_details_url('basic','golf_club_photo',@full_gc),@golf_club_photo, golf_club_show_url('home',@full_gc))
end
desc "Load production data into development database"
task :import_remote_db do
filename = "dump.#{Time.now.strftime '%Y-%m-%d_%H:%M:%S'}.sql"
dbuser = "yourusername"
dbhost = "yourhostname"
dbpassword = "yourpassword"
application_db = "yourdatabasename"
local_db_host = "localhost"
local_db_user = "local_user_name"
def teaser(text, wordcount, omission)
text.split[0..(wordcount-1)].join(" ") + (text.split.size > wordcount ? " " + omission : "")
end
-- control frame ----------
c:0023 p:-2763926 s:0135 b:0135 l:000134 d:000134 METHOD /Users/katz/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta2/lib/active_support/core_ext/class/attribute_accessors.rb:5
c:0022 p:0024 s:0125 b:0125 l:000124 d:000124 METHOD /Users/katz/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta2/lib/active_support/callbacks.rb:88
c:0021 p:0013 s:0119 b:0119 l:0014d0 d:0014d0 METHOD /Users/katz/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta2/lib/action_dispatch/middleware/callbacks.rb:44
c:0020 p:0014 s:0115 b:0115 l:000114 d:000114 METHOD /Users/katz/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/sendfile.rb:105
c:0019 p:0046 s:0105 b:0105 l:000104 d:000104 METHOD /Users/katz/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta2/lib/action_dispatch/middleware/remote_ip.rb:48
c:0018 p:0014 s:0101 b:0101 l:000100 d:000100 METHOD /Users/katz/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta2/lib/action_dispatch/middleware/show_exceptions.rb:48
c:0017 p:0026 s:00
sudo gem list | cut -d" " -f1 | xargs sudo gem uninstall -aIx
./configure --prefix=/usr/local/php5 --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc --with-config-file-path=/etc --with-zlib --with-zlib-dir=/usr --with-openssl --without-iconv --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-sockets --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-mcrypt --with-xpm-dir=/usr/X11R6 --with-pgsql=/usr/local/psql --with-apxs2 --with-curl=/usr/local
def to_html(markdown)
markdown = markdown.gsub("<code>", '<pre class="brush: ruby">').gsub("</code>", "</pre>")
markdown = RDiscount.new(markdown)
markdown = markdown.to_html
end